CanRun

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.

Model card · Release post

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

Other sizes in this series

Graphics card memory each model needs at its baseline quant with 8k context, and its verdict on common graphics cards, smallest model first
ModelParametersBaseline quantMemory needed (8k)GeForce RTX 4060GeForce RTX 5060 Ti 16GBGeForce RTX 3090
Gemma 4 E2B5.12BQ4_K_M2.1 GBRuns greatRuns greatRuns great
Gemma 4 E4B8BQ4_K_M3.7 GBRuns greatRuns greatRuns great
Gemma 4 12B11.96BQ4_K_M7.8 GBRuns wellRuns greatRuns great
Gemma 4 26B-A4B26.54B total · 4B active (MoE)Q4_K_M17.7 GBRuns wellRuns wellRuns great
Gemma 4 31Bthis model31.27BQ4_K_M19.5 GBRuns slowlyRuns slowlyRuns great

GGUF files

Tracked quantizations of Gemma 4 31B, smallest first
QuantFile sizeQualityPublished by
UD-Q2_K_XL11.77 GBHeavy lossCommunity GGUF · unsloth
IQ4_XS16.37 GBGood balanceCommunity GGUF · unsloth
Q4_K_Mbaseline18.32 GBGood balanceCommunity GGUF · unsloth
Q8_032.64 GBNear-losslessCommunity 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

Graphics card memory in GB: weights loaded on the GPU + f16 KV cache + compute buffer. Add about 0.6 GB if the GPU also drives your display on Windows.
Quant4k8k16k32k64k128k256k
UD-Q2_K_XL12.613.013.715.218.224.236.1
IQ4_XS17.217.618.319.822.828.840.7
Q4_K_M19.219.520.321.824.830.742.7
Q8_033.533.934.636.139.145.157.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.

58 GPUs, Macs and CPU setups at Q4_K_M with 8k context, sorted by verdict and speed
HardwareVerdictSpeedQuantMemoryRuns asContextNotesPrice
GeForce RTX 5090
est. 66.1 tok/s58.1–74.0calibrated estimate ±12%
Q4_K_M20.1 / 32.0 GBFull GPUup 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_M20.1 / 96.0 GBFull GPUup to 256k——
NVIDIA RTX PRO 6000 Blackwell Max-Q
Runs great
est. 66.1 tok/s58.1–74.0calibrated estimate ±12%
Q4_K_M20.1 / 96.0 GBFull GPUup to 256k——
Radeon RX 7900 XTX
Runs great
est. 38.4 tok/s33.8–43.0calibrated estimate ±12%
Q4_K_M20.1 / 24.0 GBFull GPUup to 32k—$999 launch MSRP
GeForce RTX 3090 Ti
Runs great
est. 37.2 tok/s32.7–41.6calibrated estimate ±12%
Q4_K_M20.1 / 24.0 GBFull GPUup to 32k—$1,999 launch MSRP
GeForce RTX 4090
est. 37.2 tok/s32.7–41.6calibrated estimate ±12%
Q4_K_M20.1 / 24.0 GBFull GPUup 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_M19.6 / 67.2 GBUnified memoryup to 32k——
GeForce RTX 3090
est. 34.5 tok/s30.4–38.6calibrated estimate ±12%
Q4_K_M20.1 / 24.0 GBFull GPUup 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_M20.1 / 24.0 GBFull GPUup to 16k——
Radeon RX 7900 XT
Runs well
est. 28.7 tok/s23.0–34.5calibrated estimate ±20%
Q4_K_M20.0 / 20.0 GB + 0.2 GB RAMPartial offloadup to 16k
  • Try IQ4_XS: Runs great
$899 launch MSRP
Apple M3 Ultra · 96 GB
Runs well
est. 24.6 tok/s19.7–29.5calibrated estimate ±20%
Q4_K_M19.6 / 67.2 GBUnified memoryup to 128k
  • UD-Q2_K_XL (heavy quality loss): Runs great
—
Apple M5 Max (40-core GPU) · 48 GB
Runs well
est. 24.6 tok/s19.7–29.5calibrated estimate ±20%
Q4_K_M19.6 / 33.6 GBUnified memoryup to 128k
  • UD-Q2_K_XL (heavy quality loss): Runs great
—
Apple M2 Ultra · 64 GB
Runs well
est. 24.0 tok/s19.2–28.8calibrated estimate ±20%
Q4_K_M19.6 / 44.8 GBUnified memoryup to 128k
  • UD-Q2_K_XL (heavy quality loss): Runs great
—
Apple M4 Max (40-core GPU) · 48 GB
Runs well
est. 21.9 tok/s17.5–26.2calibrated estimate ±20%
Q4_K_M19.6 / 33.6 GBUnified memoryup to 128k
  • UD-Q2_K_XL (heavy quality loss): Runs great
