Skip to content

Running on macOS (Apple Silicon) — MLX, M5 Neural Engines

MLX is Apple's open-source array framework built for Apple Silicon. Uses unified memory so CPU/GPU ops need no copies. M5 Neural Accelerators give up to 3.97x TTFT — requires macOS 26.2+.

  • MLX is Apple's open-source array framework purpose-built for Apple silicon (pip install mlx), with mlx-lm (pip install mlx-lm) for running/fine-tuning LLMs from Hugging Face. It uses unified memory so CPU/GPU ops need no copies; NumPy-like API; built-in quantization via mlx_lm.convert (a 7B model quantizes to 4-bit in seconds).
  • M5 Neural Accelerators (Nov 2025): dedicated matrix-multiply units, exposed through Metal 4 TensorOps / Metal Performance Shaders. Apple's own benchmarks on a 24 GB MacBook Pro M5 vs M4: TTFT up to 3.97× faster (compute-bound, benefits most), generation speed 1.19–1.27× (memory-bandwidth-bound: 120 GB/s on M4 → 153 GB/s on M5, +28%), and >3.8× faster FLUX-dev-4bit image generation. A 24 GB MacBook Pro holds an 8B in BF16 (17.46 GB) or a 30B MoE 4-bit (17.31 GB) under 18 GB.
  • Requires macOS 26.2+ to use the M5 Neural Accelerators; MLX itself works on all Apple silicon.
  • Runtime choice: MLX/mlx-lm for speed, vllm-mlx for an OpenAI-compatible API, oMLX for features, Ollama for ease. Unified memory is the binding constraint (16 GB is tight; 24–128 GB is comfortable).
  • Apple publishes WWDC sessions on local agentic AI with MLX and distributed MLX inference (JACCL) — good authoritative learning material.

Sources

Date: 2026-10-09