AIAny
AI Train2023
GitHub

MLX Examples

Collection of runnable model implementations — LLaMA, Mistral, Stable Diffusion, Whisper, CLIP, plus LoRA fine-tuning — ported to the MLX array framework so they run natively on Apple silicon's unified memory rather than CUDA.

Introduction

Most model zoos assume an NVIDIA GPU and carry a CUDA mental model with them. This repository exists for the opposite case: it shows what idiomatic model code looks like when the backend is MLX and the CPU and GPU share a single pool of unified memory. The examples are teaching artifacts, not packaged products — each is a minimal, readable port of a well-known architecture that runs on a MacBook with no driver setup.

What Sets It Apart
  • Breadth doubles as a learning map. Text (LLaMA, Mistral, T5, BERT), image (Stable Diffusion, FLUX), audio (Whisper, EnCodec, MusicGen), and multimodal (CLIP, LLaVA, Segment Anything) sit side by side, so you can compare how one framework expresses very different architectures.
  • It shows MLX's defining traits in context. Lazy array evaluation and unified memory mean tensors aren't copied between host and device; the code reads like NumPy but executes on the GPU, which is the whole reason to study these instead of CUDA equivalents.
  • LoRA fine-tuning marks the practical edge. Beyond inference, the LoRA example fine-tunes an LLM locally, making clear what is actually feasible on consumer Apple hardware versus what still needs a data center.
  • It is the canonical reference from the framework's own authors, so the patterns track MLX's API as it evolves rather than drifting like third-party tutorials.
Great Fit / Look Elsewhere

Great fit if you own Apple silicon and learn frameworks best by reading short, complete model implementations, or want a starting point to adapt a known architecture to MLX. Look elsewhere if you need production training pipelines, multi-GPU or cluster distribution, or portability to NVIDIA hardware — these are intentionally minimal single-machine examples, and heavier LLM workflows have largely moved to the separate mlx-lm package.

Information

  • Websitegithub.com
  • OrganizationsApple
  • Authorsml-explore, Awni Hannun, Jagrit Digani, Angelos Katharopoulos, Ronan Collobert
  • Published date2023/11/28

Categories

More Items

Hugging Face
AI Model2026

Uses reinforcement learning alone to improve Qwen3.8-27B on multimodal reasoning and long-horizon agent tasks. Trained on about 1,200 curated tasks, it retains a 256K context and is released in BF16, FP8, and NVFP4.

Details the Xing 4 model architecture, Ascend-scale pretraining systems, and agentic post-training, including a 285B-parameter training run on 8,192 Ascend 910C cards.

GitHub
AI Train2026

Compresses an entire document collection into 16 query-dependent memory tokens for a frozen LLM. It retrieves useful clues across long histories while keeping the model’s input length fixed.