RunsOnMy ModelsGPUs & MacsBy VRAMAPI pricesVRAM calculatorNew

Can I run gemma 4 31B it locally?

gemma 4 31B it by google has 31B parameters. At 4-bit with an 8K context it needs about 20.0 GB of GPU memory. It fits on 48 of 65 GPUs and Macs we track. See all models that fit in 24 GB of VRAM.

20.0 GBQ4_K_M · 8K context
RTX 3090smallest consumer GPU that fits
M3 Pro 36GBsmallest Mac that fits
256Kmax context
GQA + sliding windowattention type

Memory needed by quant and context length

GB of GPU memory = weights + KV cache (FP16) + runtime overhead. Weights use real file sizes from unsloth/gemma-4-31B-it-GGUF where available (marked •), otherwise parameter count × bits per weight. How we calculate.

QuantQuality4K ctx8K ctx32K ctx128K ctx
2-bit (Q2_K)rough13.2 GB13.9 GB17.6 GB32.6 GB
3-bit (Q3_K_M) •usable16.0 GB16.7 GB20.4 GB35.4 GB
4-bit (Q4_K_M) •good, most popular19.4 GB20.0 GB23.7 GB38.7 GB
5-bit (Q5_K_M) •very good22.5 GB23.1 GB26.9 GB41.9 GB
6-bit (Q6_K) •near lossless25.8 GB26.4 GB30.2 GB45.2 GB
8-bit (Q8_0) •effectively lossless32.7 GB33.3 GB37.1 GB52.1 GB
16-bit (F16/BF16) •original weights59.5 GB60.1 GB63.9 GB78.9 GB

Which GPUs and Macs run gemma 4 31B it?

Best quality quant that fits at 8K context. "Tight" = within 10% of usable memory. Speed is a ceiling from memory bandwidth (real speed is typically 50–80% of it).

HardwareMemoryFits?Best quantNeedsMax tok/s (est.)
RTX 3060 12GB12 GBNo———details
RTX 4060 Ti 16GB16 GBTightQ2_K13.9 GB25details
RTX 309024 GBFitsQ4_K_M20.0 GB51details
RTX 409024 GBFitsQ4_K_M20.0 GB55details
RTX 509032 GBFitsQ6_K26.4 GB71details
RTX 5070 Ti16 GBTightQ2_K13.9 GB76details
RX 7900 XTX24 GBFitsQ4_K_M20.0 GB52details
Mac M4 Pro 48GB48 GBFitsQ6_K26.4 GB11details
Mac M4 Max 128GB128 GBFitsF1660.1 GB8.9details
Mac M3 Ultra 512GB512 GBFitsF1660.1 GB13details
DGX Spark128 GBFitsF1660.1 GB4.4details
RTX 407012 GBNo———details
RTX 5060 Ti 16GB16 GBTightQ2_K13.9 GB38details
RTX 40608 GBNo———details
Arc B58012 GBNo———details
RTX 3060 Ti8 GBNo———details
RTX 30708 GBNo———details
RTX 3080 10GB10 GBNo———details
RTX 3080 12GB12 GBNo———details
RTX 3090 Ti24 GBFitsQ4_K_M20.0 GB55details
RTX 4060 Ti 8GB8 GBNo———details
RTX 4070 Super12 GBNo———details
RTX 4070 Ti12 GBNo———details
RTX 4070 Ti Super16 GBTightQ2_K13.9 GB57details
RTX 408016 GBTightQ2_K13.9 GB61details
RTX 4080 Super16 GBTightQ2_K13.9 GB63details
RTX 50608 GBNo———details
RTX 507012 GBNo———details
RTX 508016 GBTightQ2_K13.9 GB82details
2x RTX 30902×24 GBFitsQ8_033.3 GB29details
2x RTX 40902×24 GBFitsQ8_033.3 GB31details
2x RTX 50902×32 GBFitsQ8_033.3 GB55details
RTX A600048 GBFitsQ8_033.3 GB24details
RTX 6000 Ada48 GBFitsQ8_033.3 GB29details
RTX PRO 6000 Blackwell96 GBFitsF1660.1 GB29details
L40S48 GBFitsQ8_033.3 GB26details
A100 40GB40 GBFitsQ8_033.3 GB48details
A100 80GB80 GBFitsF1660.1 GB33details
H100 PCIe80 GBFitsF1660.1 GB33details
H100 SXM80 GBFitsF1660.1 GB55details
H200141 GBFitsF1660.1 GB78details
RX 76008 GBNo———details
RX 7700 XT12 GBNo———details
RX 7800 XT16 GBTightQ2_K13.9 GB53details
RX 7900 GRE16 GBTightQ2_K13.9 GB49details
RX 7900 XT20 GBFitsQ3_K_M16.7 GB54details
RX 907016 GBTightQ2_K13.9 GB55details
RX 9070 XT16 GBTightQ2_K13.9 GB55details
Ryzen AI Max+ 395 128GB128 GBFitsF1660.1 GB4.2details
Arc A770 16GB16 GBTightQ2_K13.9 GB48details
Mac M1 16GB16 GBNo———details
Mac M2 24GB24 GBFitsQ2_K13.9 GB8.5details
Mac M3 24GB24 GBFitsQ2_K13.9 GB8.5details
Mac M4 16GB16 GBNo———details
Mac M4 32GB32 GBFitsQ3_K_M16.7 GB8.1details
Mac M1 Pro 32GB32 GBFitsQ3_K_M16.7 GB14details
Mac M3 Pro 36GB36 GBFitsQ4_K_M20.0 GB8.2details
Mac M4 Pro 24GB24 GBFitsQ2_K13.9 GB23details
Mac M4 Pro 64GB64 GBFitsQ8_033.3 GB8.4details
Mac M1 Max 64GB64 GBFitsQ8_033.3 GB12details
Mac M2 Max 96GB96 GBFitsF1660.1 GB6.5details
Mac M3 Max 128GB128 GBFitsF1660.1 GB6.5details
Mac M4 Max 64GB64 GBFitsQ8_033.3 GB17details
Mac M2 Ultra 192GB192 GBFitsF1660.1 GB13details
Mac M3 Ultra 256GB256 GBFitsF1660.1 GB13details

