Datagram whitepaper

MLX on Apple Silicon: LLM Inference Benchmarks

November 19, 2026 · Updated November 23, 2026 · M5 Ultra results to be added

Executive summary

On the same Mac and the same model, Ollama's MLX engine generated text up to 2.1× faster than GGUF (llama.cpp) and read prompts up to 62% faster. We measured three generations of Apple Silicon in November 2026: M2 Max, M4 Max and M5 Max.

Our advice: run MLX builds on Apple Silicon wherever one exists, especially for models of 20B parameters and up and on M5-generation Macs. M5 Ultra results (very large models, power, and many users at once) will be added when testing finishes.

Background

Ollama, the most widely used local LLM runner, has two engines on Apple Silicon. Which one runs a model depends on the model's file format.

GGUF MLX
Engine llama.cpp with Metal GPU kernels Apple's MLX machine-learning framework
Model format .gguf files, e.g. Q4_K_M 4-bit safetensors, e.g. nvfp4 or mxfp8 4/8-bit
Runs on Mac, Windows, Linux, NVIDIA/AMD GPUs Apple Silicon only
Ollama tags most models, e.g. qwen3.8:27b-q4_K_M growing set, e.g. qwen3.8:27b-nvfp4, gemma4:12b

Generating text on a Mac is usually limited by memory bandwidth, not compute. Each new token requires reading every weight of a dense model from memory once. That gives a simple ceiling:

Maximum tokens/sec ≈ memory bandwidth (GB/s) ÷ weights read per token (GB)

Reading the prompt (prefill) is the opposite: it processes many tokens at once and is limited by GPU compute. So a faster engine can win in two ways: by using bandwidth better or doing fewer weight reads per token (generation), and by using the GPU's matrix hardware better (prompt reading). Both show up in our results.

Chip (top configuration) Memory bandwidth
M2 Max 400 GB/s
M4 Max 546 GB/s
M5 Max 614 GB/s
M5 Ultra ~1,229 GB/s

Test setup and method

Each model ran as an MLX build and a GGUF build of similar size (within 3%), on the same Mac, through Ollama 0.40.16, talking to Ollama's API directly.

Machine Memory Date Notes
Mac Studio M5 Max 128 GB 2026-11-19 new machine, otherwise idle
Mac Studio M4 Max 128 GB 2026-11-18 Ollama's default context
Mac M2 Max 32 GB 2026-11-19 one model in memory at a time; a working Mac with background apps
Model MLX build GGUF build
Gemma 4 12B gemma4:12b, 7.7 GB gemma4:12b-it-q4_K_M, 8.0 GB
Qwen3.8 27B (dense) qwen3.8:27b-nvfp4, 18.2 GB qwen3.8:27b-q4_K_M, 17.7 GB
  1. A warm-up request per model, then 3 rounds of 4 different prompts per model, alternating which build goes first.
  2. Generation: 300 output tokens per prompt, temperature 0. We report the median of the 12 runs.
  3. Prompt reading: about 1,600-token prompts that are unique from the first word, so no cached prefix can be reused. We report the median of 3 runs.
  4. Context window fixed at 4,096 tokens (from 2026-11-19). Ollama's default can be a model's full 262K, which overflows a 32 GB Mac.
  5. Model load time is never counted; only Ollama's own generation and prompt timings are used.

The benchmark script and raw JSON results are available on request.

Results

MLX was never slower than GGUF, and the gap widens with model size and chip generation.

MLX roughly doubles Qwen3.8 27B speed on M4 and M5; Gemma 4 12B gains littleGeneration speed in tokens/sec, median of 12 runsGGUF (llama.cpp)MLXMLX gainGemma 4 12BM2 MaxM2 Max, Gemma 4 12B, GGUF: 49.6 tok/sM2 Max, Gemma 4 12B, MLX: 50.0 tok/s49.650.0+1%M4 MaxM4 Max, Gemma 4 12B, GGUF: 69.2 tok/sM4 Max, Gemma 4 12B, MLX: 86.6 tok/s69.286.6+25%M5 MaxM5 Max, Gemma 4 12B, GGUF: 97.8 tok/sM5 Max, Gemma 4 12B, MLX: 101.6 tok/s97.8101.6+4%Qwen3.8 27BM2 MaxM2 Max, Qwen3.8 27B, GGUF: 18.1 tok/sM2 Max, Qwen3.8 27B, MLX: 26.3 tok/s18.126.3+45%M4 MaxM4 Max, Qwen3.8 27B, GGUF: 25.1 tok/sM4 Max, Qwen3.8 27B, MLX: 51.1 tok/s25.151.1+104%M5 MaxM5 Max, Qwen3.8 27B, GGUF: 30.3 tok/sM5 Max, Qwen3.8 27B, MLX: 62.5 tok/s30.362.5+106%
Datagram benchmark, Ollama 0.40.16. M2 Max and M5 Max 2026-11-19, M4 Max 2026-11-18.

On Qwen3.8 27B, the M5 Max with MLX (62.5 tok/s) is 3.5× faster than the M2 Max with GGUF (18.1 tok/s).

