Code Llama on Apple M2 · 16GB

🐢 CPU-only (slow) — Code Llama 13B @ Q4_K_M
Code Llama 13B at Q4_K_M needs ~14.1 GB (weights 7.3 GB + KV 6.3 GB + overhead 512 MB @ 8K ctx) of your 8.2 GB usable (of 16.0 GB unified memory) — runs on CPU only. Expect ~0.5–0.9 tok/s (slow).
context @ Q4_K_M: runs to 8K · won't fit past that on this rig
quantneedsspeed
Q8_019.8 GB
Q5_K_M15.4 GB
~ Q4_K_M14.1 GB~0.5–0.9 tok/s (slow)
$runlocal install codellama:13b
runlocal verdict card
download card share on x share on reddit drop it in your model-drop post
Code Llama: CPU-only (slow)
for your own README — links back here

Same model, other machines: Apple M1 · Apple M1 Pro · Apple M3 Pro · Apple M2 Pro · Apple M4 Pro · Apple M3 Max

Also runs on a Apple M2: DeepSeek-R1 (distill) · Qwen3 · Llama 3.1 · Qwen2.5 · Gemma 3

Best models for a Apple M2 · 16GB →

Architecturally similar

These share Code Llama's KV-cache geometry — they size memory the same way, so here's how they fit on a Apple M2 · 16GB too:

modelsharesverdict here
Qwen2.5-Coder 8kv/128hd ✅ Runs (tight)
Llama 3.2 8kv/128hd ✅ Runs comfortably
Llama 3.3 8kv/128hd ❌ Won't fit
Mistral 7B 8kv/128hd ✅ Runs (tight)
Mistral Small 3 8kv/128hd 🐢 CPU-only (slow)
Mistral Nemo 8kv/128hd 🐢 CPU-only (slow)
Codestral 8kv/128hd 🐢 CPU-only (slow)
Llama 3.2 Vision 8kv/128hd ✅ Runs (tight)

…and 9 more — see the Code Llama page.

Check any combo yourself: open the checker →