Can I run it?

Can I run gemma 4 31B it on Apple M5?

Tight fit

Tight fit fully in unified memory on your Apple M5 at UD-IQ2_XXS, 8K context, about 5.1–6.9 tok/s. Weights 7.95 GB plus 2.03 GB of KV cache — 10.4 GB of 11.0 GB usable.

Best quantUD-IQ2_XXS
Working context8K
Max that fits8K
Speed5.1–6.9 tok/s
Weights7.95 GB
KV cache2.03 GB
Total10.4 GB
Usable11.0 GB

gemma 4 31B it details · Apple M5 page · How this estimate is made

Run commands

llama.cpp
llama-server -hf unsloth/gemma-4-31B-it-GGUF:UD-IQ2_XXS -c 8192 -ngl 60
Ollama
ollama run gemma
LM Studio
lms get unsloth/gemma-4-31B-it-GGUF
# Then load quant UD-IQ2_XXS

Assumptions

Larger models that also fit

Updated 2026-10-24. Profile on this page is the device default.