Advisor / Hardware / MacBook Air M5 32GB

Best local LLMs for MacBook Air M5 32GB

MacBook Air 13 — M5 32GB. Memory-fit math with KV cache, speeds labelled by how they were obtained, and commands you can paste.

21.9 GBusable for model + KV cache
153 GB/smemory bandwidth
3measured data points on file

Best for Coding · 16k context

ModelQuantFitMemorySpeed (generation)
Qwen3-Coder 30B-A3BQ4_K_Mfits fully20.2 GB~38 tok/s estimated
Laguna XS 2.1Q4_K_Mfits fully21.3 GB~41 tok/s estimated
Inkling 2 MiniQ4_K_Mfits fully19.4 GB~20 tok/s estimated
Mellum2.1 12B-A2.5B InstructQ8_0fits fully13.2 GB~29 tok/s estimated
Gemma 4 26B-A4BUD-Q5_K_Mfits fully21.7 GB~24 tok/s estimated
llama.cpp · top pick
llama-server -hf unsloth/Qwen3-Coder-30B-A3B-Instruct-GGUF:Q4_K_M -c 16384 -fa on --jinja -ngl 99
ollama · top pick
OLLAMA_CONTEXT_LENGTH=16384 ollama serve
ollama run hf.co/unsloth/Qwen3-Coder-30B-A3B-Instruct-GGUF:Q4_K_M

Context length is an Ollama server setting: quit the Ollama app or stop the service first, or set it in its environment (launchctl on Mac, systemctl on Linux).

MLX · mlx-lm · 4bit, 17.2 GB
pip install -U mlx-lm
mlx_lm.generate --model mlx-community/Qwen3-Coder-30B-A3B-Instruct-4bit --prompt "Hello" --max-tokens 256
mlx_lm.server --model mlx-community/Qwen3-Coder-30B-A3B-Instruct-4bit --port 8080

MLX runs on Apple Silicon only. Repo: mlx-community/Qwen3-Coder-30B-A3B-Instruct-4bit (converted with mlx-lm, per its model card). These commands use MLX's default context handling; there is no MLX speed on this site yet.

Best for Chat / general · 16k context

ModelQuantFitMemorySpeed (generation)
Inkling 2 MiniQ4_K_Mfits fully19.4 GB~20 tok/s estimated
Qwen3-Coder 30B-A3BQ4_K_Mfits fully20.2 GB~38 tok/s estimated
Laguna XS 2.1Q4_K_Mfits fully21.3 GB~41 tok/s estimated
Gemma 4 26B-A4BUD-Q5_K_Mfits fully21.7 GB~24 tok/s estimated
GLM-4.7-FlashQ4_K_Mfits fully19.2 GB~43 tok/s estimated
llama.cpp · top pick
llama-server -hf bartowski/thinkingmachines_Inkling-2-Mini-GGUF:Q4_K_M -c 16384 -fa on --jinja -ngl 99
ollama · top pick
OLLAMA_CONTEXT_LENGTH=16384 ollama serve
ollama run hf.co/bartowski/thinkingmachines_Inkling-2-Mini-GGUF:Q4_K_M

Context length is an Ollama server setting: quit the Ollama app or stop the service first, or set it in its environment (launchctl on Mac, systemctl on Linux).

MLX · mlx-lm · 4bit, 17.3 GB
pip install -U mlx-lm
mlx_lm.generate --model mlx-community/Inkling-2-Mini-4bit --prompt "Hello" --max-tokens 256
mlx_lm.server --model mlx-community/Inkling-2-Mini-4bit --port 8080

MLX runs on Apple Silicon only. Repo: mlx-community/Inkling-2-Mini-4bit (converted with mlx-lm, per its model card). These commands use MLX's default context handling; there is no MLX speed on this site yet.

Best for Vision · 16k context

