Can I run it?

Can I run gemma 4 31B it on Apple M5 Max (40-core GPU)?

Tight fit

Tight fit fully in unified memory on your Apple M5 Max (40-core GPU) at UD-Q8_K_XL, 8K context, about 7.8–11 tok/s. Weights 32.6 GB plus 2.03 GB of KV cache — 35.3 GB of 36.0 GB usable.

Best quantUD-Q8_K_XL
Working context8K
Max that fits8K
Speed7.8–11 tok/s
Weights32.6 GB
KV cache2.03 GB
Total35.3 GB
Usable36.0 GB

gemma 4 31B it details · Apple M5 Max (40-core GPU) page · How this estimate is made

Run commands

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

Assumptions

Larger models that also fit

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