Gemma 4 12B VRAM requirements

Gemma 4 12B has 12.0B parameters. With an 8K-token context and one request it needs about 8.33 GB of GPU memory at Q4_K_M, 13.2 GB at FP8 and 25.4 GB at FP16/BF16. The published weights take 22.3 GB (BF16). On one 24 GB RTX 3090 / 4090 it runs at Q4_K_M with its full 256K-token context.

Open Gemma 4 12B in the calculator

VRAM by quantization

Weights plus the KV cache for 8,192 tokens in FP16 and the runtime overhead (0.5 GB plus 10%). Each row opens the calculator with that setting. What the GGUF names mean.

PrecisionWeightsTotalSmallest setup
As published (BF16) 22.3 GB 25.4 GB RTX 5090
FP16 / BF16 22.3 GB 25.4 GB RTX 5090
FP8 / INT8 11.1 GB 13.2 GB RTX 4060 Ti 16GB
INT4 (AWQ / GPTQ) 5.92 GB 7.42 GB RTX 3060
GGUF Q8_0 11.8 GB 13.9 GB RTX 4060 Ti 16GB
GGUF Q6_K 9.13 GB 11.0 GB RTX 3060
GGUF Q5_K_M 7.89 GB 9.60 GB RTX 3060
GGUF Q4_K_M 6.74 GB 8.33 GB RTX 3060
GGUF Q3_K_M 5.44 GB 6.90 GB RTX 3060
GGUF Q2_K 4.66 GB 6.04 GB RTX 3060

KV cache at long context

8 of its 48 layers use full attention and 40 keep a sliding window of 1,024 tokens. Each extra token of context adds 8 KB of FP16 cache per request once the sliding windows are full. How the KV cache works.

ContextKV cache, FP16KV cache, FP8Total at Q4_K_M
4K tokens 352 MB 176 MB 8.29 GB
32K tokens 576 MB 288 MB 8.53 GB
128K tokens 1.31 GB 672 MB 9.36 GB
256K tokens 2.31 GB 1.16 GB 10.5 GB

Which GPUs can run Gemma 4 12B

With 8,192 tokens of context. Several GPUs means one tensor-parallel group of 2, 4 or 8 cards.

GPUMemoryQ4_K_MFP8
RTX 3060 12 GB Fits on one Needs 2
RTX 4060 Ti 16GB 16 GB Fits on one Fits on one
RTX 3090 / 4090 24 GB Fits on one Fits on one
RTX 5090 32 GB Fits on one Fits on one
A100 40GB 40 GB Fits on one Fits on one
Mac, 64 GB unified memory about 75% of it is usable by the GPU by default 48 GB Fits on one Fits on one
L40S / RTX 6000 Ada 48 GB Fits on one Fits on one
A100 / H100 80GB 80 GB Fits on one Fits on one
Mac, 128 GB unified memory about 75% of it is usable by the GPU by default 96 GB Fits on one Fits on one
H200 141 GB Fits on one Fits on one
B200 180 GB Fits on one Fits on one

How fast Gemma 4 12B writes

Tokens per second for one request with 8,192 tokens of context, estimated from memory bandwidth. A dash means it does not fit on one card. Try other settings in the speed calculator.

HardwareBandwidthQ4_K_MFP8
RTX 3060 12GB 360 GB/s 25–35 —
RTX 4090 1,008 GB/s 65–94 42–59
RTX 5090 1,792 GB/s 108–162 71–103
M4 Max Mac (128 GB) 546 GB/s 37–52 23–33
M3 Ultra Mac Studio (512 GB) 819 GB/s 54–77 35–48
H100 SXM 3,350 GB/s 177–282 122–184
H200 4,800 GB/s 228–381 162–254

Longest context on one GPU

How many tokens of context fit on a single card with one request and an FP16 KV cache. "Full" means the model's whole context window fits.

GPUMemoryQ4_K_MQ8_0FP8
RTX 3060 12 GB 256K (full) No No
RTX 4060 Ti 16GB 16 GB 256K (full) 248K 256K (full)
RTX 3090 / 4090 24 GB 256K (full) 256K (full) 256K (full)
RTX 5090 32 GB 256K (full) 256K (full) 256K (full)
A100 40GB 40 GB 256K (full) 256K (full) 256K (full)
Mac, 64 GB unified memory 48 GB 256K (full) 256K (full) 256K (full)
L40S / RTX 6000 Ada 48 GB 256K (full) 256K (full) 256K (full)
A100 / H100 80GB 80 GB 256K (full) 256K (full) 256K (full)
Mac, 128 GB unified memory 96 GB 256K (full) 256K (full) 256K (full)
H200 141 GB 256K (full) 256K (full) 256K (full)
B200 180 GB 256K (full) 256K (full) 256K (full)

Model details

Parameters
12.0B (11,959,730,224)
Layers
8 of its 48 layers use full attention and 40 keep a sliding window of 1,024 tokens
Attention cache
1 KV heads × 512 (keys double as values)
Sliding-window layers
8 KV heads × 256
Context length
262,144 tokens
Published weights
22.3 GB (BF16)
On Hugging Face
google/gemma-4-12B-it

Other models

Numbers read from the model files on Hugging Face on .