About Gemma 4 31B
Gemma 4 31B is the dense flagship of Google DeepMind's open Gemma 4 family, positioned by Google for high-end servers and workstations rather than the consumer devices its smaller siblings target. It keeps everything that defines the family — Apache 2.0 licence, interleaved local-and-global attention, multimodal input, extended context — and applies it at the largest dense scale in the lineup.
As the family's quality ceiling it is the natural choice when output fidelity matters more than deployment convenience: the model you run on shared infrastructure and expose to the tools built on its smaller relatives.
Gemma 4 31B is Google's 31B-parameter model released in April 2026, with a 256K-token context window. It uses a hybrid-attention design — only a fraction of its layers cache the full context, so long conversations cost far less VRAM than a classic dense model: its KV cache is about 2.2 GB at an 8K context, 22.3 GB at 128K, and 43.8 GB at the full 256K window (FP16 cache).
Dense means honest: unlike its MoE sibling there is no active-parameter discount on speed, but also no oversized expert pool — the quantised totals above are close to the family's capability-per-gigabyte optimum. They sit at the top of what single high-VRAM consumer cards handle at aggressive quantisation, with workstation cards and large unified-memory machines running it comfortably at higher quality levels. The hybrid attention design matters most here of all the tiers: at workstation-scale context lengths a classic dense-attention model this size would add many gigabytes of cache that this design avoids.
For most people Q4_K_M is the sweet spot — the most popular quality/size trade-off — while Q8 is near-lossless if you have the memory. Totals above include the KV cache and a realistic framework overhead, so they are what you should expect to see in practice rather than just the download size. Weight sizes are calibrated against real GGUF files — see the methodology.
Frequently asked questions
How much VRAM does Gemma 4 31B need?
At Q4_K_M with an 8K context, Gemma 4 31B needs about 24 GB (weights 19 GB + KV cache + overhead). The smallest common hardware that fits is a RTX 5090.
Can an RTX 4090 (24GB) run Gemma 4 31B?
Not fully in VRAM. Gemma 4 31B needs about 24 GB even at Q4_K_M, so a 24 GB card would have to offload layers to system RAM at a large speed penalty.
Can a Mac run Gemma 4 31B?
Yes — Apple Silicon with 36 GB of unified memory or more (macOS lets the GPU use ~75% of it, ~27 GB) runs Gemma 4 31B at Q4_K_M.
How much VRAM does Gemma 4 31B need at its full 256K context?
The KV cache grows with context: about 2.2 GB at 8K tokens versus 43.8 GB at the full 256K window (FP16 cache). Add that to the weights (19 GB at Q4_K_M) plus overhead — long contexts can cost more than a whole quantisation step.
Related
VRAM calculator for any model ·Token counter
Similar-size local models: Qwen3 Coder 30B-A3B (30.5B) · Qwen3.6 35B-A3B (35B) · Qwen3.6 27B (27B) · Gemma 4 26B-A4B (26B) · GPT-OSS 20B (21B)
Last updated 2026-09-03. Architecture figures from the model's published config.json; see the methodology.