Gemma 4 31B hardware requirements
What is Gemma 4 31B?
Gemma 4 31B is the largest model in Google DeepMind's Gemma 4 family, released in April 2026. It is a dense model that reads text and images with up to a 256k context, built for reasoning, coding and agent work with native function calling. Its thinking mode is off by default, and unlike Gemma 3 it is licensed under Apache 2.0.
What to know before running Gemma 4 31B
Gemma 4 31B is a dense model, so every token reads all of its weights. At Q4_K_M it needs 19.5 GB with an 8k context, which makes 24GB the size that holds it completely: the GeForce RTX 3090, the GeForce RTX 4090 and the Radeon RX 7900 XTX all run it great. On 16GB cards part of it has to run from system RAM, and it is slow; the IQ4_XS file does not fit in 16GB either.
If you have less than 24GB, its sibling Gemma 4 26B-A4B is a mixture-of-experts model that uses about 4B parameters per token and handles small cards far better; on the GeForce RTX 5060 Ti 16GB CanRun expects it to run well, a theoretical estimate (±30%). Gemma 4 31B reads images as well as text. Its thinking mode is off by default, but CanRun still holds models that have one to a 1.5× stricter speed bar, so with thinking left off it may do a grade better than the table shows. On a Mac, the Apple M4 Pro needs its 48GB configuration to keep it on the GPU and runs it slowly, while the faster Apple M4 Max (40-core GPU) runs it well.
About the model
- Parameters
- 31.27B
- Attention
- Sliding-window attention
- Max context
- 262,144 tokens
- Released
- 2026-03-11
- Model card
- Gemma 4 31B on Hugging Face
Other sizes in this series
| Model | Parameters | Baseline quant | Memory needed (8k) | GeForce RTX 4060 | GeForce RTX 5060 Ti 16GB | GeForce RTX 3090 |
|---|---|---|---|---|---|---|
| Gemma 4 E2B | 5.12B | Q4_K_M | 2.1 GB | Runs great | Runs great | Runs great |
| Gemma 4 E4B | 8B | Q4_K_M | 3.7 GB | Runs great | Runs great | Runs great |
| Gemma 4 12B | 11.96B | Q4_K_M | 7.8 GB | Runs well | Runs great | Runs great |
| Gemma 4 26B-A4B | 26.54B total · 4B active (MoE) | Q4_K_M | 17.7 GB | Runs well | Runs well | Runs great |
| Gemma 4 31Bthis model | 31.27B | Q4_K_M | 19.5 GB | Runs slowly | Runs slowly | Runs great |
GGUF files
| Quant | File size | Quality | Published by |
|---|---|---|---|
| UD-Q2_K_XL | 11.77 GB | Heavy loss | Community GGUF · unsloth |
| IQ4_XS | 16.37 GB | Good balance | Community GGUF · unsloth |
| Q4_K_Mbaseline | 18.32 GB | Good balance | Community GGUF · unsloth |
| Q8_0 | 32.64 GB | Near-lossless | Community GGUF · unsloth |
File sizes do not include the vision projector (mmproj) that image input needs.
Some repositories publish only Unsloth Dynamic (UD) variants; sizes are those of the file you would download.
Memory needed by quant and context
| Quant | 4k | 8k | 16k | 32k | 64k | 128k | 256k |
|---|---|---|---|---|---|---|---|
| UD-Q2_K_XL | 12.6 | 13.0 | 13.7 | 15.2 | 18.2 | 24.2 | 36.1 |
| IQ4_XS | 17.2 | 17.6 | 18.3 | 19.8 | 22.8 | 28.8 | 40.7 |
| Q4_K_M | 19.2 | 19.5 | 20.3 | 21.8 | 24.8 | 30.7 | 42.7 |
| Q8_0 | 33.5 | 33.9 | 34.6 | 36.1 | 39.1 | 45.1 | 57.0 |
Which GPUs can run Gemma 4 31B?
How to read the verdicts
- Runs great
- Fully on the GPU at 20 tok/s or more
- Runs well
- Fully on the GPU at 8–20 tok/s; MoE experts in system RAM at 20 tok/s or more; or at least 90% on the GPU at 8 tok/s or more
- Runs slowly
- 2–8 tok/s; CPU-only; less than 90% on the GPU; or MoE experts in system RAM below 20 tok/s
- Won't run
- Does not fit, or under 2 tok/s
Dense models split between GPU and CPU slow down sharply — the CPU side sets the pace. MoE models that keep only their experts in system RAM degrade far more gently.
Filter this list by budget, type and context in the calculator
Scroll sideways to see every column.
| Hardware | Verdict | Speed | Quant | Memory | Runs as | Context | Notes | Price |
|---|---|---|---|---|---|---|---|---|
| GeForce RTX 5090 | est. 66.1 tok/s58.1–74.0calibrated estimate ±12% | Q4_K_M | 20.1 / 32.0 GB | Full GPU | up to 128k | — | $4,200 street (as of 2026-08-09) | |
| NVIDIA RTX PRO 6000 Blackwell | Runs great | est. 66.1 tok/s58.1–74.0calibrated estimate ±12% | Q4_K_M | 20.1 / 96.0 GB | Full GPU | up to 256k | — | — |
| NVIDIA RTX PRO 6000 Blackwell Max-Q | Runs great | est. 66.1 tok/s58.1–74.0calibrated estimate ±12% | Q4_K_M | 20.1 / 96.0 GB | Full GPU | up to 256k | — | — |
| Radeon RX 7900 XTX | Runs great | est. 38.4 tok/s33.8–43.0calibrated estimate ±12% | Q4_K_M | 20.1 / 24.0 GB | Full GPU | up to 32k | — | $999 launch MSRP |
| GeForce RTX 3090 Ti | Runs great | est. 37.2 tok/s32.7–41.6calibrated estimate ±12% | Q4_K_M | 20.1 / 24.0 GB | Full GPU | up to 32k | — | $1,999 launch MSRP |
| GeForce RTX 4090 | est. 37.2 tok/s32.7–41.6calibrated estimate ±12% | Q4_K_M | 20.1 / 24.0 GB | Full GPU | up to 32k | — | $2,755 street (as of 2026-08-09) | |
| Apple M5 Ultra · 96 GB | Runs great | est. 36.9 tok/s29.5–44.2calibrated estimate ±20% | Q4_K_M | 19.6 / 67.2 GB | Unified memory | up to 32k | — | — |
| GeForce RTX 3090 | est. 34.5 tok/s30.4–38.6calibrated estimate ±12% | Q4_K_M | 20.1 / 24.0 GB | Full GPU | up to 32k | — | $1,050 street (as of 2026-08-09) | |
| GeForce RTX 5090 Laptop | Runs great | est. 33.0 tok/s29.1–37.0calibrated estimate ±12% | Q4_K_M | 20.1 / 24.0 GB | Full GPU | up to 16k | — | — |
| Radeon RX 7900 XT | Runs well | est. 28.7 tok/s23.0–34.5calibrated estimate ±20% | Q4_K_M | 20.0 / 20.0 GB + 0.2 GB RAM | Partial offload | up to 16k |
| $899 launch MSRP |
| Apple M3 Ultra · 96 GB | Runs well | est. 24.6 tok/s19.7–29.5calibrated estimate ±20% | Q4_K_M | 19.6 / 67.2 GB | Unified memory | up to 128k |
| — |
| Apple M5 Max (40-core GPU) · 48 GB | Runs well | est. 24.6 tok/s19.7–29.5calibrated estimate ±20% | Q4_K_M | 19.6 / 33.6 GB | Unified memory | up to 128k |
| — |
| Apple M2 Ultra · 64 GB | Runs well | est. 24.0 tok/s19.2–28.8calibrated estimate ±20% | Q4_K_M | 19.6 / 44.8 GB | Unified memory | up to 128k |
| — |
| Apple M4 Max (40-core GPU) · 48 GB | Runs well | est. 21.9 tok/s17.5–26.2calibrated estimate ±20% | Q4_K_M | 19.6 / 33.6 GB | Unified memory | up to 128k |
| — |
| Apple M5 Max (32-core GPU) · 36 GB | Runs well | est. 18.4 tok/s14.7–22.1calibrated estimate ±20% | Q4_K_M | 19.6 / 25.2 GB | Unified memory | up to 64k | — | — |
| Apple M4 Max (32-core GPU) · 36 GB | Runs well | est. 16.4 tok/s13.1–19.7calibrated estimate ±20% | Q4_K_M | 19.6 / 25.2 GB | Unified memory | up to 64k | — | — |
| Apple M5 Pro · 48 GB | Runs well | est. 12.3 tok/s9.8–14.7calibrated estimate ±20% | Q4_K_M | 19.6 / 33.6 GB | Unified memory | up to 8k | — | — |
| Ryzen AI Max+ 395 (Strix Halo) · 32 GB | Runs slowly | est. 11.1 tok/s8.8–13.3calibrated estimate ±20% | Q4_K_M | 19.6 / 22.4 GB | Unified memory | up to 32k |
| $1,999 launch MSRP (128 GB) |
| NVIDIA DGX Spark · 128 GB | Runs slowly | 10.1 tok/s8k estimate 11.2 tok/s (9.0–13.5, calibrated estimate ±20%)measured (1 run, 512 context) | Q4_K_M | 19.6 / 116.9 GB | Unified memory | up to 256k |
| $3,999 launch MSRP (128 GB) |
| GeForce RTX 5080 | Runs slowly | est. 8.5 tok/s6.8–10.1calibrated estimate ±20% | Q4_K_M | 16.0 / 16.0 GB + 4.2 GB RAM | Partial offload | up to 64k |
| $1,256 street (as of 2026-08-09) |
| GeForce RTX 5070 Ti | Runs slowly | est. 8.3 tok/s6.7–10.0calibrated estimate ±20% | Q4_K_M | 16.0 / 16.0 GB + 4.2 GB RAM | Partial offload | up to 64k |
| $949 street (as of 2026-08-09) |
| GeForce RTX 5080 Laptop | Runs slowly | est. 8.3 tok/s6.7–10.0calibrated estimate ±20% | Q4_K_M | 16.0 / 16.0 GB + 4.2 GB RAM | Partial offload | up to 64k |
| — |
| GeForce RTX 4080 Super | Runs slowly | est. 8.0 tok/s6.4–9.6calibrated estimate ±20% | Q4_K_M | 16.0 / 16.0 GB + 4.2 GB RAM | Partial offload | up to 64k |
| $999 launch MSRP |
| GeForce RTX 4080 | Runs slowly | est. 8.0 tok/s6.4–9.6calibrated estimate ±20% | Q4_K_M | 16.0 / 16.0 GB + 4.2 GB RAM | Partial offload | up to 64k |
| $1,199 launch MSRP |
| Radeon RX 9070 | Runs slowly | est. 7.9 tok/s6.3–9.5calibrated estimate ±20% | Q4_K_M | 16.0 / 16.0 GB + 4.2 GB RAM | Partial offload | up to 64k |
| $639 street (as of 2026-08-09) |
| Radeon RX 9070 XT | Runs slowly | est. 7.9 tok/s6.3–9.5calibrated estimate ±20% | Q4_K_M | 16.0 / 16.0 GB + 4.2 GB RAM | Partial offload | up to 64k |
| $689 street (as of 2026-08-09) |
| Radeon RX 7800 XT | Runs slowly | est. 7.9 tok/s6.3–9.4calibrated estimate ±20% | Q4_K_M | 16.0 / 16.0 GB + 4.2 GB RAM | Partial offload | up to 64k |
| $499 launch MSRP |
| GeForce RTX 4070 Ti Super | Runs slowly | est. 7.8 tok/s6.3–9.4calibrated estimate ±20% | Q4_K_M | 16.0 / 16.0 GB + 4.2 GB RAM | Partial offload | up to 64k |
| $799 launch MSRP |
| GeForce RTX 4090 Laptop | Runs slowly | est. 7.5 tok/s6.0–9.0calibrated estimate ±20% | Q4_K_M | 16.0 / 16.0 GB + 4.2 GB RAM | Partial offload | up to 64k |
| — |
| Apple M4 Pro · 24 GB | Runs slowlyGemma 4 31B verdict on the Apple M4 Pro | est. 7.2 tok/s5.0–9.3theoretical estimate ±30% | Q4_K_M | 19.0 GB RAM | CPU only | up to 16k |
| — |
| GeForce RTX 5060 Ti 16GB | est. 7.0 tok/s5.6–8.4calibrated estimate ±20% | Q4_K_M | 16.0 / 16.0 GB + 4.2 GB RAM | Partial offload | up to 64k |
| $569 street (as of 2026-08-09) | |
| Radeon RX 9060 XT 16GB | Runs slowly | est. 6.4 tok/s5.1–7.7calibrated estimate ±20% | Q4_K_M | 16.0 / 16.0 GB + 4.2 GB RAM | Partial offload | up to 64k |
| $449 street (as of 2026-08-09) |
| GeForce RTX 4060 Ti 16GB | Runs slowly | est. 5.9 tok/s4.7–7.1calibrated estimate ±20% | Q4_K_M | 16.0 / 16.0 GB + 4.2 GB RAM | Partial offload | up to 64k |
| $499 launch MSRP |
| GeForce RTX 3080 12GB | Runs slowly | est. 4.9 tok/s3.9–5.8calibrated estimate ±20% | Q4_K_M | 12.0 / 12.0 GB + 8.2 GB RAM | Partial offload | up to 32k | — | $799 launch MSRP |
| GeForce RTX 5070 | Runs slowlyGemma 4 31B verdict on the GeForce RTX 5070 | est. 4.7 tok/s3.8–5.7calibrated estimate ±20% | Q4_K_M | 12.0 / 12.0 GB + 8.2 GB RAM | Partial offload | up to 32k | — | $629 street (as of 2026-08-09) |
| GeForce RTX 5070 Ti Laptop | Runs slowly | est. 4.7 tok/s3.8–5.7calibrated estimate ±20% | Q4_K_M | 12.0 / 12.0 GB + 8.2 GB RAM | Partial offload | up to 32k | — | — |
| GeForce RTX 4070 | Runs slowlyGemma 4 31B verdict on the GeForce RTX 4070 | est. 4.6 tok/s3.7–5.5calibrated estimate ±20% | Q4_K_M | 12.0 / 12.0 GB + 8.2 GB RAM | Partial offload | up to 32k | — | $599 launch MSRP |
| GeForce RTX 4070 Super | Runs slowly | est. 4.6 tok/s3.7–5.5calibrated estimate ±20% | Q4_K_M | 12.0 / 12.0 GB + 8.2 GB RAM | Partial offload | up to 32k | — | $599 launch MSRP |
| Apple M6 · 24 GB | Runs slowly | est. 4.5 tok/s3.1–5.8theoretical estimate ±30% | Q4_K_M | 19.0 GB RAM | CPU only | up to 16k | — | — |
| GeForce RTX 4080 Laptop | Runs slowly | est. 4.5 tok/s3.6–5.4calibrated estimate ±20% | Q4_K_M | 12.0 / 12.0 GB + 8.2 GB RAM | Partial offload | up to 32k | — | — |
| Intel Arc B580 | Runs slowly | est. 4.4 tok/s3.5–5.3calibrated estimate ±20% | Q4_K_M | 12.0 / 12.0 GB + 8.2 GB RAM | Partial offload | up to 32k | — | $290 street (as of 2026-08-09) |
| GeForce RTX 3060 12GB | est. 4.3 tok/s3.5–5.2calibrated estimate ±20% | Q4_K_M | 12.0 / 12.0 GB + 8.2 GB RAM | Partial offload | up to 32k | — | $250 street (as of 2026-08-09) | |
| GeForce RTX 2080 Ti | Runs slowly | est. 4.3 tok/s3.4–5.1calibrated estimate ±20% | Q4_K_M | 11.0 / 11.0 GB + 9.2 GB RAM | Partial offload | up to 32k | — | $999 launch MSRP |
| GeForce GTX 1080 Ti | Runs slowly | est. 4.2 tok/s2.9–5.4theoretical estimate ±30% | Q4_K_M | 11.0 / 11.0 GB + 9.2 GB RAM | Partial offload | up to 32k | — | $699 launch MSRP |
| Apple M5 · 24 GB | Runs slowly | est. 4.0 tok/s2.8–5.3theoretical estimate ±30% | Q4_K_M | 19.0 GB RAM | CPU only | up to 16k | — | — |
| GeForce RTX 3080 10GB | Runs slowly | est. 4.0 tok/s3.2–4.8calibrated estimate ±20% | Q4_K_M | 10.0 / 10.0 GB + 10.2 GB RAM | Partial offload | up to 32k | — | $699 launch MSRP |
| GeForce RTX 3070 | Runs slowly | est. 3.3 tok/s2.7–4.0calibrated estimate ±20% | Q4_K_M | 8.0 / 8.0 GB + 12.2 GB RAM | Partial offload | up to 16k | — | $499 launch MSRP |
| GeForce RTX 5060 | Runs slowly | est. 3.3 tok/s2.7–4.0calibrated estimate ±20% | Q4_K_M | 8.0 / 8.0 GB + 12.2 GB RAM | Partial offload | up to 16k | — | $339 street (as of 2026-08-09) |
| GeForce RTX 5060 Ti 8GB | Runs slowly | est. 3.3 tok/s2.7–4.0calibrated estimate ±20% | Q4_K_M | 8.0 / 8.0 GB + 12.2 GB RAM | Partial offload | up to 16k | — | $429 street (as of 2026-08-09) |
| GeForce RTX 4060 Ti 8GB | Runs slowly | est. 3.2 tok/s2.6–3.8calibrated estimate ±20% | Q4_K_M | 8.0 / 8.0 GB + 12.2 GB RAM | Partial offload | up to 8k | — | $399 launch MSRP |
| GeForce RTX 4060 | Runs slowlyGemma 4 31B verdict on the GeForce RTX 4060 | est. 3.2 tok/s2.5–3.8calibrated estimate ±20% | Q4_K_M | 8.0 / 8.0 GB + 12.2 GB RAM | Partial offload | up to 8k | — | $299 launch MSRP |
| Apple M4 · 24 GB | Runs slowlyGemma 4 31B verdict on the Apple M4 | est. 3.2 tok/s2.2–4.1theoretical estimate ±30% | Q4_K_M | 19.0 GB RAM | CPU only | up to 16k | — | — |
| GeForce RTX 4060 Laptop | Runs slowly | est. 3.2 tok/s2.5–3.8calibrated estimate ±20% | Q4_K_M | 8.0 / 8.0 GB + 12.2 GB RAM | Partial offload | up to 8k | — | — |
| GeForce RTX 4070 Laptop | Runs slowly | est. 3.2 tok/s2.5–3.8calibrated estimate ±20% | Q4_K_M | 8.0 / 8.0 GB + 12.2 GB RAM | Partial offload | up to 8k | — | — |
| GeForce RTX 3050 8GB | Runs slowly | est. 3.1 tok/s2.5–3.7calibrated estimate ±20% | Q4_K_M | 8.0 / 8.0 GB + 12.2 GB RAM | Partial offload | up to 8k | — | $249 launch MSRP |
| DDR5-6000 dual-channel CPU · 96 GB | Won't runTry UD-Q2_K_XL (heavy quality loss): Runs slowly | est. 3.9 tok/s3.1–4.6calibrated estimate ±20% | UD-Q2_K_XL | 12.4 GB RAM | CPU only | up to 32k | — | — |
| DDR5-5600 dual-channel CPU · 96 GB | Won't runTry UD-Q2_K_XL (heavy quality loss): Runs slowly | est. 3.6 tok/s2.9–4.3calibrated estimate ±20% | UD-Q2_K_XL | 12.4 GB RAM | CPU only | up to 32k | — | — |
| DDR4-3200 dual-channel CPU · 64 GB | Won't run | est. 1.3 tok/s1.1–1.6calibrated estimate ±20% | Q4_K_M | 19.0 GB RAM | CPU only | — |
| — |
Models with a thinking mode spend extra tokens thinking, so their speed thresholds are 1.5× stricter (30 / 12 / 3 tok/s). With thinking turned off, a model may do one grade better.
Cheapest GPUs that run it
- Runs greatGeForce RTX 3090$1,050 street (as of 2026-08-09), est. 34.5 tok/s (30.4–38.6, calibrated estimate ±12%).
Measured results for Gemma 4 31B
Public benchmarks we calibrate against. Their conditions (context, backend, flags) can differ from the estimates above.
| Hardware | Quant | Backend | Context | Prompt (tok/s) | Generation (tok/s) | Flags | Source | Measured |
|---|---|---|---|---|---|---|---|---|
| Ryzen AI Max+ 395 (Strix Halo) | UD-Q4_K_XL | llama.cpp | 512 | 302.0 | 11.5 | Vulkan | github.com | 2026-05-18 |
| NVIDIA DGX Spark | Q4_K_M | llama.cpp | 512 | 687.0 | 10.1 | CUDA | github.com | 2026-04-14 |
Frequently asked questions
How much VRAM does Gemma 4 31B need?
At Q4_K_M the file is 18.32 GB; with 8k context a graphics card needs about 19.5 GB (weights 18.30 GB, KV cache 0.7 GB, compute buffer 0.6 GB). The smallest tracked file (UD-Q2_K_XL (heavy quality loss)) needs about 13.0 GB.
What is the cheapest GPU that runs Gemma 4 31B well?
Cheapest that runs it great: GeForce RTX 3090 at $1,050 (street price as of 2026-08-09), est. 34.5 tok/s (30.4–38.6, calibrated estimate ±12%).
Can Gemma 4 31B run on an 8 GB, 16 GB or 24 GB GPU?
At Q4_K_M with 8k context: GeForce RTX 4060 — Runs slowly, est. 3.2 tok/s (2.5–3.8, calibrated estimate ±20%); GeForce RTX 5060 Ti 16GB — Runs slowly, est. 7.0 tok/s (5.6–8.4, calibrated estimate ±20%); GeForce RTX 3090 — Runs great, est. 34.5 tok/s (30.4–38.6, calibrated estimate ±12%).
Speeds are estimates from memory bandwidth, calibrated against public benchmarks, and each one comes with an error band and a confidence label. Real results vary with drivers, backend, context length and thermals.