Lab Reference · NVIDIA GeForce RTX 4070 SUPER with 12 GB
Local LLMs on 12 GB of VRAM: what fits and how fast
Which local LLMs fit on a 12 GB card, and how fast do they run? We measured Qwen3 1.7B Q4_K_M, Gemma 4 12B Q4_0 and Qwen3 14B Q4_K_M with the KV cache in f16, q8_0 and q4_0, from an empty context to 32,768 tokens, every layer on the GPU, all with llama.cpp b12723 in one run.
- Last run Nov 25, 2026
- llama.cpp b12723
- Card NVIDIA GeForce RTX 4070 SUPER with 12 GB
- Matrix 3 models × 3 KV cache types
- Self-test 0.2% largest difference
In short
- Qwen3 1.7B Q4_K_M fits 32,768 tokens of context with every KV cache type we tried (f16, q8_0, q4_0), at most 4.9 GB.
- Gemma 4 12B Q4_0 fits 32,768 tokens of context with every KV cache type we tried (f16, q8_0, q4_0), at most 8.2 GB.
- Qwen3 14B Q4_K_M fits 16,384 tokens of context with a KV cache in f16 (10.9 GB); 32,768 tokens fit with q8_0 (11.0 GB) or q4_0 (9.7 GB).
- Writing with 16,384 tokens already in the context against none (KV cache f16): Qwen3 1.7B −54.7%, Gemma 4 12B −7.9%, Qwen3 14B −20.6%.
- Against f16, a KV cache in q8_0 changed prompt reading by −9.0% to −0.9% and writing by −7.3% to +40.9% (the most: Qwen3 1.7B at 32,768 tokens, +40.9%).
- Against f16, a KV cache in q4_0 changed prompt reading by −6.0% to 0.0% and writing by −5.5% to +61.6% (the most: Qwen3 1.7B at 32,768 tokens, +61.6%).
What fits in 12 GB
A setting fits when what llama.cpp allocates on the card (weights, KV cache, compute buffer) stays within 11.24 GB: the card's 11.99 GB less 0.75 GB that the CUDA runtime and the Windows desktop keep. Past the card's memory, Windows moves the rest into system memory and generation crawls, so we stop such a test and count it as not fitting. Each bar shows the card's memory at the longest context that fits.
Qwen3 1.7B Q4_K_M 1.2 GB file
32K tokens with every KV cache type
- KV f1632,768 tokens · 4.9 GB
- KV q8_032,768 tokens · 3.2 GB
- KV q4_032,768 tokens · 2.4 GB
Gemma 4 12B Q4_0 6.7 GB file
32K tokens with every KV cache type
- KV f1632,768 tokens · 8.2 GB
- KV q8_032,768 tokens · 7.8 GB
- KV q4_032,768 tokens · 7.5 GB
Qwen3 14B Q4_K_M 8.4 GB file
32K with q8_0 or q4_0 · 16K with f16
- KV f1616,384 tokens · 10.9 GB
- KV q8_032,768 tokens · 11.0 GB
- KV q4_032,768 tokens · 9.7 GB
Memory grows with the context
What llama.cpp allocated to write 128 tokens with this many tokens already in the context, in GB of 1,024 MiB; a hollow mark is a test that did not fit, at what it asked for. One scale for all three charts.
- KV cache f16
- KV cache q8_0
- KV cache q4_0
- 11.24 GB limit
Speed
Writing slows as the context fills
Tokens per second to write 128 tokens with the context empty or already holding 4K, 16K or 32K tokens. Each chart has its own scale; a cross marks a test that does not fit.
- KV cache f16
- KV cache q8_0
- KV cache q4_0
Reading a prompt
Tokens per second to process the prompt, every model and KV cache type on one scale.
Qwen3 1.7B Q4_K_M
Gemma 4 12B Q4_0
Qwen3 14B Q4_K_M
Qwen3 1.7B Q4_K_M
Gemma 4 12B Q4_0
Qwen3 14B Q4_K_M
All the numbers
Each number is the median of 2 rounds, each the mean of llama-bench's repetitions; ± is the spread between the rounds. A dash: the test does not fit.
The longest context that fits 3 × 3
| Model | KV cache f16 | KV cache q8_0 | KV cache q4_0 |
|---|---|---|---|
| Qwen3 1.7B Q4_K_M 1.2 GB file | 32,768 tokens 4.9 GB | 32,768 tokens 3.2 GB | 32,768 tokens 2.4 GB |
| Gemma 4 12B Q4_0 6.7 GB file | 32,768 tokens 8.2 GB | 32,768 tokens 7.8 GB | 32,768 tokens 7.5 GB |
| Qwen3 14B Q4_K_M 8.4 GB file | 16,384 tokens 10.9 GB | 32,768 tokens 11.0 GB | 32,768 tokens 9.7 GB |
Memory on the card by context 9 settings × 3 contexts
| Model and KV cache | 4,096 tokens | 16,384 tokens | 32,768 tokens |
|---|---|---|---|
| Qwen3 1.7B Q4_K_M KV cache f16 | 1.8 GB fits | 3.1 GB fits | 4.9 GB fits |
| Qwen3 1.7B Q4_K_M KV cache q8_0 | 1.6 GB fits | 2.3 GB fits | 3.2 GB fits |
| Qwen3 1.7B Q4_K_M KV cache q4_0 | 1.5 GB fits | 1.8 GB fits | 2.4 GB fits |
| Gemma 4 12B Q4_0 KV cache f16 | 7.8 GB fits | 8.0 GB fits | 8.2 GB fits |
| Gemma 4 12B Q4_0 KV cache q8_0 | 7.5 GB fits | 7.6 GB fits | 7.8 GB fits |
| Gemma 4 12B Q4_0 KV cache q4_0 | 7.4 GB fits | 7.5 GB fits | 7.5 GB fits |
| Qwen3 14B Q4_K_M KV cache f16 | 9.0 GB fits | 10.9 GB fits | 13.4 GB does not fit |
| Qwen3 14B Q4_K_M KV cache q8_0 | 8.7 GB fits | 9.7 GB fits | 11.0 GB fits |
| Qwen3 14B Q4_K_M KV cache q4_0 | 8.5 GB fits | 9.0 GB fits | 9.7 GB fits |
Speed in tokens per second 9 settings × 6 tests
| Model and KV cache | Read 512 | Read 4,096 | Write | Write at 4k | Write at 16k | Write at 32k |
|---|---|---|---|---|---|---|
| Qwen3 1.7B Q4_K_M KV cache f16 | 19,438 ±0.5% | 20,149 ±0.2% | 293 ±0.2% | 226 ±0.2% | 133 ±0.0% | 87.3 ±0.1% |
| Qwen3 1.7B Q4_K_M KV cache q8_0 | 17,699 ±1.0% | 18,338 ±0.9% | 277 ±0.8% | 237 ±0.2% | 168 ±0.5% | 123 ±0.1% |
| Qwen3 1.7B Q4_K_M KV cache q4_0 | 18,523 ±0.1% | 18,945 ±0.2% | 277 ±0.4% | 242 ±0.6% | 183 ±0.4% | 141 ±0.1% |
| Gemma 4 12B Q4_0 KV cache f16 | 3,875 ±0.1% | 3,764 ±0.1% | 56.9 ±0.1% | 53.6 ±0.0% | 52.4 ±0.2% | 50.8 ±0.1% |
| Gemma 4 12B Q4_0 KV cache q8_0 | 3,734 ±0.3% | 3,600 ±0.2% | 55.4 ±0.1% | 53.0 ±0.0% | 51.0 ±0.2% | 47.1 ±0.1% |
| Gemma 4 12B Q4_0 KV cache q4_0 | 3,795 ±0.3% | 3,662 ±0.1% | 55.4 ±0.2% | 53.6 ±0.2% | 51.3 ±0.1% | 48.0 ±0.1% |
| Qwen3 14B Q4_K_M KV cache f16 | 1,757 ±0.2% | 2,952 ±0.1% | 47.9 ±0.1% | 46.5 ±0.1% | 38.0 ±0.1% | — |
| Qwen3 14B Q4_K_M KV cache q8_0 | 1,742 ±0.3% | 2,902 ±0.0% | 47.4 ±0.0% | 45.7 ±0.1% | 37.6 ±0.0% | 31.6 ±0.1% |
| Qwen3 14B Q4_K_M KV cache q4_0 | 1,757 ±0.2% | 2,919 ±0.1% | 47.4 ±0.0% | 45.6 ±0.1% | 38.0 ±0.2% | 30.9 ±0.0% |
How we tested
- ProcessorAMD Ryzen 7 7800X3D (8 cores, 16 threads)
- Graphics cardNVIDIA GeForce RTX 4070 SUPER (driver 621.01)
- Memory32 GB RAM
- SystemWindows 11 Pro, Docker Desktop (WSL 2)
- ContainersDocker Engine 29.9.3
Build
- llama.cpp b12723
ghcr.io/ggml-org/llama.cpp:full-cuda-b12723sha256:1c72cbe908cb…
Self-test Qwen3 14B Q4_K_M, KV cache q8_0, twice a round in separate containers: the largest difference over 6 tests was 0.2%, none of them clear.
Method
- llama-bench from llama.cpp b12723 in its official CUDA image, every layer on the GPU (-ngl 99), flash attention on, 3 repetitions a test; each repetition of a writing test fills a context of its own
- Median of 2 rounds; the setting that starts each round rotates, and every call loads the model again in a fresh container
- What fits: llama-bench -v reports what llama.cpp allocates on the card for each test (weights, KV cache, compute buffer). A test that asks for more than 11.24 GB, the card's 11.99 GB less 0.75 GB for the CUDA runtime and the Windows desktop, is stopped there and does not fit: past the card's memory the Windows driver moves the rest into system memory, and the test crawls
- GB of 1,024 MiB, as nvidia-smi and Windows count them; Hugging Face lists the files in GB of 1,000 MB
- Models: GGUF files from ggml-org on Hugging Face (Apache-2.0), read-only from the PC
- The card ran its cores at 2,700 MHz under load, the median of 318 readings with it busy; a card at other clocks is faster or slower
Before the tests the Windows desktop held 0.4–0.7 GB of the card; the driver moves some of it out when a test needs the room.
Reproduce it
docker run --rm --gpus all -v ./models:/models:ro --entrypoint /app/llama-bench ghcr.io/ggml-org/llama.cpp:full-cuda-b12723 -m /models/Qwen3-14B-Q4_K_M.gguf -ngl 99 -fa 1 -ctk q8_0 -ctv q8_0 -r 3 -p 512,4096 -n 0 -v
Writing: the same with -p 0 -n 128 -r 1 -d 0,0,0,4096,4096,4096,16384,16384,16384,32768,32768,32768 (each repetition in a context of its own); -v prints the buffer sizes
Other settings: -ctk and -ctv f16, q8_0 or q4_0; other models: their file after -m
Model Qwen3 1.7B Q4_K_M: https://huggingface.co/ggml-org/Qwen3-1.7B-GGUF (Qwen3-1.7B-Q4_K_M.gguf)
Model Gemma 4 12B Q4_0: https://huggingface.co/ggml-org/gemma-4-12B-it-GGUF (gemma-4-12B-it-Q4_0.gguf)
Model Qwen3 14B Q4_K_M: https://huggingface.co/ggml-org/Qwen3-14B-GGUF (Qwen3-14B-Q4_K_M.gguf)Limits
- One card: an NVIDIA GeForce RTX 4070 SUPER with 12 GB under Windows 11 and WSL 2, with the Windows desktop on it; a card without a desktop (a Linux server) has more of its memory free, and another driver or system may behave differently.
- llama-bench's synthetic prompts with its default batch sizes (2,048 tokens, micro-batches of 512): a chat server with other batch sizes, several conversations at once or an image encoder needs more memory.
- One quantization of each model: a larger one needs more memory, a smaller one less, and may answer worse.
Raw data (JSON) · How we test · Every llama.cpp build we measured
More on llama.cpp
Official pages
- github.com /ggml-org/llama.cpp/releases/tag/b12723
- huggingface.co /ggml-org/Qwen3-1.7B-GGUF
- huggingface.co /ggml-org/gemma-4-12B-it-GGUF
- huggingface.co /ggml-org/Qwen3-14B-GGUF