—
Apple M5 Max (32-core GPU) · 36 GB
Runs well
est. 18.4 tok/s14.7–22.1calibrated estimate ±20%
Q4_K_M19.6 / 25.2 GBUnified memoryup to 64k——
Apple M4 Max (32-core GPU) · 36 GB
Runs well
est. 16.4 tok/s13.1–19.7calibrated estimate ±20%
Q4_K_M19.6 / 25.2 GBUnified memoryup to 64k——
Apple M5 Pro · 48 GB
Runs well
est. 12.3 tok/s9.8–14.7calibrated estimate ±20%
Q4_K_M19.6 / 33.6 GBUnified memoryup to 8k——
Ryzen AI Max+ 395 (Strix Halo) · 32 GB
Runs slowly
est. 11.1 tok/s8.8–13.3calibrated estimate ±20%
Q4_K_M19.6 / 22.4 GBUnified memoryup to 32k
  • Try IQ4_XS: Runs well
$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_M19.6 / 116.9 GBUnified memoryup to 256k
  • Try IQ4_XS: Runs well
$3,999 launch MSRP (128 GB)
GeForce RTX 5080
Runs slowly
est. 8.5 tok/s6.8–10.1calibrated estimate ±20%
Q4_K_M16.0 / 16.0 GB + 4.2 GB RAMPartial offloadup to 64k
  • UD-Q2_K_XL (heavy quality loss): Runs great
$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_M16.0 / 16.0 GB + 4.2 GB RAMPartial offloadup to 64k
  • UD-Q2_K_XL (heavy quality loss): Runs great
$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_M16.0 / 16.0 GB + 4.2 GB RAMPartial offloadup to 64k
  • UD-Q2_K_XL (heavy quality loss): Runs great
—
GeForce RTX 4080 Super
Runs slowly
est. 8.0 tok/s6.4–9.6calibrated estimate ±20%
Q4_K_M16.0 / 16.0 GB + 4.2 GB RAMPartial offloadup to 64k
  • UD-Q2_K_XL (heavy quality loss): Runs great
$999 launch MSRP
GeForce RTX 4080
Runs slowly
est. 8.0 tok/s6.4–9.6calibrated estimate ±20%
Q4_K_M16.0 / 16.0 GB + 4.2 GB RAMPartial offloadup to 64k
  • UD-Q2_K_XL (heavy quality loss): Runs great
$1,199 launch MSRP
Radeon RX 9070
Runs slowly
est. 7.9 tok/s6.3–9.5calibrated estimate ±20%
Q4_K_M16.0 / 16.0 GB + 4.2 GB RAMPartial offloadup to 64k
  • UD-Q2_K_XL (heavy quality loss): Runs great
$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_M16.0 / 16.0 GB + 4.2 GB RAMPartial offloadup to 64k
  • UD-Q2_K_XL (heavy quality loss): Runs great
$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_M16.0 / 16.0 GB + 4.2 GB RAMPartial offloadup to 64k
  • UD-Q2_K_XL (heavy quality loss): Runs great
$499 launch MSRP
GeForce RTX 4070 Ti Super
Runs slowly
est. 7.8 tok/s6.3–9.4calibrated estimate ±20%
Q4_K_M16.0 / 16.0 GB + 4.2 GB RAMPartial offloadup to 64k
  • UD-Q2_K_XL (heavy quality loss): Runs great
$799 launch MSRP
GeForce RTX 4090 Laptop
Runs slowly
est. 7.5 tok/s6.0–9.0calibrated estimate ±20%
Q4_K_M16.0 / 16.0 GB + 4.2 GB RAMPartial offloadup to 64k
  • UD-Q2_K_XL (heavy quality loss): Runs great
—
Apple M4 Pro · 24 GB
est. 7.2 tok/s5.0–9.3theoretical estimate ±30%
Q4_K_M19.0 GB RAMCPU onlyup to 16k
  • UD-Q2_K_XL (heavy quality loss): Runs well
—
GeForce RTX 5060 Ti 16GB
est. 7.0 tok/s5.6–8.4calibrated estimate ±20%
Q4_K_M16.0 / 16.0 GB + 4.2 GB RAMPartial offloadup to 64k
  • UD-Q2_K_XL (heavy quality loss): Runs well
$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_M16.0 / 16.0 GB + 4.2 GB RAMPartial offloadup to 64k
  • UD-Q2_K_XL (heavy quality loss): Runs well
$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_M16.0 / 16.0 GB + 4.2 GB RAMPartial offloadup to 64k
  • UD-Q2_K_XL (heavy quality loss): Runs well
