Gemma 4 31B VRAM Requirements

Gemma 4 31B needs about 19.8 GB of VRAM at Q4_K_M with an 8K context: 17.3 GB for weights, 1.4 GB for the KV cache and 1.1 GB of runtime overhead. At Q8_0 it needs 32.9 GB and at full FP16 precision 59.7 GB. The smallest GPU that runs it fully is the Radeon RX 7900 XT 20GB.

By Google · Updated October 14, 2026 · Values from config.json on Hugging Face

19.8 GB VRAM

Gemma 4 31B at Q4_K_M with 8K context and the KV cache in FP16.

  • Weights 17.3 GB
  • KV cache 1.4 GB
  • Runtime overhead 1.1 GB

Which GPUs can run it

Gemma 4 31B VRAM by quantization

Total memory with an FP16 KV cache. "Smallest tier" is the smallest standard VRAM size with a 6% safety margin at 8K.

QuantizationBits/weightWeightsTotal at 8KTotal at 32KSmallest tier
Q4_K_M4.8517.3 GB19.8 GB21.7 GB24 GB
Q5_K_M5.6920.3 GB22.8 GB24.7 GB32 GB
Q6_K6.5923.6 GB26.0 GB27.9 GB32 GB
Q8_08.5030.4 GB32.9 GB34.7 GB48 GB
FP16 / BF1616.0057.2 GB59.7 GB61.5 GB64 GB
Q3_K_M3.9114.0 GB16.5 GB18.3 GB20 GB
Q2_K3.0010.7 GB13.2 GB15.1 GB16 GB

VRAM by context length

At Q4_K_M. 50 of 60 layers use a 1,024-token sliding window. The 10 global layers keep the full context with 4 KV heads of 512 dimensions. Figures assume separate keys and values; runtimes that store Gemma 4's unified key-value once need about half as much on the global layers.

ContextKV cache (FP16)KV cache (Q8_0)Total, FP16 cacheTotal, Q8_0 cache
4K tokens1.1 GB0.6 GB19.5 GB19.0 GB
8K tokens1.4 GB0.7 GB19.8 GB19.2 GB
32K tokens3.3 GB1.7 GB21.7 GB20.2 GB
128K tokens10.8 GB5.7 GB29.2 GB24.1 GB
256K tokens20.8 GB11.0 GB39.2 GB29.5 GB

GPUs that can run Gemma 4 31B

At Q4_K_M with 8K context. "Best quant" is the highest-quality format that fits fully; "max context" is at Q4_K_M.

GPUUsable memoryStatusBest quantMax contextSpeed
Radeon RX 7900 XT 20GB20.0 GBTight fitIQ4_XS–~22 tok/s
Apple M5 32GB21.3 GBFitsQ4_K_M10K~5.0 tok/s
NVIDIA L4 24GB24.0 GBFitsQ4_K_M43K~9.8 tok/s
Tesla P40 24GB24.0 GBFitsQ4_K_M43K~9.6 tok/s
Apple M4 Max 36GB24.0 GBFitsQ4_K_M43K~13 tok/s
Intel Arc Pro B60 24GB24.0 GBFitsQ4_K_M43K~11 tok/s
RTX 3090 24GB24.0 GBFitsQ4_K_M43K~30 tok/s
Radeon RX 7900 XTX 24GB24.0 GBFitsQ4_K_M43K~26 tok/s
RTX 3090 Ti 24GB24.0 GBFitsQ4_K_M43K~32 tok/s
RTX 4090 24GB24.0 GBFitsQ4_K_M43K~32 tok/s
Radeon AI PRO R9700 32GB32.0 GBFitsQ6_K139K~18 tok/s
RTX 5090 32GB32.0 GBFitsQ6_K139K~57 tok/s
Apple M4 Pro 48GB36.0 GBFitsQ8_0187K~8.9 tok/s
A100 40GB40.0 GBFitsQ8_0235K~50 tok/s
RTX 4060 Ti 16GB16.0 GB76% on GPUQ2_K–~5.1 tok/s
RTX 4070 Ti Super 16GB16.0 GB76% on GPUQ2_K–~6.7 tok/s
RTX 4080 16GB16.0 GB76% on GPUQ2_K–~6.8 tok/s
RTX 4080 Super 16GB16.0 GB76% on GPUQ2_K–~6.9 tok/s
RTX 5060 Ti 16GB16.0 GB76% on GPUQ2_K–~6.0 tok/s
RTX 5070 Ti 16GB16.0 GB76% on GPUQ2_K–~7.1 tok/s

About Gemma 4 31B

The largest dense Gemma 4. Its 256K context is affordable because five of every six layers only look at the last 1,024 tokens. At Q4_K_M it is a natural fit for 24 GB cards, and its vision encoder adds about 0.5 GB when loaded.

SpecValue
Parameters30.7B
Layers60
Hidden size5376
Attention heads / KV heads32 / 16 (varies by layer)
Head dimension256
Vocabulary262,144
Max context (used here)256K tokens
Layers with a growing cache10 of 60
KV cache per token (FP16)80 KB
Released2026-04
LicenseApache 2.0

Gemma 4 31B VRAM: common questions

Does Gemma 4 31B fit on an RTX 3090 or 4090?

Yes at Q4_K_M with up to about 44K of context (about 90K with a Q8_0 cache). The weights are about 17 GB, and the cache grows slowly because only 10 of 60 layers keep the full context.

How much VRAM does Gemma 4 31B need?

About 19.8 GB at Q4_K_M with an 8K context, 32.9 GB at Q8_0 and 59.7 GB at FP16. Longer contexts add 0.08 GB per 1,000 tokens with an FP16 cache.

What is the cheapest GPU that can run Gemma 4 31B?

The smallest listed device that fits it fully at Q4_K_M with 8K context is the Radeon RX 7900 XT 20GB (20.0 GB usable).

Related