Can an Apple M1 Max 32GB run Gemma 4 31B Instruct?

Yes

Yes. At Q5_K_M it needs 22.28 GB of the 22.4 GB available and generates around 14.4 tokens per second at an 8k context window.

The numbers

Gemma 4 31B Instruct has 31.27 billion parameters across 60 layers. The Apple M1 Max 32GB has 32 GB of unified memory at 400 GB/s, of which about 22.4 GB is left for a model once the operating system has taken its share.

QuantisationTotal neededFitsSpeed
Q8_0 32.51 GB no
Q6_K 25.45 GB no
Q5_K_M 22.28 GB yes 14.4 t/s
Q4_K_M 19.15 GB yes 16.8 t/s
IQ4_XS 17.04 GB yes 19 t/s
Q3_K_M 15.8 GB yes 20.6 t/s
IQ3_XXS degraded 12.71 GB yes 25.8 t/s
Q2_K degraded 13.76 GB yes 23.8 t/s
IQ2_XXS degraded 9.07 GB yes 37 t/s

7 of the 9 levels fit. Levels marked degraded are listed for completeness, not as advice.

How long a conversation it holds

At Q5_K_M, memory rises with the length of the conversation because the attention cache keeps a key and value for every token. The longest window that still fits on this device is 8k tokens.

ContextCacheTotalFits
4k 0.94 GB 22.12 GB yes
8k 0.94 GB 22.28 GB yes
16k 0.94 GB 22.61 GB no
32k 0.94 GB 23.27 GB no
64k 0.94 GB 24.58 GB no
128k 0.94 GB 27.2 GB no

See how fast it feels

Apple M1 Max 32GB running Gemma 4 31B Instruct at Q5_K_M

Wait for the first word10 s
Then writes at14.4 tok/s
Whole answer22 s

YouWhy does my model use more memory when the conversation gets longer?

Model

Because of the KV cache. Every token you send leaves behind a key and a value vector in each layer of the model, and those stay in memory for as long as the conversation lasts.

The weights are a fixed cost: load a 4-bit 8B model and that is about 4.8 GB, whether you write one word or ten thousand. The cache is the part that grows, and it grows in a straight line with the number of tokens in the window.

How steeply depends on the model's attention design. With grouped-query attention, several query heads share one key-value pair, which cuts the cache by that ratio. Without it, every head keeps its own, and a long context can cost more memory than the weights themselves.

If you are short on memory, the first thing to try is lowering the context window in your runtime, not the quantisation.

Simulated from our estimate at a 512-token question, not a recording. Assumes nothing else is competing for the GPU. The same answer on RTX 4090 at Q5_K_M would take about 4.8 s.

Keep going

Everything the Apple M1 Max 32GB runs, the full breakdown for Gemma 4 31B Instruct, or check a different pairing in the calculator.