Gemma 3 4B VRAM requirements

한국어

Gemma 3 4B has 4.30B parameters, 34 layers and 4 KV heads. Here is the VRAM it needs by quant and context length.

This is an estimate. Real usage will differ.

Weights and KV cache come from formulas. Runtime overhead is a flat 1 GiB guess. Actual use depends on your runtime and version. If it says tight, load it and check.

Model values checked 2026-11-11

VRAM (GiB) by quant and context length

QuantWeights2,0488,19232,768131,072
FP168.09.310.113.326.0
Q8_04.35.56.39.522.3
Q6_K3.34.65.38.521.3
Q5_K_M2.94.14.98.120.9
Q4_K_M2.53.74.57.720.5
Q3_K_M2.03.34.17.320.0
Q2_K1.62.83.66.819.6

This is an estimate. Real usage depends on your runtime and version.

VRAM calculator

Result

Gemma 3 4B Q4_K_M, 8,192 context: about 4.5 GiB needed.

Fits on the GeForce RTX 4070 (12 GB). About 7.5 GiB to spare.

  • Weights 2.5 GiB
  • KV cache 1.1 GiB
  • Runtime overhead 1.0 GiB (estimate)
  • With this model and quant, the GeForce RTX 4070 holds about 56,576 tokens of context.
  • At this context, the highest quant that fits the GeForce RTX 4070 is FP16.
  • Gemma 3 uses sliding window layers, so the real KV cache can be smaller than this.
  • The parameter count includes the vision encoder. Text-only use needs a bit less.

This is an estimate. Real usage depends on your runtime and version.

GPUs that fit Gemma 3 4B Q4_K_M at 8,192 context

Model values used

Parameters
4,300,079,472
Layers
34
Attention heads
8
KV heads
4
Head dim
256
Max context (config)
131,072
Read from
google/gemma-3-4b-it

The official repo is gated, so the same config file was read from unsloth/gemma-3-4b-it.

Gemma 3 uses sliding window layers, so the real KV cache can be smaller than this.

The parameter count includes the vision encoder. Text-only use needs a bit less.

See this model per GPU