AI Token Price

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

Memory Gemma 4 31B needs at each quantisation and context length
Quantisation8K context32K context128K context
Q4_K_Musual choice21 GB23 GB31 GB
Q5_K_M24 GB26 GB34 GB
Q8_035 GB37 GB45 GB
BF1664 GB66 GB74 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

Whether Gemma 4 31B fits and how fast it runs on each device
HardwareMemoryFits?Speed (estimate)
RTX 509032 GBFits68 tok/s
RTX 508016 GBPartly, with system RAM6.9 tok/s
RTX 5070 Ti16 GBPartly, with system RAM6.8 tok/s
RTX 5060 Ti 16 GB16 GBPartly, with system RAM6.1 tok/s
RTX 4090 (used)24 GBFits39 tok/s
RTX 3090 (used)24 GBFits36 tok/s
RTX 3060 12 GB12 GBPartly, with system RAM4.4 tok/s
RTX PRO 6000 Blackwell96 GBFits68 tok/s
Radeon RX 9070 XT16 GBPartly, with system RAM6.5 tok/s
Radeon RX 7900 XTX24 GBFits37 tok/s
Radeon AI PRO R970032 GBFits26 tok/s
Intel Arc Pro B7032 GBFits18.1 tok/s
Mac Studio M5 Max 128 GB128 GBFits24 tok/s
Mac Studio M5 Ultra 512 GB512 GBFits30 tok/s
Ryzen AI Max+ 395 128 GB128 GBFits9.5 tok/s
NVIDIA DGX Spark128 GBFits10.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.