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

What fits Speed How we tested Raw data (JSON)

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
Qwen3 1.7B Q4_K_M1.2 GB file
11.24 GB limitQwen3 1.7B Q4_K_M, KV cache f16, 4,096 tokens: 1.8 GB, fitsQwen3 1.7B Q4_K_M, KV cache f16, 16,384 tokens: 3.1 GB, fitsQwen3 1.7B Q4_K_M, KV cache f16, 32,768 tokens: 4.9 GB, fitsQwen3 1.7B Q4_K_M, KV cache q8_0, 4,096 tokens: 1.6 GB, fitsQwen3 1.7B Q4_K_M, KV cache q8_0, 16,384 tokens: 2.3 GB, fitsQwen3 1.7B Q4_K_M, KV cache q8_0, 32,768 tokens: 3.2 GB, fitsQwen3 1.7B Q4_K_M, KV cache q4_0, 4,096 tokens: 1.5 GB, fitsQwen3 1.7B Q4_K_M, KV cache q4_0, 16,384 tokens: 1.8 GB, fitsQwen3 1.7B Q4_K_M, KV cache q4_0, 32,768 tokens: 2.4 GB, fits
Gemma 4 12B Q4_06.7 GB file
11.24 GB limitGemma 4 12B Q4_0, KV cache f16, 4,096 tokens: 7.8 GB, fitsGemma 4 12B Q4_0, KV cache f16, 16,384 tokens: 8.0 GB, fitsGemma 4 12B Q4_0, KV cache f16, 32,768 tokens: 8.2 GB, fitsGemma 4 12B Q4_0, KV cache q8_0, 4,096 tokens: 7.5 GB, fitsGemma 4 12B Q4_0, KV cache q8_0, 16,384 tokens: 7.6 GB, fitsGemma 4 12B Q4_0, KV cache q8_0, 32,768 tokens: 7.8 GB, fitsGemma 4 12B Q4_0, KV cache q4_0, 4,096 tokens: 7.4 GB, fitsGemma 4 12B Q4_0, KV cache q4_0, 16,384 tokens: 7.5 GB, fitsGemma 4 12B Q4_0, KV cache q4_0, 32,768 tokens: 7.5 GB, fits
Qwen3 14B Q4_K_M8.4 GB file
11.24 GB limitQwen3 14B Q4_K_M, KV cache f16, 4,096 tokens: 9.0 GB, fitsQwen3 14B Q4_K_M, KV cache f16, 16,384 tokens: 10.9 GB, fitsQwen3 14B Q4_K_M, KV cache f16, 32,768 tokens: 13.4 GB, does not fitQwen3 14B Q4_K_M, KV cache q8_0, 4,096 tokens: 8.7 GB, fitsQwen3 14B Q4_K_M, KV cache q8_0, 16,384 tokens: 9.7 GB, fitsQwen3 14B Q4_K_M, KV cache q8_0, 32,768 tokens: 11.0 GB, fitsQwen3 14B Q4_K_M, KV cache q4_0, 4,096 tokens: 8.5 GB, fitsQwen3 14B Q4_K_M, KV cache q4_0, 16,384 tokens: 9.0 GB, fitsQwen3 14B Q4_K_M, KV cache q4_0, 32,768 tokens: 9.7 GB, fits

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
Qwen3 1.7B Q4_K_Mtokens per second
Qwen3 1.7B Q4_K_M, KV cache f16, writing in an empty context: 293 tokens/s ±0.2%Qwen3 1.7B Q4_K_M, KV cache f16, writing after 4,096 tokens: 226 tokens/s ±0.2%Qwen3 1.7B Q4_K_M, KV cache f16, writing after 16,384 tokens: 133 tokens/s ±0.0%Qwen3 1.7B Q4_K_M, KV cache f16, writing after 32,768 tokens: 87.3 tokens/s ±0.1%Qwen3 1.7B Q4_K_M, KV cache q8_0, writing in an empty context: 277 tokens/s ±0.8%Qwen3 1.7B Q4_K_M, KV cache q8_0, writing after 4,096 tokens: 237 tokens/s ±0.2%Qwen3 1.7B Q4_K_M, KV cache q8_0, writing after 16,384 tokens: 168 tokens/s ±0.5%Qwen3 1.7B Q4_K_M, KV cache q8_0, writing after 32,768 tokens: 123 tokens/s ±0.1%Qwen3 1.7B Q4_K_M, KV cache q4_0, writing in an empty context: 277 tokens/s ±0.4%Qwen3 1.7B Q4_K_M, KV cache q4_0, writing after 4,096 tokens: 242 tokens/s ±0.6%Qwen3 1.7B Q4_K_M, KV cache q4_0, writing after 16,384 tokens: 183 tokens/s ±0.4%Qwen3 1.7B Q4_K_M, KV cache q4_0, writing after 32,768 tokens: 141 tokens/s ±0.1%
Gemma 4 12B Q4_0tokens per second
Gemma 4 12B Q4_0, KV cache f16, writing in an empty context: 56.9 tokens/s ±0.1%Gemma 4 12B Q4_0, KV cache f16, writing after 4,096 tokens: 53.6 tokens/s ±0.0%Gemma 4 12B Q4_0, KV cache f16, writing after 16,384 tokens: 52.4 tokens/s ±0.2%Gemma 4 12B Q4_0, KV cache f16, writing after 32,768 tokens: 50.8 tokens/s ±0.1%Gemma 4 12B Q4_0, KV cache q8_0, writing in an empty context: 55.4 tokens/s ±0.1%Gemma 4 12B Q4_0, KV cache q8_0, writing after 4,096 tokens: 53.0 tokens/s ±0.0%Gemma 4 12B Q4_0, KV cache q8_0, writing after 16,384 tokens: 51.0 tokens/s ±0.2%Gemma 4 12B Q4_0, KV cache q8_0, writing after 32,768 tokens: 47.1 tokens/s ±0.1%Gemma 4 12B Q4_0, KV cache q4_0, writing in an empty context: 55.4 tokens/s ±0.2%Gemma 4 12B Q4_0, KV cache q4_0, writing after 4,096 tokens: 53.6 tokens/s ±0.2%Gemma 4 12B Q4_0, KV cache q4_0, writing after 16,384 tokens: 51.3 tokens/s ±0.1%Gemma 4 12B Q4_0, KV cache q4_0, writing after 32,768 tokens: 48.0 tokens/s ±0.1%
Qwen3 14B Q4_K_Mtokens per second
Qwen3 14B Q4_K_M, KV cache f16, writing in an empty context: 47.9 tokens/s ±0.1%Qwen3 14B Q4_K_M, KV cache f16, writing after 4,096 tokens: 46.5 tokens/s ±0.1%Qwen3 14B Q4_K_M, KV cache f16, writing after 16,384 tokens: 38.0 tokens/s ±0.1%Qwen3 14B Q4_K_M, KV cache f16, writing after 32,768 tokens: does not fitQwen3 14B Q4_K_M, KV cache q8_0, writing in an empty context: 47.4 tokens/s ±0.0%Qwen3 14B Q4_K_M, KV cache q8_0, writing after 4,096 tokens: 45.7 tokens/s ±0.1%Qwen3 14B Q4_K_M, KV cache q8_0, writing after 16,384 tokens: 37.6 tokens/s ±0.0%Qwen3 14B Q4_K_M, KV cache q8_0, writing after 32,768 tokens: 31.6 tokens/s ±0.1%Qwen3 14B Q4_K_M, KV cache q4_0, writing in an empty context: 47.4 tokens/s ±0.0%Qwen3 14B Q4_K_M, KV cache q4_0, writing after 4,096 tokens: 45.6 tokens/s ±0.1%Qwen3 14B Q4_K_M, KV cache q4_0, writing after 16,384 tokens: 38.0 tokens/s ±0.2%Qwen3 14B Q4_K_M, KV cache q4_0, writing after 32,768 tokens: 30.9 tokens/s ±0.0%