ModelQuantFitMemorySpeed (generation)
Inkling 2 MiniQ4_K_Mfits fully19.4 GB~20 tok/s estimated
Gemma 4 26B-A4BUD-Q5_K_Mfits fully21.7 GB~24 tok/s estimated
Qwen3.5 4BQ8_0fits fully5.1 GB~23 tok/s scaled from measured src
Gemma 4 31BQ4_K_Mfits fully20.5 GB~6 tok/s estimated
Qwen3.6 27BQ4_K_Mfits fully18.1 GB~6 tok/s estimated
llama.cpp · top pick
llama-server -hf bartowski/thinkingmachines_Inkling-2-Mini-GGUF:Q4_K_M -c 16384 -fa on --jinja -ngl 99
ollama · top pick
OLLAMA_CONTEXT_LENGTH=16384 ollama serve
ollama run hf.co/bartowski/thinkingmachines_Inkling-2-Mini-GGUF:Q4_K_M

Context length is an Ollama server setting: quit the Ollama app or stop the service first, or set it in its environment (launchctl on Mac, systemctl on Linux).

MLX · mlx-lm · 4bit, 17.3 GB
pip install -U mlx-lm
mlx_lm.generate --model mlx-community/Inkling-2-Mini-4bit --prompt "Hello" --max-tokens 256
mlx_lm.server --model mlx-community/Inkling-2-Mini-4bit --port 8080

MLX runs on Apple Silicon only. Repo: mlx-community/Inkling-2-Mini-4bit (converted with mlx-lm, per its model card). These commands use MLX's default context handling; there is no MLX speed on this site yet.

All 21 models that fit, fastest first · 16k context

Click a column header to sort. 9 of 21 speeds here are measured or scaled from measured; the rest are bandwidth estimates. Filter by use case, speed source, fit, license and more in the interactive advisor →

ModelParamsQuantFitMemoryTok/sSource
LFM3 1.7B1.73BQ8_0fits fully2.1 GB~55estimated
GLM-4.7-Flash31.22B MoEQ4_K_Mfits fully19.2 GB~43estimated
Laguna XS 2.133.44B MoEQ4_K_Mfits fully21.3 GB~41estimated
Qwen3-Coder 30B-A3B30.53B MoEQ4_K_Mfits fully20.2 GB~38estimated
LFM2.5 24B-A2B23.97B MoEQ6_Kfits fully20.0 GB~38estimated
gpt-oss 20B20.91B MoEQ8_0fits fully12.5 GB~36estimated
Mellum2.1 12B-A2.5B Instruct12.15B MoEQ8_0fits fully13.2 GB~29estimated
Gemma 4 26B-A4B25.81B MoEUD-Q5_K_Mfits fully21.7 GB~24estimated
Nemotron 3 Nano 4B3.97BQ8_0fits fully4.6 GB~24scaled from measured
Qwen3.5 4B4.66BQ8_0fits fully5.1 GB~23scaled from measured
Inkling 2 Mini26.39B MoEQ4_K_Mfits fully19.4 GB~20estimated
Gemma 4 E4B8BQ5_K_Mfits fully5.8 GB~19scaled from measured
Qwen3-VL 8B8.77BQ5_K_Mfits fully8.3 GB~17scaled from measured
Ornith 1.5 9B9.65BQ4_K_Mfits fully6.5 GB~17scaled from measured
DeepSeek R1 Distill Qwen 7B7.62BQ6_Kfits fully7.2 GB~16scaled from measured
Qwen3.5 9B9.65BQ5_K_Mfits fully7.2 GB~15scaled from measured
Gemma 4 12B11.96BQ4_K_Mfits fully7.7 GB~13scaled from measured
Mistral Small 3.2 24B24.01BQ4_K_Mfits fully17.0 GB~6scaled from measured
Qwen3.8 27B27.78BUD-Q4_K_Mfits fully17.8 GB~6estimated
Qwen3.6 27B27.78BQ4_K_Mfits fully18.1 GB~6estimated
Gemma 4 31B31.27BQ4_K_Mfits fully20.5 GB~6estimated

