Skip to content

text model · Gemma · macOS

Can I run Gemma 4 31B on Apple M5 (32GB)?

Compatibility verdict VRAM threshold engine
Yes, but tight usable speed ~7 tok/s est.

Yes. Gemma 4 31B runs on Apple M5 (32GB) at Q4_K_M (~20.5 GB of ~21 GB usable).

Needs ~20.5 GB Device usable ~21 GB

Fits at Q4_K_M (~20.5 GB of ~21 GB usable) but with little headroom. Close other apps, or drop to a 2k context to free about a gigabyte.

That figure is at a 4k context and moves about ±15% as context length changes. Apple M5 (32GB) leaves ~0.5 GB of headroom.

Q4_K_M needed
~20.5 GB
Usable on device
~21 GB
Device memory
32 GB
Best quant
Q4_K_M
Share on X Share on Reddit

Which quant fits

Quant ladder vs ~21 GB usable
Q2_K
~15.9 GB
Q3_K_M
~18.2 GB
Q4_K_M
~20.5 GB
Q5_K_M
~25.5 GB
Q6_K
~29 GB
Q8_0
~34.8 GB
FP16
~63.6 GB
The line marks Apple M5 (32GB)'s ~21 GB budget; rungs past it are too large.

Run it

Install commands macOS

Pick your tool. All 3 load the same Q4_K_M weights.

Ollama
$ ollama run gemma4:31b
llama.cpp
$ llama-cli -hf unsloth/gemma-4-31B-it-GGUF:Q4_K_M
LM Studio
$ lms get unsloth/gemma-4-31B-it-GGUF
Model Gemma
Parameters
32.7B
Q4_K_M size
18.32 GB
Q8_0 size
32.64 GB
Context
256k
Ollama tag
gemma4:31b
Full Gemma 4 31B requirements →
Device macOS
Memory
32 GB unified
Usable for weights
~21 GB
Best runtime
MLX direct / Ollama (MLX backend)
Best models for Apple M5 (32GB) →

You could also run

Run Gemma 4 31B on other hardware

FAQ

Can Apple M5 (32GB) run Gemma 4 31B?

Yes. Gemma 4 31B runs on Apple M5 (32GB) at Q4_K_M (~20.5 GB of ~21 GB usable).

How much memory does Gemma 4 31B need?

It is a tight fit on Apple M5 (32GB). At Q4_K_M the weights are ~18.32 GB; with KV cache and runtime overhead, budget ~20.5 GB at a 4k context.

What is the best tool to run Gemma 4 31B on macOS?

LM Studio for a simple setup; mlx-lm for the most speed. vLLM is NOT a Mac tool, it is a CUDA/Linux serving engine. Unified memory is not a fixed VRAM slice; ~70% is usable for weights.

Embed this

Gemma 4 31B on Apple M5 (32GB) compatibility badge A live badge for your model card or README, updated as the data is.
Markdown
$ [![Gemma 4 31B on Apple M5 (32GB)](https://localmodel.run/badge/gemma-4-31b/apple-m5-32gb.svg)](https://localmodel.run/can-i-run/gemma-4-31b/apple-m5-32gb)

Sources

Weights are measured from GGUF files; KV cache and overhead are computed, so totals can vary ~15% with context and runtime. Any tok/s is a bandwidth estimate. See methodology.