Gemma 4 12B

Dense 12B Gemma 4 model without a separate vision encoder, with a 256K context window.

Google·12B params·48 layers / 8 KV heads·Max 256K ctx·Apache 2.0
Local Run Command
Q4_K_M minimum memory: 9.1 GB at 16K context.
Artificial Analysis Benchmarkartificialanalysis.ai ↗
Intelligence Index
—

Independent benchmark scores sourced from Artificial Analysis.

OpenRouter API & Cloud GPU
No live OpenRouter route synced.

VRAM by Quantization (16K context)

Q4_K_M (4-bit)7.5 GB
real file size
0.6 GB9.1 GB8.8 GBBest speed-to-quality balance for local inference (~98% quality)
ollama run gemma4:12b
Q6_K (6-bit)9.3 GB
estimate
0.6 GB11.0 GB10.8 GBNear-lossless quality with ~35% larger footprint than Q4
Q8_0 (8-bit)12.0 GB
real file size
0.6 GB13.8 GB13.5 GBVirtually indistinguishable from FP16 for coding & reasoning
ollama run gemma4:12b-it-q8_0
FP16 / BF16 (16-bit)22.4 GB
real file size
0.6 GB24.7 GB24.4 GBFull native precision; standard for production GPU serving
ollama run gemma4:12b-it-bf16

Layer and head counts are read from the published config.json. KV cache is an approximation for this architecture: global layers use their own KV head layout; 40 sliding-window layers cache only the last 1,024 tokens.

Run Gemma 4 12B with Ollama, LM Studio, llama.cpp, MLX or vLLM

Command
Ollama
Q4_K_M
gemma4:12b
7.5 GB
real file size
LM Studio
Q4_K_M
unsloth/gemma-4-12B-it-GGUF
6.8 GB
real file size
llama.cpp
Q4_K_M
unsloth/gemma-4-12B-it-GGUF
6.8 GB
real file size
MLX
4-bit
mlx-community/gemma-4-12B-it-4bit
6.3 GB
real file size
vLLM
INT4
8.5 GB
estimate
No INT4 build of this model found for vLLM.

Each runtime loads its own build of the model, so download sizes differ. Sizes marked as real are file sizes read from the Ollama registry or Hugging Face.

Hardware Compatibility Matrix (Q4_K_M · 16K context)