Long context on this hardware · up to 1M tokens

Largest context whose KV cache still fits next to the weights (same placement as the 16k result, KV types f16 / q8_0 / q4_0). Models are capped at their verified maximum; extended means beyond the native maximum using YaRN, only listed where the model card documents it. Long context needs flash attention (-fa on, already in the commands) and a lot of memory; a quantized KV cache saves memory but can cost accuracy. Speed at depth is an estimate (penalty fitted to measured depth runs up to 128k).

Try it in the advisor: 128k · 256k · 512k · 1M

ModelNative maxMax ctx f16Max ctx q8_0Max ctx q4_0Est. tok/s at max f16 ctx
Qwen3.5 4B Q8_0256k512k extended512k extended1M extended~6 estimated
LFM3 1.7B Q8_0256k256k256k256k~24 estimated
Nemotron 3 Nano 4B Q8_0256k256k256k256k~14 estimated
Ornith 1.5 9B Q4_K_M256k256k256k256k~8 estimated
Qwen3.5 9B Q5_K_M256k256k512k extended1M extended~8 estimated
Gemma 4 12B Q4_K_M256k256k256k256k~9 estimated
gpt-oss 20B Q8_0128k128k128k128k~17 estimated
Mellum2.1 12B-A2.5B Instruct Q8_0128k128k128k128k~19 estimated
Gemma 4 E4B Q5_K_M128k128k128k128k~14 estimated
DeepSeek R1 Distill Qwen 7B Q6_K128k128k128k128k~9 estimated
GLM-4.7-Flash Q4_K_M198k64k64k128k~17 estimated
LFM2.5 24B-A2B Q6_K128k64k128k128k~25 estimated
Inkling 2 Mini Q4_K_M1M64k128k256k~14 estimated
Qwen3-VL 8B Q5_K_M256k64k128k256k~8 estimated
Qwen3.8 27B UD-Q4_K_M256k64k128k256k~5 estimated
Qwen3.6 27B Q4_K_M256k64k128k256k~5 estimated
Qwen3-Coder 30B-A3B Q4_K_M256k32k32k64k~17 estimated
Mistral Small 3.2 24B Q4_K_M128k32k64k128k~5 estimated
Gemma 4 31B Q4_K_M256k32k64k128k~5 estimated
Laguna XS 2.1 Q4_K_M256k16k32k64k~32 estimated
Gemma 4 26B-A4B UD-Q5_K_M256k16k32k64k~22 estimated

MLX on this Mac

MLX is Apple's machine-learning framework for Apple Silicon. Where a verified MLX conversion exists (mlx-community or the model's own publisher), the commands above include an MLX block next to llama.cpp and ollama.

Repos are checked against the Hugging Face API (how).

FAQ

What is the best local LLM for MacBook Air M5 32GB?

Of the 21 models that fit fully at 16k context, LFM3 1.7B Q8_0 is the fastest at ~55 tok/s (estimated); the largest is Laguna XS 2.1 Q4_K_M.

How much memory can MacBook Air M5 32GB use for a model?

About 21.9 GB usable for the model and KV cache, with 153 GB/s memory bandwidth.

Can MacBook Air M5 32GB run long contexts?

See the long-context table above: it lists the largest context whose KV cache fits next to the weights for every model, up to 1M tokens where the model supports it.

Open the interactive advisor with this hardware →

Speeds marked measured are medians of real runs (short-context generation) from these sources; scaled from measured means a measurement of a same-size or same-model-different-quant run, scaled by bytes read; estimated comes from memory bandwidth (spec source: https://support.apple.com/en-us/126320) × an efficiency factor of 0.66 calibrated to measured runs on this hardware. 3 measured data points on file for this hardware · submit your benchmark. Memory size on this page is an example configuration; check what your machine has. Model data last verified 2026-11-30. Ranking = fits and fast enough first, then larger; not a quality benchmark.

Page generated 2026-11-30 by tools/generate_pages.js