Magic Tools
LLM VRAM Calculator (all models)

Can You Run Gemma 4 31B? VRAM Requirements

Gemma 4 31B has 31.3B total parameters. Running it at Q4_K_M (GGUF) with 16K context takes roughly 20.5 GB of memory (17.8 GB weights + 1.3 GB KV cache + runtime overhead). The minimum viable hardware is about RTX 3090 / 4090 24GB. All numbers are planning estimates, verified 2026-09-05.

⚠ Some architecture details of this model are estimated — treat results as ballpark figures.

VRAM by quantization (16K context)

QuantizationWeightsTotal neededMinimum hardware
FP16 / BF1658.3 GB64.2 GBA100 / H100 80GB
FP829.2 GB32.7 GBMac 36GB unified
Q8_0 (GGUF)30.9 GB34.6 GBA100 40GB
Q6_K (GGUF)23.9 GB27.1 GBRTX 5090 32GB
Q5_K_M (GGUF)20.7 GB23.6 GBRTX 5090 32GB
MXFP415.4 GB18.2 GBRTX 3090 / 4090 24GB
NVFP415.4 GB18.2 GBRTX 3090 / 4090 24GB
Q4_K_M (GGUF)recommended17.8 GB20.5 GBRTX 3090 / 4090 24GB
Q3_K_M (GGUF)13.7 GB16.5 GBRTX 3090 / 4090 24GB
Q2_K (GGUF)10.2 GB13.0 GBRTX 4060 Ti 16GB

How context length changes memory (Q4_K_M (GGUF))

ContextKV cacheTotal needed
4K0.3 GB19.6 GB
16K1.3 GB20.5 GB
64K5.0 GB24.3 GB
128K10.0 GB29.3 GB
256K20.0 GB39.3 GB

KV cache grows linearly with context; FP8 KV cache halves it again (try it in the calculator below).

Customize the estimate

Back

LLM VRAM Calculator — Can I Run It?

Estimate how much GPU memory (VRAM) you need to run open-weight LLMs like Kimi K3, DeepSeek R1, Qwen3, or Llama locally. Pick a model, quantization, and context length — the calculator adds up weights, KV cache, and runtime overhead, then shows which GPUs or Macs can fit it. Runs entirely in your browser: no upload, no signup.

31.3B total params · max 256K context · specs partially estimated

Recommended balance · ~0.61 bytes/param

Estimated memory needed

29.3 GB

Model weights17.8 GB
KV cache (131,072 tokens)10.0 GB
Runtime overhead1.5 GB

Architecture details for this model are estimated — treat results as a ballpark.

Will it fit?

RTX 3060 12GB3× needed
RTX 4060 Ti 16GB2× needed
RTX 3090 / 4090 24GB2× needed
RTX 5090 32GB✓ fits
A100 40GB✓ fits
A100 / H100 80GB✓ fits
H200 141GB✓ fits
AMD MI300X 192GB✓ fits
B200 192GB✓ fits
Mac 24GB unified✗ too big
Mac 36GB unified✓ fits
Mac 64GB unified✓ fits
Mac 128GB unified✓ fits
Mac M3 Ultra 512GB✓ fits

Assumes ~92% of device memory is usable. Multi-GPU counts are for tensor/pipeline parallel serving (vLLM, SGLang); Apple Silicon uses unified memory via llama.cpp or MLX.

FAQ

How much VRAM does Gemma 4 31B need?

About 20.5 GB at the recommended Q4_K_M (GGUF) quantization with 16K context: 17.8 GB for weights, 1.3 GB for KV cache, plus runtime overhead. Longer context grows the KV cache.

What is the minimum hardware for Gemma 4 31B?

Roughly RTX 3090 / 4090 24GB, assuming 92% of device memory is usable. Lower-end setups can try more aggressive quantization (Q3/Q2) at a noticeable quality cost.

Can I run Gemma 4 31B on a Mac?

Yes. At Q4_K_M (GGUF) with 16K context it needs about 20.5 GB, so a Mac 24GB unified or larger fits it via llama.cpp or MLX. Note macOS only lets the GPU wire roughly 2/3-3/4 of RAM by default; near the limit, raise iogpu.wired_limit_mb or use a smaller quant.

Which quantization should I use for Gemma 4 31B?

Q4_K_M is the recommended balance of size and quality; with headroom, Q6_K or Q8_0 reduce quality loss further.

VRAM requirements for other models