Can I run Gemma 4 12B on the GeForce RTX 4060?
Runs wellQ4_K_M does not fit fully in VRAM, so 0.4 GB of the weights run from system RAM: Runs well, est. 21.9 tok/s (17.6–26.3, calibrated estimate ±20%). UD-Q2_K_XL (heavy quality loss) would reach Runs great, est. 39.7 tok/s (34.9–44.5, calibrated estimate ±12%).
8 GB VRAM · 272.0 GB/s · FP16 15.1 TFLOPS. Assumes 32 GB of DDR5-5600 system RAM, Windows with this GPU driving the display, 8k context and an f16 KV cache. The verdict and quant file above stay the same anywhere from 16 to 128 GB of system RAM.
Every quant of Gemma 4 12B on the GeForce RTX 4060
| Quant | File size | Verdict | Speed | Memory | Runs as | Notes |
|---|---|---|---|---|---|---|
| UD-Q2_K_XL | 4.66 GB | Runs great | est. 39.7 tok/s34.9–44.5calibrated estimate ±12% | 5.9 / 8.0 GB | Full GPU | — |
| IQ4_XS | 6.38 GB | Runs well | est. 29.2 tok/s25.7–32.7calibrated estimate ±12% | 7.7 / 8.0 GB | Full GPU | — |
| Q4_K_Mbaseline | 7.12 GB | Runs well | est. 21.9 tok/s17.6–26.3calibrated estimate ±20% | 8.0 / 8.0 GB + 0.4 GB RAM | Partial offload | — |
| Q8_0 | 12.67 GB | Runs slowly | est. 5.9 tok/s4.7–7.0calibrated estimate ±20% | 8.0 / 8.0 GB + 6.0 GB RAM | Partial offload | — |
Models with a thinking mode spend extra tokens thinking, so their speed thresholds are 1.5× stricter (30 / 12 / 3 tok/s). With thinking turned off, a model may do one grade better.
Where the memory goes at Q4_K_M
- Weights
- 6.7 GB
- KV cache
- 0.1 GB
- Compute buffer
- 0.6 GB
- OS reserve
- 0.6 GB
- Weights in system RAM
- 0.4 GB
Context length vs. KV cache
| Context | KV f16 | KV q8_0 | KV q4_0 |
|---|---|---|---|
| 4k | 7.7 GBRuns well est. 23.1 tok/s18.5–27.7calibrated estimate ±20% | 7.7 GBRuns well est. 23.5 tok/s18.8–28.2calibrated estimate ±20% | 7.7 GBRuns well est. 23.7 tok/s18.9–28.4calibrated estimate ±20% |
| 8k | 7.8 GBRuns well est. 21.9 tok/s17.6–26.3calibrated estimate ±20% | 7.7 GBRuns well est. 22.7 tok/s18.1–27.2calibrated estimate ±20% | 7.7 GBRuns well est. 23.1 tok/s18.5–27.7calibrated estimate ±20% |
| 16k | 8.0 GBRuns well est. 20.0 tok/s16.0–23.9calibrated estimate ±20% | 7.9 GBRuns well est. 21.2 tok/s17.0–25.5calibrated estimate ±20% | 7.8 GBRuns well est. 22.0 tok/s17.6–26.4calibrated estimate ±20% |
| 32k | 8.4 GBRuns slowly est. 16.8 tok/s13.4–20.1calibrated estimate ±20% | 8.2 GBRuns slowly est. 18.8 tok/s15.0–22.5calibrated estimate ±20% | 8.1 GBRuns well est. 20.0 tok/s16.0–24.0calibrated estimate ±20% |
| 64k | 9.3 GBRuns slowly est. 12.5 tok/s10.0–15.0calibrated estimate ±20% | 8.8 GBRuns slowly est. 15.1 tok/s12.1–18.1calibrated estimate ±20% | 8.5 GBRuns slowly est. 16.9 tok/s13.5–20.3calibrated estimate ±20% |
| 128k | 10.9 GBRuns slowly est. 7.8 tok/s6.3–9.4calibrated estimate ±20% | 9.9 GBRuns slowly est. 10.6 tok/s8.5–12.7calibrated estimate ±20% | 9.4 GBRuns slowly est. 12.8 tok/s10.2–15.3calibrated estimate ±20% |
| 256k | 14.3 GBRuns slowly est. 4.0 tok/s3.2–4.8calibrated estimate ±20% | 12.3 GBRuns slowly est. 6.2 tok/s5.0–7.5calibrated estimate ±20% | 11.2 GBRuns slowly est. 8.3 tok/s6.6–9.9calibrated estimate ±20% |
S = Runs great · A = Runs well · B = Runs slowly · F = Won't run
At Q4_K_M the verdict stays Runs well up to 16k context with an f16 KV cache, and up to 16k with q8_0.
Estimated speed
- Generation
- est. 21.9 tok/s (17.6–26.3, calibrated estimate ±20%)
- Prompt processing
- Prompt-processing estimates only apply when the whole model runs on the GPU.
Measured on this exact combination
No public measurement for this exact combination yet; the numbers above are estimates.
If this is not enough
A larger model that also runs well on the GeForce RTX 4060
Runs wellQwen3.5 35B-A3B: Runs well, est. 39.3 tok/s (27.5–51.1, theoretical estimate ±30%)
A lower quant of Gemma 4 12B
Runs greatUD-Q2_K_XL (4.66 GB, heavy quality loss): Runs great, est. 39.7 tok/s (34.9–44.5, calibrated estimate ±12%)
Cheapest GPU that runs Gemma 4 12B great
Runs greatGeForce RTX 3060 12GB — $250 street (as of 2026-08-09): est. 34.7 tok/s (30.6–38.9, calibrated estimate ±12%).
How to run it
Commands for the Q4_K_M file. Both tools download from Hugging Face on first run.
File: gemma-4-12b-it-Q4_K_M.gguf (7.12 GB) from unsloth/gemma-4-12b-it-GGUF.
llama-server -hf unsloth/gemma-4-12b-it-GGUF:Q4_K_M -c 8192 -ngl 45 -fa on- -ngl 45 puts 45 of 48 layers on the GPU; if VRAM overflows, lower it by 1–2.
- -fa on enables flash attention (needed for KV cache quantization).
- --cache-type-k q8_0 --cache-type-v q8_0 shrinks the KV cache to 0.07 GB at 8k context.
PowerShell (quit the Ollama tray app first):
$env:OLLAMA_CONTEXT_LENGTH="8192"; ollama serve
ollama run hf.co/unsloth/gemma-4-12b-it-GGUF:Q4_K_M- Ollama defaults to 4k context on GPUs under 24 GB. Set OLLAMA_CONTEXT_LENGTH when starting the server, or /set parameter num_ctx inside the chat.
- Ollama splits layers between GPU and CPU automatically.
/set parameter num_ctx 8192
Related pages
Guide: How much VRAM do local LLMs need? GPU requirements for 8–32 GB (2026)
Other models on the GeForce RTX 4060
Gemma 4 12B on other hardware
Frequently asked questions
Can I run Gemma 4 12B on the GeForce RTX 4060?
Q4_K_M does not fit fully in VRAM, so 0.4 GB of the weights run from system RAM: Runs well, est. 21.9 tok/s (17.6–26.3, calibrated estimate ±20%). UD-Q2_K_XL (heavy quality loss) would reach Runs great, est. 39.7 tok/s (34.9–44.5, calibrated estimate ±12%). Q4_K_M needs 7.8 GB at 8k context; this setup has 7.4 GB of usable memory and 28.0 GB of free system RAM.
How much context can Gemma 4 12B use on the GeForce RTX 4060?
At Q4_K_M the verdict stays Runs well up to 16k context with an f16 KV cache (0.3 GB of KV) and up to 16k with a q8_0 KV cache (0.1 GB). The model supports up to 256k.
Which quant should I use, and how fast is it?
Q4_K_M (7.12 GB) is the recommended balance: Runs well, est. 21.9 tok/s (17.6–26.3, calibrated estimate ±20%). It is also the largest tracked file that gets this verdict.
Speeds are estimates from memory bandwidth, calibrated against public benchmarks, and each one comes with an error band and a confidence label. Real results vary with drivers, backend, context length and thermals.