Run Gemma 4 31B locally

Gemma 4 31B is 31B parameters (dense). Here's the VRAM it needs at each quantization, the smallest GPU that fits, and how a self-hosted box compares with the cheapest verified API.

VRAM by quantization

QuantizationVRAM neededFits onNotes
int4 (Q4)18.6 GBRTX 4090 (24 GB) ($0.34/hr)smallest footprint, minor quality loss
int8 (Q8)37.2 GBA100 (80 GB) ($1.19/hr)near-lossless
fp16 (full)74.4 GBA100 (80 GB) ($1.19/hr)reference quality

VRAM ≈ params × bytes/param × 1.2 (overhead). See the fullmethod and break-even calculator.

Self-host vs API

Cheapest API for Gemma 4 31B is $0.44 / 1M tokens(blended) via CoreWeave. Running it yourself in int4 fits aRTX 4090 (24 GB) at $0.34/hr — about $248.2/month at 24/7. Those two lines cross at roughly 564M tokens/month: below that the API wins on cost, above it the dedicated GPU does (assuming you keep it busy). Tune your own volume in the break-even calculator.

Run it at home

No cloud account needed: Gemma 4 31B in int4 (18.6 GB) fits a RTX 5090 (32 GB) + host PC (plus a host PC), a $3,500 one-off buy. Amortized over 3 years that's about $0.1332/hr — hardware only, electricity aside. Against the CoreWeave API at $0.44/1M, buying it pays for itself after roughly 8.0B tokens total. Below that the API is cheaper; a machine that mostly sits idle rarely earns back its price.

Get the weights

Quantized builds on the model hubs — links search live, so they track new builds as they appear:

License: open weights under Gemma Terms of Use · terms. Compare all providers on the gemma-4-31b API page.