Details
11.5 GBFits comfortably6.0–8.1 tok/s—Gemma 4 12B on M1 16GB →
48.0 GBFits comfortably26–36 tok/s—Gemma 4 12B on M1 Max 64GB →
98.0 GBFits comfortably44–60 tok/s—Gemma 4 12B on M1 Ultra 128GB →
18.0 GBFits comfortably9.3–12.6 tok/s—Gemma 4 12B on M2 24GB →
48.0 GBFits comfortably32–43 tok/s—Gemma 4 12B on M2 Max 64GB →
152 GBFits comfortably49–67 tok/s—Gemma 4 12B on M2 Ultra 192GB →
27.0 GBFits comfortably13.5–18.2 tok/s—Gemma 4 12B on M3 Pro 36GB →
48.0 GBFits comfortably32–43 tok/s—Gemma 4 12B on M3 Max 64GB →
98.0 GBFits comfortably32–43 tok/s—Gemma 4 12B on M3 Max 128GB →
11.5 GBFits comfortably10.4–14.0 tok/s—Gemma 4 12B on M4 16GB →
24.0 GBFits comfortably10.4–14.0 tok/s—Gemma 4 12B on M4 32GB →
36.0 GBFits comfortably23–32 tok/s—Gemma 4 12B on M4 Pro 48GB →
48.0 GBFits comfortably23–32 tok/s—Gemma 4 12B on M4 Pro 64GB →
48.0 GBFits comfortably42–57 tok/s—Gemma 4 12B on M4 Max 64GB →
98.0 GBFits comfortably42–57 tok/s—Gemma 4 12B on M4 Max 128GB →
98.0 GBFits comfortably42–57 tok/s—Gemma 4 12B on Studio M4 Max 128GB →
204 GBFits comfortably50–68 tok/s—Gemma 4 12B on M3 Ultra 256GB →
430 GBFits comfortably50–68 tok/s—Gemma 4 12B on M3 Ultra 512GB →
24.0 GBFits comfortably16.9–23 tok/s—Gemma 4 12B on M1 Pro 32GB →
24.0 GBFits comfortably17.4–24 tok/s—Gemma 4 12B on M2 Pro 32GB →
27.0 GBFits comfortably26–36 tok/s—Gemma 4 12B on M3 Max 36GB →
11.5 GBFits comfortably10.4–14.0 tok/s—Gemma 4 12B on Air M4 16GB →
24.0 GBFits comfortably10.4–14.0 tok/s—Gemma 4 12B on Air M4 32GB →
18.0 GBFits comfortably23–32 tok/s—Gemma 4 12B on M4 Pro 24GB →
11.5 GBFits comfortably14.1–19.0 tok/s—Gemma 4 12B on Air M5 16GB →
24.0 GBFits comfortably14.1–19.0 tok/s—Gemma 4 12B on Air M5 32GB →
48.0 GBFits comfortably30–41 tok/s—Gemma 4 12B on M5 Pro 64GB →
98.0 GBFits comfortably55–75 tok/s—Gemma 4 12B on M5 Max 128GB →
24.0 GBFits comfortably16.0–22 tok/s—Gemma 4 12B on mini M6 32GB →
48.0 GBFits comfortably30–41 tok/s—Gemma 4 12B on mini M5 Pro 64GB →
98.0 GBFits comfortably55–75 tok/s—Gemma 4 12B on Studio M5 Max 128GB →
430 GBFits comfortably96–129 tok/s—Gemma 4 12B on Studio M5 Ultra 512GB →
11.2 GBFits comfortably33–44 tok/s1×Gemma 4 12B on RTX 3060 12GB →
9.2 GBTight fit58–78 tok/s1×Gemma 4 12B on RTX 3080 10GB →
22.8 GBFits comfortably69–93 tok/s1×Gemma 4 12B on RTX 3090 24GB →
15.0 GBFits comfortably27–37 tok/s1×Gemma 4 12B on RTX 4060 Ti 16GB →
15.0 GBFits comfortably59–80 tok/s1×Gemma 4 12B on RTX 4070 Ti S 16GB →
15.0 GBFits comfortably67–90 tok/s1×Gemma 4 12B on RTX 4080 S 16GB →
22.8 GBFits comfortably79–107 tok/s1×Gemma 4 12B on RTX 4090 24GB →
15.0 GBFits comfortably80–109 tok/s1×Gemma 4 12B on RTX 5070 Ti 16GB →
15.0 GBFits comfortably83–112 tok/s1×Gemma 4 12B on RTX 5080 16GB →
30.5 GBFits comfortably134–182 tok/s1×Gemma 4 12B on RTX 5090 32GB →
22.8 GBFits comfortably84–114 tok/s1×Gemma 4 12B on RX 7900 XTX 24GB →
15.0 GBFits comfortably54–73 tok/s1×Gemma 4 12B on RX 9070 XT 16GB →
10.2 GBTight fit45–61 tok/s1×Gemma 4 12B on RTX 2080 Ti 11GB →
7.3 GBPartial offload7.3–12.0 tok/s2×Gemma 4 12B on RTX 3060 Ti 8GB →
7.3 GBPartial offload7.3–12.0 tok/s2×Gemma 4 12B on RTX 3070 8GB →
11.2 GBFits comfortably60–81 tok/s1×Gemma 4 12B on RTX 3080 Ti 12GB →
22.8 GBFits comfortably78–106 tok/s1×Gemma 4 12B on RTX 3090 Ti 24GB →
7.3 GBPartial offload4.9–11.4 tok/s2×Gemma 4 12B on RTX 4060 8GB →
7.3 GBPartial offload5.1–11.9 tok/s2×Gemma 4 12B on RTX 4060 Ti 8GB →
11.2 GBFits comfortably41–55 tok/s1×Gemma 4 12B on RTX 4070 12GB →
11.2 GBFits comfortably48–65 tok/s1×Gemma 4 12B on RTX 4070 S 12GB →
11.2 GBFits comfortably47–63 tok/s1×Gemma 4 12B on RTX 4070 Ti 12GB →
15.0 GBFits comfortably63–85 tok/s1×Gemma 4 12B on RTX 4080 16GB →
15.0 GBFits comfortably40–54 tok/s1×Gemma 4 12B on RTX 5060 Ti 16GB →
11.2 GBFits comfortably57–77 tok/s1×Gemma 4 12B on RTX 5070 12GB →
15.0 GBFits comfortably50–68 tok/s1×Gemma 4 12B on RX 7800 XT 16GB →
18.9 GBFits comfortably57–76 tok/s1×Gemma 4 12B on RX 7900 XT 20GB →
15.0 GBFits comfortably54–73 tok/s1×Gemma 4 12B on RX 9070 16GB →
15.0 GBFits comfortably30–41 tok/s1×Gemma 4 12B on RX 9060 XT 16GB →
46.2 GBFits comfortably61–83 tok/s1×Gemma 4 12B on RTX A6000 48GB →
46.2 GBFits comfortably78–105 tok/s1×Gemma 4 12B on RTX 6000 Ada 48GB →
93.0 GBFits comfortably131–177 tok/s1×Gemma 4 12B on PRO 6000 96GB →
15.0 GBFits comfortably37–49 tok/s1×Gemma 4 12B on RTX A4000 16GB →
22.8 GBFits comfortably59–79 tok/s1×Gemma 4 12B on RTX A5000 24GB →
18.9 GBFits comfortably33–45 tok/s1×Gemma 4 12B on RTX 4000 Ada 20GB →
30.5 GBFits comfortably51–69 tok/s1×Gemma 4 12B on RTX 5000 Ada 32GB →
46.2 GBFits comfortably74–123 tok/s1×Gemma 4 12B on PRO 5000 48GB →
46.2 GBFits comfortably58–78 tok/s1×Gemma 4 12B on PRO W7900 48GB →
30.5 GBFits comfortably54–73 tok/s1×Gemma 4 12B on AI PRO R9700 32GB →
22.8 GBFits comfortably26–44 tok/s1×Gemma 4 12B on L4 24GB →
46.2 GBFits comfortably65–88 tok/s1×Gemma 4 12B on L40S 48GB →
38.5 GBFits comfortably79–132 tok/s1×Gemma 4 12B on A100 40GB →
77.5 GBFits comfortably87–118 tok/s1×Gemma 4 12B on A100 80GB →
77.5 GBFits comfortably106–144 tok/s1×Gemma 4 12B on H100 80GB →
137 GBFits comfortably117–196 tok/s1×Gemma 4 12B on H200 141GB →
175 GBFits comfortably129–215 tok/s1×Gemma 4 12B on B200 180GB →
15.0 GBFits comfortably22–30 tok/s1×Gemma 4 12B on T4 16GB →
46.2 GBFits comfortably52–71 tok/s1×Gemma 4 12B on A40 48GB →
46.2 GBFits comfortably69–93 tok/s1×Gemma 4 12B on L40 48GB →
115 GBFits comfortably25–33 tok/s—Gemma 4 12B on DGX Spark 128GB →
96.0 GBFits comfortably22–30 tok/s—Gemma 4 12B on Ryzen AI Max+ 395 128GB →
48.0 GBFits comfortably22–30 tok/s—Gemma 4 12B on Ryzen AI Max+ 395 64GB →

Frequently asked questions

How much VRAM does Gemma 4 12B require?

At Q4_K_M quantization with a 16K context window, Gemma 4 12B needs 9.1 GB total VRAM (7.5 GB weights + 0.6 GB KV cache + runtime overhead). In full FP16 precision, it requires 24.7 GB.

Can an RTX 4090 (24 GB) run Gemma 4 12B?

Yes. At Q4_K_M with 16K context Gemma 4 12B needs 9.1 GB, which fits a single 24 GB RTX 4090 at an estimated 79–107 tok/s.

How do I run Gemma 4 12B locally with Ollama?

Install Ollama and run `ollama run gemma4:12b` in your terminal. Make sure your GPU or Apple Silicon unified memory meets the 9.1 GB Q4_K_M requirement.