Run Gemma 4 31B locally: memory, speed and cost
Gemma 4 31B has 30.7 billion parameters (dense). At Q4_K_M it needs about 23 GB with 32K tokens of context, so the cheapest hardware here that runs it is the Intel Arc Pro B70 (about 18.1 tokens a second). It scores 143 on Epoch AI’s Capabilities Index. Through an API it costs $0.09 / $0.34 per 1M tokens.
Memory needed
Weights plus context cache
| Quantisation | 8K context | 32K context | 128K context |
|---|---|---|---|
| Q4_K_Musual choice | 21 GB | 23 GB | 31 GB |
| Q5_K_M | 24 GB | 26 GB | 34 GB |
| Q8_0 | 35 GB | 37 GB | 45 GB |
| BF16 | 64 GB | 66 GB | 74 GB |
Estimates: weights at the stated bits per weight, plus the context (KV) cache, plus about 1 GB of overhead. Lower-bit quantisations save memory at some cost in quality.
Gemma 4 31B on each device
Q4_K_M, 32K context
| Hardware | Memory | Fits? | Speed (estimate) |
|---|---|---|---|
| RTX 5090 | 32 GB | Fits | 68 tok/s |
| RTX 5080 | 16 GB | Partly, with system RAM | 6.9 tok/s |
| RTX 5070 Ti | 16 GB | Partly, with system RAM | 6.8 tok/s |
| RTX 5060 Ti 16 GB | 16 GB | Partly, with system RAM | 6.1 tok/s |
| RTX 4090 (used) | 24 GB | Fits | 39 tok/s |
| RTX 3090 (used) | 24 GB | Fits | 36 tok/s |
| RTX 3060 12 GB | 12 GB | Partly, with system RAM | 4.4 tok/s |
| RTX PRO 6000 Blackwell | 96 GB | Fits | 68 tok/s |
| Radeon RX 9070 XT | 16 GB | Partly, with system RAM | 6.5 tok/s |
| Radeon RX 7900 XTX | 24 GB | Fits | 37 tok/s |
| Radeon AI PRO R9700 | 32 GB | Fits | 26 tok/s |
| Intel Arc Pro B70 | 32 GB | Fits | 18.1 tok/s |
| Mac Studio M5 Max 128 GB | 128 GB | Fits | 24 tok/s |
| Mac Studio M5 Ultra 512 GB | 512 GB | Fits | 30 tok/s |
| Ryzen AI Max+ 395 128 GB | 128 GB | Fits | 9.5 tok/s |
| NVIDIA DGX Spark | 128 GB | Fits | 10.2 tok/s |
Generation speed estimated from memory bandwidth, calibrated against published llama.cpp results. Fastest here: RTX 5090, about 68 tokens a second. Try other settings in the calculator.
How capable is it?
Capability 143 (range 141–146) on the Epoch Capabilities Index. API models with a similar score: Gemini 3.5 Flash-Lite (145, $0.30 / $2.50) and MiniMax M3 (147, $0.30 / $1.20). Similar local models: Gemma 4 26B-A4B (142), Qwen3.6 35B-A3B (144), gpt-oss-120b (140).
Source: Epoch Capabilities Index by Epoch AI, CC BY 4.0, read 4 Nov 2026.
Or use it through an API
$0.09 / $0.34 per 1M input / output tokens through OpenRouter (Gemma 4 31B hosted prices). A customer chat assistant of 100M input and 20M output tokens a month costs about $15.80, so local hardware pays for itself only with heavy use.
Questions
How much VRAM does Gemma 4 31B need?
About 21 GB at Q4_K_M with 8K tokens of context, 23 GB with 32K and 31 GB with 128K. At 8-bit (Q8_0) it needs about 35 GB with 8K context.
Can Gemma 4 31B run on a Mac?
Yes. A Mac Studio M5 Max with 128GB runs it with 32K context at an estimated 24 tokens a second.
How fast is Gemma 4 31B on an RTX 4090?
About 39 tokens a second with 32K context, an estimate from the card’s memory bandwidth.
How capable is Gemma 4 31B?
It scores 143 on Epoch AI’s Capabilities Index (range 141–146), close to Gemini 3.5 Flash-Lite (145) and MiniMax M3 (147) among API models.
What does Gemma 4 31B cost through an API?
$0.09 / $0.34 per 1M input / output tokens through OpenRouter, the cheapest host we track. A customer chat assistant of 100M input and 20M output tokens a month would cost about $15.80.