On the M5 Max, MLX reads prompts 45–62% faster; on M2 and M4, about 10%Prompt reading in tokens/sec, ~1,600-token prompts, median of 3 runsGGUF (llama.cpp)MLXMLX gainGemma 4 12BM2 MaxM2 Max, Gemma 4 12B, GGUF: 360 tok/sM2 Max, Gemma 4 12B, MLX: 394 tok/s360394+9%M4 MaxM4 Max, Gemma 4 12B, GGUF: 530 tok/sM4 Max, Gemma 4 12B, MLX: 588 tok/s530588+11%M5 MaxM5 Max, Gemma 4 12B, GGUF: 1,373 tok/sM5 Max, Gemma 4 12B, MLX: 2,222 tok/s1,3732,222+62%Qwen3.8 27BM2 MaxM2 Max, Qwen3.8 27B, GGUF: 171 tok/sM2 Max, Qwen3.8 27B, MLX: 188 tok/s171188+10%M4 MaxM4 Max, Qwen3.8 27B, GGUF: 242 tok/sM4 Max, Qwen3.8 27B, MLX: 274 tok/s242274+13%M5 MaxM5 Max, Qwen3.8 27B, GGUF: 705 tok/sM5 Max, Qwen3.8 27B, MLX: 1,023 tok/s7051,023+45%
Datagram benchmark, Ollama 0.40.16. M2 Max and M5 Max 2026-11-19, M4 Max 2026-11-18.

The M5 Max reads prompts 2.6–2.9× faster than the M4 Max with GGUF, and 3.7–3.8× faster with MLX.

M5 Ultra: results to be added.

Why MLX is faster

On Qwen3.8 27B, MLX beats the memory-bandwidth limit for one-token-at-a-time decoding, so its 2× gain must come partly from generating several tokens per weight read.

Qwen3.8 27B is a dense 27.8B-parameter model. Its 18.2 GB MLX file includes an image encoder that isn't used for text, so roughly 15.5 GB of weights are read per token.

Chip Bandwidth Ceiling at 15.5 GB/token GGUF measured MLX measured
M2 Max 400 GB/s ~26 tok/s 18.1 tok/s 26.3 tok/s
M4 Max 546 GB/s ~35 tok/s 25.1 tok/s 51.1 tok/s
M5 Max 614 GB/s ~40 tok/s 30.3 tok/s 62.5 tok/s

GGUF reaches about 70–75% of the ceiling, which is typical. MLX reaches about 100% on the M2 Max and 145–155% on the M4 Max and M5 Max.

The second clue is consistency. On the M5 Max, the twelve GGUF runs all fell between 30.2 and 30.3 tok/s. The MLX runs ranged from 57.8 to 69.4 tok/s, depending on the prompt. That pattern is the signature of speculative or multi-token decoding: the model drafts several tokens and checks them in one pass, so speed rises when the text is predictable. Qwen3.5-family models ship with multi-token prediction heads, and Ollama's MLX engine appears to use them. The library also lists explicit speculative variants such as qwen3.8:27b-dflash2-nvfp4.

Gemma 4 has no such feature, and its MLX gain is small: +1% (M2 Max), +25% (M4 Max), +4% (M5 Max).

Prompt reading tells a separate story. MLX's lead grew from +9–13% on the M2 Max and M4 Max to +45–62% on the M5 Max. The M5 generation adds neural accelerators to every GPU core, and MLX is built to use them; llama.cpp's Metal kernels gained much less. For long documents and long chat histories, that is time saved before the first word appears.

Very large models and many users

These tests run on the Mac Studio M5 Ultra 512GB and are not done yet. Planned:

  1. A 600B+ parameter model on one Mac, quantized, with generation and prompt-reading speed and a screen recording.
  2. 2, 4 and 8 users at once on the Ultra and the M5 Max: per-user speed and total throughput, to answer how many people can share one Mac.
  3. Models of 70B and up, and mixture-of-experts models (e.g. Qwen3.5 35B-A3B, Nemotron 3 Nano 30B-A3B), MLX against GGUF.

What to expect from clustering Macs over Thunderbolt 5: it adds memory, so larger models fit, but it doesn't make one user's tokens come faster.

Power and thermals

A Mac Studio M4 Max ran with its GPU at 98–100% for more than four hours under a sustained LLM workload. Its intake air was 23 °C and its exhaust 38 °C, measured with a thermal camera.

Still to measure on the M5 Ultra and M5 Max:

Practical guidance

Use an MLX build whenever one exists. It was never slower in our tests, and it was up to 2× faster.

Your situation What to do
Model of 20B parameters or more MLX: the biggest generation gains (+45% to +106%)
Small model (under ~12B) on an older Mac Either engine; the difference is small (+1% on the M2 Max)
Long prompts, documents, RAG on an M5 Mac MLX: +45–62% faster prompt reading
Model with no MLX build GGUF is fine, and is the only option

In Ollama: MLX builds are the tags ending in -nvfp4, -mxfp8 or -mlx, and some default tags (e.g. gemma4:12b). Check ollama show <model>: format safetensors means MLX, gguf means llama.cpp.

No MLX build in Ollama yet (November 2026): gpt-oss, DeepSeek R1, Ministral 3, Devstral, Qwen3-Coder. LM Studio and mlx-lm can run community MLX conversions of some of these.

Choosing a Mac by model size (4-bit, room for context):

Memory Largest comfortable model
32 GB ~27B dense (one model at a time)
64 GB ~32B dense, ~70B tight
128 GB ~70B dense, ~120B mixture-of-experts
256 GB ~235B mixture-of-experts
512 GB 600B+ mixture-of-experts

Leave memory for context, too (measured 2026-11-23). A model's window and the number of people using it at once take memory on top of the weights. Qwen3-Coder 30B, serving 4 people at once on our Mac Studio M5 Max, used 21.9 GB with an 8K-token window and 45.0 GB with a 64K window: about 98 KB per token of context per user for this model. Coding agents need 64K or more, so budget for it; see our paper on coding agents on private hardware.

Limitations

These results come from two models, one Ollama version and one Mac per chip. Treat them as a well-controlled snapshot, not a universal law.

To reproduce: run the same Ollama tags on any Mac with the method above. Our script and raw results are available on request.

Run these models on your own Mac

Dedicated Apple Silicon Macs in our datacenters, with MLX, Ollama and LM Studio preinstalled.