Models / Gemma 4 31B
Best home rig for Gemma 4 31B
Quick answer
How much VRAM does Gemma 4 31B need?
The weights are about 18.8 GB at Q4_K_M (30.7B params × 4.89 bits ÷ 8, before context/KV cache). Add memory for context (KV cache) and the runtime. The smallest-memory setup with a measured result here, fully in memory, is RTX 4090 (24 GB) at 43.8 tok/s.
What is the fastest measured hardware for Gemma 4 31B?
RTX 5090: 71.3 tok/s generation (llama.cpp b11658 (llama-bench), Q4_K_M), from https://localllmadvisor.com/can-run/gemma-4-31b-on-rtx-5090-32gb.html.
Last updated:
Current model30.7B dense12 measured resultsfastest plain decode: 71.3 tok/s model info ↗
Will it fit my GPU? Best value GPU per euro →
Real, measured generation speeds for Gemma 4 31B on home hardware, fastest first. Different quants/engines aren't directly comparable.
Prompt processing = prefill speed reported by the source, @ prompt length. * est. TTFT @8k is calculated from measured prefill, not measured. Why it matters.
Quality cost of each quant for Gemma 4 31B
How far each quantization drifts from the full-precision (BF16) model, as published by the quant maker. Lower KL divergence (KLD) is closer to the original; same-top-token % is how often the quant picks the same next token as BF16. Q4_K_M is usually the sweet spot; below Q4 the drift grows fast, which is why RigBase only lists Q4-or-higher speed results.
| Quant | File size | Mean KLD vs BF16 | Same top token |
|---|---|---|---|
| QAT UD-Q4_K_XL (Unsloth) | 17.29 GB | 0.01403 | 96.67% |
| QAT Q4_0 (plain llama.cpp conversion) | 17.65 GB | 0.09349 | 87.91% |
Source: unsloth.ai ↗. Unsloth (quant publisher) Gemma 4 QAT docs: KLD on wikitext. Both rows are 4-bit files made from Google's QAT checkpoint: Unsloth's UD-Q4_K_XL versus a plain llama.cpp Q4_0 conversion. Unsloth publishes no higher-precision QAT file, saying higher precisions did not improve accuracy. KLD from different publishers, datasets or llama.cpp builds isn't directly comparable.
Memory math: how much VRAM / RAM does Gemma 4 31B need?
Gemma 4 31B has 30.7B parameters (source: GGUF param count via llamabench.ai). Weight size = parameters × bits-per-weight ÷ 8, before context (KV cache) and runtime overhead.
| Format | Bits/weight | Weights | Smallest common memory size that holds the weights alone |
|---|---|---|---|
| Q8_0 | 8.50 | 32.6 GB | 48 GB |
| Q6_K | 6.56 | 25.2 GB | 32 GB |
| Q5_K_M | 5.70 | 21.9 GB | 24 GB |
| Q4_K_M | 4.89 | 18.8 GB | 24 GB |
| Q3_K_M | 4.00 | 15.3 GB | 16 GB |
| Q2_K | 3.16 | 12.1 GB | 16 GB |
Bits-per-weight for GGUF quants are llama.cpp's own figures (llama.cpp quantize README). "As measured" rows apply the source's stated bits-per-weight to the parameter count; real files differ slightly because some layers stay at higher precision. Try other combinations in the VRAM calculator.
FAQ
How much VRAM does Gemma 4 31B need?
The weights are about 18.8 GB at Q4_K_M (30.7B params × 4.89 bits ÷ 8, before context/KV cache). Add memory for context (KV cache) and the runtime. The smallest-memory setup with a measured result here, fully in memory, is RTX 4090 (24 GB) at 43.8 tok/s.
What is the fastest measured hardware for Gemma 4 31B?
RTX 5090: 71.3 tok/s generation (llama.cpp b11658 (llama-bench), Q4_K_M), from https://localllmadvisor.com/can-run/gemma-4-31b-on-rtx-5090-32gb.html.
Which GPUs have measured results for Gemma 4 31B?
RTX 3090, RTX 4090, RTX 5090, Strix Halo (Radeon 8060S).
Can it run on… RTX 3090 · RTX 4090 · RTX 5090 · Strix Halo (Radeon 8060S)
Related: what GPU do you need for 2026 models · all builds
Speed with and without MTP / DFlash on the same machines: measured speed-ups.