Gemma 3 · Gemma · HF: google/gemma-3-12b-it
Gemma 3 12B IT — VRAM, KV Cache & Hardware Matrix
Serverless API Rate
$0.05 in / $0.15 out per 1M
Parameters
12.2B Dense
Attention
GQA (8 KV / 16 Q)
Layers × Hidden
48 × 3840
Max Native Context
128k tokens
MoE Experts
N/A (Dense)
Quantization Memory Footprint
| Quantization | BPW | Weights Only | Total @ 8k Ctx | Total @ 32k Ctx | Quality |
|---|---|---|---|---|---|
| FP16 | 16.00 | 23.18 GiB | 25.27 GiB | 26.77 GiB | Lossless Reference |
| Q8_0 | 8.50 | 12.31 GiB | 14.40 GiB | 15.90 GiB | Near-Lossless |
| Q6_K | 6.57 | 9.52 GiB | 11.61 GiB | 13.11 GiB | High Precision |
| Q5_K_M | 5.69 | 8.24 GiB | 10.33 GiB | 11.83 GiB | Balanced High |
| Q4_K_M | 4.85 | 7.03 GiB | 9.12 GiB | 10.62 GiB | Recommended 4-bit |
| MLX_4BIT | 4.50 | 6.52 GiB | 8.61 GiB | 10.11 GiB | Apple Silicon Optimized |
| IQ4_XS | 4.25 | 6.16 GiB | 8.25 GiB | 9.75 GiB | Compact 4-bit |
| Q3_K_M | 3.91 | 5.66 GiB | 7.75 GiB | 9.25 GiB | Aggressive Compression |
Hardware Compatibility & Speed Leaderboard (Q4_K_M @ 32k Context)
| Hardware | Status | Total / Limit | Decode | TTFT (4k) | Max Safe Ctx | Inspect |
|---|---|---|---|---|---|---|
| Cloud NVIDIA H200 SXM (141 GB) | COMFORTABLE | 10.6 / 140.4 GiB | 402.1 tok/s | 0.18s | 128k | Simulate → |
| Cloud NVIDIA H100 SXM (80 GB) | COMFORTABLE | 10.6 / 79.4 GiB | 280.6 tok/s | 0.18s | 128k | Simulate → |
| Cloud NVIDIA A100 SXM (80 GB) | COMFORTABLE | 10.6 / 79.4 GiB | 166.7 tok/s | 0.54s | 128k | Simulate → |
| NVIDIA RTX PRO 6000 Blackwell (96 GB) | COMFORTABLE | 10.6 / 95.0 GiB | 150.1 tok/s | 0.66s | 128k | Simulate → |
| NVIDIA RTX 5090 (32 GB) | COMFORTABLE | 10.6 / 31.0 GiB | 146.6 tok/s | 0.82s | 128k | Simulate → |
| NVIDIA RTX 4090 (24 GB) | COMFORTABLE | 10.6 / 23.0 GiB | 82.4 tok/s | 1.03s | 128k | Simulate → |
| NVIDIA RTX 5080 (16 GB) | COMFORTABLE | 10.6 / 15.0 GiB | 78.5 tok/s | 1.51s | 102k | Simulate → |
| NVIDIA RTX 3090 (24 GB Used) | COMFORTABLE | 10.6 / 23.0 GiB | 74.7 tok/s | 2.46s | 128k | Simulate → |
| NVIDIA RTX 5070 Ti (16 GB) | COMFORTABLE | 10.6 / 15.0 GiB | 73.3 tok/s | 1.93s | 102k | Simulate → |
| AMD Radeon RX 7900 XTX (24 GB) | COMFORTABLE | 10.6 / 23.0 GiB | 72.8 tok/s | 1.70s | 128k | Simulate → |
| Cloud NVIDIA L40S (48 GB) | COMFORTABLE | 10.6 / 47.4 GiB | 70.7 tok/s | 0.48s | 128k | Simulate → |
| Apple Mac Studio M3 Ultra (256 GB) | COMFORTABLE | 10.4 / 199.7 GiB | 63.7 tok/s | 3.20s | 128k | Simulate → |
| Apple Mac Studio M3 Ultra (512 GB) | COMFORTABLE | 10.4 / 399.4 GiB | 63.7 tok/s | 3.20s | 128k | Simulate → |
| 2x NVIDIA RTX 3090 Rig (48 GB) | COMFORTABLE | 10.6 / 46.6 GiB | 62.7 tok/s | 3.01s | 128k | Simulate → |
| Apple Mac Studio M2 Ultra (192 GB) | COMFORTABLE | 10.4 / 149.8 GiB | 62.2 tok/s | 3.53s | 128k | Simulate → |
| Apple Mac Studio M4 Max (64 GB) | COMFORTABLE | 10.4 / 49.9 GiB | 41.9 tok/s | 4.86s | 128k | Simulate → |
| Apple Mac Studio M4 Max (128 GB) | COMFORTABLE | 10.4 / 99.8 GiB | 41.9 tok/s | 4.86s | 128k | Simulate → |
| NVIDIA RTX 5060 Ti (16 GB) | COMFORTABLE | 10.6 / 15.0 GiB | 35.7 tok/s | 3.66s | 102k | Simulate → |
| Apple MacBook Pro M3 Max (64 GB) | COMFORTABLE | 10.4 / 49.9 GiB | 30.3 tok/s | 6.50s | 128k | Simulate → |
| Apple MacBook Pro M3 Max (128 GB) | COMFORTABLE | 10.4 / 99.8 GiB | 30.3 tok/s | 6.50s | 128k | Simulate → |
| Apple Mac Mini M4 Pro (48 GB) | COMFORTABLE | 10.4 / 37.4 GiB | 20.1 tok/s | 10.02s | 128k | Simulate → |
| Apple Mac Mini M4 Pro (64 GB) | COMFORTABLE | 10.4 / 49.9 GiB | 20.1 tok/s | 10.02s | 128k | Simulate → |
| Ryzen AI Max+ 395 Strix Halo (128 GB) | COMFORTABLE | 10.4 / 96.0 GiB | 18.9 tok/s | 3.62s | 128k | Simulate → |
| Ryzen AI Max+ 395 Strix Halo (64 GB) | COMFORTABLE | 10.4 / 48.0 GiB | 18.9 tok/s | 3.62s | 128k | Simulate → |
| Apple Mac Mini M4 (24 GB) | COMFORTABLE | 10.4 / 18.0 GiB | 8.6 tok/s | 22.16s | 128k | Simulate → |
| Ryzen AI 9 HX 370 Mini-PC (64 GB) | COMFORTABLE | 10.4 / 48.0 GiB | 8.4 tok/s | 10.33s | 128k | Simulate → |
| NVIDIA RTX 3060 (12 GB) | TIGHT | 10.6 / 11.0 GiB | 28.0 tok/s | 7.00s | 38k | Simulate → |
| Apple Mac Mini M4 (16 GB) | TUNABLE_UMA | 10.4 / 10.0 GiB | 8.6 tok/s | 22.16s | 49k | Simulate → |
Interactive Gemma 3 12B IT Simulator
12.2B Dense · GQA
1792 GB/s · 250 TFLOPS
3. Weight Quantization
4.85 bpw
4. KV Cache
32,768 tok
Compute Roofline
COMFORTABLE FIT Memory-Bandwidth Bound
Max Safe Ctx: 128k
Memory Allocation Footprint 10.62 / 95.00 GiB usable
Weights: 7.03 GiB
KV Cache: 2.31 GiB
Overhead: 1.28 GiB
Headroom: 84.38 GiB
Decode Speed
150.1
tok/s (batch=1)
Prefill Speed
6536
prompt tok/s
TTFT Latency
0.66s
for 4,096 tok
Active Params
12.2B
of 12.2B total
llama.cpp Server Command
llama-server -hf google/gemma-3-12b-it:Q4_K_M -ngl 99 -fa on -c 32768 --port 8080 | Context | KV Cache | Total VRAM | Decode | Status |
|---|---|---|---|---|
| 4k | 0.56 GiB | 8.60 GiB | 184.7 tok/s | COMFORTABLE |
| 8k | 0.81 GiB | 9.12 GiB | 178.8 tok/s | COMFORTABLE |
| 16k | 1.31 GiB | 9.62 GiB | 168.1 tok/s | COMFORTABLE |
| 32k | 2.31 GiB | 10.62 GiB | 150.1 tok/s | COMFORTABLE |
| 64k | 4.31 GiB | 12.62 GiB | 123.6 tok/s | COMFORTABLE |
| 128k | 8.31 GiB | 16.62 GiB | 91.4 tok/s | COMFORTABLE |
Buy-vs-Cloud-vs-API Monthly TCO Break-Even
USE SERVERLESS APIOwn Hardware/mo
$162.35
29.9h active + power
Cloud GPU/mo
$63.57
@$1.85/hr spot/pod
Serverless API/mo
$4.75
API cheaper
Recommended Hardware & Cloud Deployment
Contextual to fit statusEngineering FAQ — Gemma 3 12B IT
How much VRAM does Gemma 3 12B IT require in Q4_K_M?
Gemma 3 12B IT weights occupy 7.03 GiB in Q4_K_M. Including 32k FP16 KV cache and runtime buffers, total memory is 10.62 GiB.
What is the cheapest local hardware that runs Gemma 3 12B IT?
NVIDIA RTX PRO 6000 Blackwell (96 GB) (96 GB) runs Gemma 3 12B IT Q4_K_M at ~150.1 tok/s decode and 0.66s TTFT.
How does Gemma 3 12B IT scale KV cache at long context?
Gemma 3 12B IT uses hybrid sliding-window attention (1024 tokens) across most layers, keeping 32k-128k KV memory compact.