Reading a prompt

Tokens per second to process the prompt, every model and KV cache type on one scale.

Read a 512-token prompttokens per second

Qwen3 1.7B Q4_K_M

KV f1619,438 tok/s
KV q8_017,699 tok/s
KV q4_018,523 tok/s

Gemma 4 12B Q4_0

KV f163,875 tok/s
KV q8_03,734 tok/s
KV q4_03,795 tok/s

Qwen3 14B Q4_K_M

KV f161,757 tok/s
KV q8_01,742 tok/s
KV q4_01,757 tok/s
Read a 4,096-token prompttokens per second

Qwen3 1.7B Q4_K_M

KV f1620,149 tok/s
KV q8_018,338 tok/s
KV q4_018,945 tok/s

Gemma 4 12B Q4_0

KV f163,764 tok/s
KV q8_03,600 tok/s
KV q4_03,662 tok/s

Qwen3 14B Q4_K_M

KV f162,952 tok/s
KV q8_02,902 tok/s
KV q4_02,919 tok/s

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
ModelKV cache f16KV cache q8_0KV cache q4_0
Qwen3 1.7B Q4_K_M
1.2 GB file
32,768 tokens 4.9 GB32,768 tokens 3.2 GB32,768 tokens 2.4 GB
Gemma 4 12B Q4_0
6.7 GB file
32,768 tokens 8.2 GB32,768 tokens 7.8 GB32,768 tokens 7.5 GB
Qwen3 14B Q4_K_M
8.4 GB file
16,384 tokens 10.9 GB32,768 tokens 11.0 GB32,768 tokens 9.7 GB
Memory on the card by context 9 settings × 3 contexts
Model and KV cache4,096 tokens16,384 tokens32,768 tokens
Qwen3 1.7B Q4_K_M
KV cache f16
1.8 GB fits3.1 GB fits4.9 GB fits
Qwen3 1.7B Q4_K_M
KV cache q8_0
1.6 GB fits2.3 GB fits3.2 GB fits
Qwen3 1.7B Q4_K_M
KV cache q4_0
1.5 GB fits1.8 GB fits2.4 GB fits
Gemma 4 12B Q4_0
KV cache f16
7.8 GB fits8.0 GB fits8.2 GB fits
Gemma 4 12B Q4_0
KV cache q8_0
7.5 GB fits7.6 GB fits7.8 GB fits
Gemma 4 12B Q4_0
KV cache q4_0
7.4 GB fits7.5 GB fits7.5 GB fits
Qwen3 14B Q4_K_M
KV cache f16
9.0 GB fits10.9 GB fits13.4 GB does not fit
Qwen3 14B Q4_K_M
KV cache q8_0
8.7 GB fits9.7 GB fits11.0 GB fits
Qwen3 14B Q4_K_M
KV cache q4_0
8.5 GB fits9.0 GB fits9.7 GB fits
Speed in tokens per second 9 settings × 6 tests
Model and KV cacheRead 512Read 4,096WriteWrite at 4kWrite at 16kWrite 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-b12723 sha256: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
Commands
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