$499 launch MSRP
GeForce RTX 3080 12GB
Runs slowly
est. 4.9 tok/s3.9–5.8calibrated estimate ±20%
Q4_K_M12.0 / 12.0 GB + 8.2 GB RAMPartial offloadup to 32k—$799 launch MSRP
GeForce RTX 5070
est. 4.7 tok/s3.8–5.7calibrated estimate ±20%
Q4_K_M12.0 / 12.0 GB + 8.2 GB RAMPartial offloadup 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_M12.0 / 12.0 GB + 8.2 GB RAMPartial offloadup to 32k——
GeForce RTX 4070
est. 4.6 tok/s3.7–5.5calibrated estimate ±20%
Q4_K_M12.0 / 12.0 GB + 8.2 GB RAMPartial offloadup to 32k—$599 launch MSRP
GeForce RTX 4070 Super
Runs slowly
est. 4.6 tok/s3.7–5.5calibrated estimate ±20%
Q4_K_M12.0 / 12.0 GB + 8.2 GB RAMPartial offloadup to 32k—$599 launch MSRP
Apple M6 · 24 GB
Runs slowly
est. 4.5 tok/s3.1–5.8theoretical estimate ±30%
Q4_K_M19.0 GB RAMCPU onlyup to 16k——
GeForce RTX 4080 Laptop
Runs slowly
est. 4.5 tok/s3.6–5.4calibrated estimate ±20%
Q4_K_M12.0 / 12.0 GB + 8.2 GB RAMPartial offloadup to 32k——
Intel Arc B580
Runs slowly
est. 4.4 tok/s3.5–5.3calibrated estimate ±20%
Q4_K_M12.0 / 12.0 GB + 8.2 GB RAMPartial offloadup 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_M12.0 / 12.0 GB + 8.2 GB RAMPartial offloadup 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_M11.0 / 11.0 GB + 9.2 GB RAMPartial offloadup to 32k—$999 launch MSRP
GeForce GTX 1080 Ti
Runs slowly
est. 4.2 tok/s2.9–5.4theoretical estimate ±30%
Q4_K_M11.0 / 11.0 GB + 9.2 GB RAMPartial offloadup to 32k—$699 launch MSRP
Apple M5 · 24 GB
Runs slowly
est. 4.0 tok/s2.8–5.3theoretical estimate ±30%
Q4_K_M19.0 GB RAMCPU onlyup to 16k——
GeForce RTX 3080 10GB
Runs slowly
est. 4.0 tok/s3.2–4.8calibrated estimate ±20%
Q4_K_M10.0 / 10.0 GB + 10.2 GB RAMPartial offloadup to 32k—$699 launch MSRP
GeForce RTX 3070
Runs slowly
est. 3.3 tok/s2.7–4.0calibrated estimate ±20%
Q4_K_M8.0 / 8.0 GB + 12.2 GB RAMPartial offloadup to 16k—$499 launch MSRP
GeForce RTX 5060
Runs slowly
est. 3.3 tok/s2.7–4.0calibrated estimate ±20%
Q4_K_M8.0 / 8.0 GB + 12.2 GB RAMPartial offloadup 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_M8.0 / 8.0 GB + 12.2 GB RAMPartial offloadup 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_M8.0 / 8.0 GB + 12.2 GB RAMPartial offloadup to 8k—$399 launch MSRP
GeForce RTX 4060
est. 3.2 tok/s2.5–3.8calibrated estimate ±20%
Q4_K_M8.0 / 8.0 GB + 12.2 GB RAMPartial offloadup to 8k—$299 launch MSRP
Apple M4 · 24 GB
est. 3.2 tok/s2.2–4.1theoretical estimate ±30%
Q4_K_M19.0 GB RAMCPU onlyup to 16k——
GeForce RTX 4060 Laptop
Runs slowly
est. 3.2 tok/s2.5–3.8calibrated estimate ±20%
Q4_K_M8.0 / 8.0 GB + 12.2 GB RAMPartial offloadup to 8k——
GeForce RTX 4070 Laptop
Runs slowly
est. 3.2 tok/s2.5–3.8calibrated estimate ±20%
Q4_K_M8.0 / 8.0 GB + 12.2 GB RAMPartial offloadup to 8k——
GeForce RTX 3050 8GB
Runs slowly
est. 3.1 tok/s2.5–3.7calibrated estimate ±20%
Q4_K_M8.0 / 8.0 GB + 12.2 GB RAMPartial offloadup 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_XL12.4 GB RAMCPU onlyup 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_XL12.4 GB RAMCPU onlyup to 32k——
DDR4-3200 dual-channel CPU · 64 GB
Won't run
est. 1.3 tok/s1.1–1.6calibrated estimate ±20%
Q4_K_M19.0 GB RAMCPU only—
  • Fits, but too slow to use
—

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.

Measured results for Gemma 4 31B
HardwareQuantBackendContextPrompt (tok/s)Generation (tok/s)FlagsSourceMeasured
Ryzen AI Max+ 395 (Strix Halo)UD-Q4_K_XLllama.cpp512302.011.5Vulkangithub.com2026-05-18
NVIDIA DGX SparkQ4_K_Mllama.cpp512687.010.1CUDAgithub.com2026-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.