Prefer an API?

Google: Gemma 4 31B is on OpenRouter at $0.20 per 1M input tokens and $0.40 per 1M output tokens. Price details and history →

Questions

How much VRAM does gemma 4 31B it need?

About 20.0 GB at 4-bit (Q4_K_M) with an 8K context: 17.1 GB of weights (real GGUF file size), 2.0 GB of KV cache and 0.9 GB of runtime overhead. At 8-bit it needs about 33.3 GB.

What is the smallest GPU that runs gemma 4 31B it?

At Q4_K_M and 8K context, the smallest single consumer GPU in our table that fits it is the RTX 3090 (24 GB).

Can I run gemma 4 31B it on a Mac?

Yes. At Q4_K_M with 8K context it fits on a Mac M3 Pro 36GB or larger, using the default macOS GPU memory limit.

Similar models

Same family or a similar parameter count, with the VRAM each needs at Q4_K_M and 8K context.

gemma 3 27b it

27B · 17.3 GB at 4-bit

diffusiongemma 26B A4B it

26B · 17.1 GB at 4-bit

gemma 4 26B A4B it

26B · 17.2 GB at 4-bit

GLM 4.7 Flash

31B · 18.2 GB at 4-bit

Qwen3 Coder 30B A3B Instruct

31B · 18.7 GB at 4-bit

North Mini Code 1.0

30B · 19.3 GB at 4-bit

Model facts

Hugging Face repogoogle/gemma-4-31B-it
Parameters31,273,088,876 (31B)
Layers / hidden size60 / 5376
AttentionGQA + sliding window; 32 heads, 16 KV heads, head dim 256; sliding window 1024
KV cache per token (FP16)960.0 KiB (sliding layers capped at the window)
Max context262,144 tokens
Licenseapache-2.0
Released on HFMar 11, 2026
Downloads (30d) / likes6,350,048 / 4,383

Sources: Hugging Face model API · config.json (google/gemma-4-31B-it) · GGUF files · GPU specs from vendor pages (list). Data fetched Nov 17, 2026. Spot an error? Report it.