Advisor / Models / Gemma 4 31B

Gemma 4 31B: VRAM requirements & speed

Gemma 4 31B (31.27B dense, apache-2.0). Native context 256k. Smallest GGUF: 18.32 GB.

18.32 GBsmallest quant file
18hardware pages that fit it fully
7run with offload
6measured data points

Memory needed by quantization and context

GGUF file size plus f16 KV cache (and fixed overhead of ~1 GB per GPU not shown). Source: unsloth/gemma-4-31B-it-GGUF.

QuantFile+8k ctx+32k ctx+128k ctx+256k ctx
Q4_K_M18.32 GB19.8 GB21.8 GB29.9 GB40.6 GB
Q5_K_M21.66 GB23.2 GB25.2 GB33.2 GB44.0 GB
Q6_K25.2 GB26.7 GB28.7 GB36.8 GB47.5 GB
Q8_033.15 GB34.7 GB36.7 GB44.7 GB55.5 GB

KV cache size by context length

Computed from the model's attention layout (sliding-window layers capped at their window).

Contextf16q8_0q4_0
8k1.51 GB0.80 GB0.42 GB
32k3.52 GB1.87 GB0.99 GB
128k11.58 GB6.15 GB3.26 GB
256k22.31 GB11.85 GB6.28 GB

Which hardware runs Gemma 4 31B? · 16k context

HardwareQuantFitMemoryTok/sSpeed source
RTX 5090 32GBQ6_Kfits fully27.4 GB55measured
RTX 4090 24GBQ4_K_Mfits fully20.5 GB44measured
AMD RX 7900 XTX 24GBQ4_K_Mfits fully20.5 GB40scaled from measured
RTX 3090 24GBQ4_K_Mfits fully20.5 GB39measured
RTX PRO 6000 96GB (bonus page)Q8_0fits fully35.3 GB33estimated
Mac Studio M5 Ultra 256GBQ8_0fits fully35.3 GB23estimated
Mac Studio M5 Ultra 512GB (ships late Oct 2026)Q8_0fits fully35.3 GB23estimated
Mac Studio M5 Max 128GBQ6_Kfits fully27.4 GB20scaled from measured
MacBook Pro 14/16 M5 Max 128GBQ6_Kfits fully27.4 GB20scaled from measured
2x RTX 3090 (48GB total)Q8_0fits fully35.3 GB19estimated
Mac Studio (2025) M3 Ultra 96GBQ4_K_Mfits fully20.5 GB18estimated
MacBook Pro 14/16 (2024) M4 Max 128GBQ4_K_Mfits fully20.5 GB14estimated
NVIDIA DGX Spark 128GBQ4_K_Mfits fully20.5 GB12estimated
MacBook Pro 14/16 M5 Pro 48GBQ4_K_Mfits fully20.5 GB12estimated
AMD Ryzen AI Max+ 395 (Strix Halo) 128GBQ4_K_Mfits fully20.5 GB10measured
RTX 5080 16GBQ4_K_Mpartial offload (slow)20.5 GB9estimated
Mac mini (2024) M4 Pro 64GBQ4_K_Mfits fully20.5 GB9estimated
RTX 5070 Ti 16GBQ4_K_Mpartial offload (slow)20.5 GB9estimated
16GB VRAM class (RTX 4060 Ti 16GB, 32GB RAM)Q4_K_Mpartial offload (slow)20.5 GB7estimated
Mac mini M6 32GBQ4_K_Mfits fully20.5 GB6estimated
RTX 5070 12GBQ4_K_Mpartial offload (slow)20.5 GB6estimated
RTX 4070 12GBQ4_K_Mpartial offload (slow)20.5 GB6estimated
MacBook Air M5 32GBQ4_K_Mfits fully20.5 GB5estimated
8GB VRAM class (RTX 4060 8GB, 32GB RAM)Q4_K_Mpartial offload (slow)20.5 GB4estimated
RTX 3060 12GB (32GB RAM)Q4_K_Mpartial offload (slow)20.5 GB3estimated
Mac mini / iMac M4 16GB-does not fit--

Discrete GPUs are modelled with 32 GB of system RAM available for offload. Does not fit even with offload: Mac mini / iMac M4 16GB.

Links

Model card · GGUF files · Open in the advisor · last verified 2026-10-14

FAQ

How much VRAM does Gemma 4 31B need?

The smallest quant (Q4_K_M) is 18.32 GB, so you need roughly 21 GB for an 8k context including KV cache and overhead. At 256k context the f16 KV cache alone is 22.3 GB.

Can I run Gemma 4 31B on a RTX 5090 32GB?

Yes: on RTX 5090 32GB it fits fully as Q6_K at about 55 tok/s (measured). 18 of 26 hardware configurations fit it fully at 16k context.

What is the maximum context for Gemma 4 31B?

256k tokens natively. Memory, not the model, is usually the limit: see the KV cache table above.

All models: model index · by memory: 8 GB · 12 GB · 16 GB · 24 GB · 32 GB · 48 GB · 64 GB · 96 GB · 128 GB · 192 GB · 256 GB · 512 GB. Numbers use the same fit math as the advisor; sources and methods.