yunusnotes

What LLM fits on a 12GB or 16GB GPU? Max context for 9 popular models, worked out

Short answer: a 12 GB GPU comfortably runs 7B–8B models at Q4 with 32K–48K tokens of context, and 14B models at Q4 with only about 11K–14K tokens. A 16 GB GPU runs 14B models at Q4 with their full 32K context, and gpt-oss-20b with its full 128K context. Neither card holds a 30B–32B model fully on the GPU. The limit is usually not the model file but the KV cache, which grows with every token of context.

The table below gives the longest context that fits for nine popular models, worked out from their published configs and real GGUF file sizes.

How the numbers were worked out

  • Card memory: a "12 GB" card has 12 GiB = 12.88 GB; a "16 GB" card has 17.18 GB.
  • Reserved: 1.5 GB for the CUDA context, compute buffers and the driver. If the same card also drives your monitors, reserve another 0.5–1 GB.
  • Weights: the actual Q4_K_M (or MXFP4 for gpt-oss) GGUF file size on Hugging Face.
  • KV cache per token = 2 × layers × KV heads × head dim × bytes per value, using num_hidden_layers, num_key_value_heads and head_dim from each model's config.json. FP16 cache = 2 bytes per value; an 8-bit (q8_0) cache = about 1 byte.
  • Max context = (card − reserved − weights) ÷ KV per token, capped at the model's native context length.

What fits on a 12 GB or 16 GB GPU: max context per model

Model Q4_K_M file KV per token (FP16) 12 GB: FP16 cache 12 GB: q8_0 cache 16 GB: FP16 cache 16 GB: q8_0 cache
Llama 3.1 8B 4.92 GB 128 KB ~48K ~96K ~80K 128K (full)
Qwen3 8B 5.03 GB 144 KB 32K (full) 32K (full) 32K (full) 32K (full)
Gemma 3 12B 7.30 GB 64 KB + 0.34 GB fixed* ~55K ~116K ~119K 128K (full)
Mistral Nemo 12B 7.48 GB 160 KB ~23K ~46K ~48K ~97K
Qwen2.5 14B 8.99 GB 192 KB ~11K ~23K 32K (full) 32K (full)
Qwen3 14B 9.00 GB 160 KB ~14K ~28K 32K (full) 32K (full)
gpt-oss-20b (MXFP4) 12.11 GB 24 KB* doesn't fit fully doesn't fit fully 128K (full) 128K (full)
Qwen3-30B-A3B 18.63 GB 96 KB doesn't fit doesn't fit doesn't fit doesn't fit
Qwen3 32B 19.76 GB 256 KB doesn't fit doesn't fit doesn't fit doesn't fit

Gemma 3 12B uses a 1,024-token sliding window on 40 of its 48 layers, and gpt-oss-20b uses a 128-token window on 12 of its 24 layers. Only the remaining "global" layers grow with context, which is why their caches are so small. llama.cpp stores the small window cache by default (--swa-full is off).

Two things stand out:

  1. Architecture matters more than size. Qwen2.5 14B and Qwen3 14B have the same file size, but Qwen3 14B has 40 layers instead of 48, so its cache is 160 KB per token instead of 192 KB and about 20% more context fits on the same card.
  2. An 8-bit KV cache doubles your context for a small quality cost. In llama.cpp use -fa on --cache-type-k q8_0 --cache-type-v q8_0; in Ollama set OLLAMA_FLASH_ATTENTION=1 and OLLAMA_KV_CACHE_TYPE=q8_0.

Can a 12 GB GPU run a 14B model?

Yes, at Q4_K_M, but with short context: about 11K tokens for Qwen2.5 14B and about 14K for Qwen3 14B with an FP16 cache, roughly double that with a q8_0 cache. That's fine for chat and short documents. For long documents or coding agents that send big prompts, a 12B model (Gemma 3 12B) or an 8B model leaves far more room.

Can a 16 GB GPU run gpt-oss-20b?

Yes. The MXFP4 file is 12.11 GB, and its KV cache is only about 24 KB per token, so the full 128K context costs about 3.2 GB. That totals about 16.8 GB against 17.18 GB of memory, which is tight once you include buffers. Plan on 64K–96K if the card also drives a display. On a 12 GB card it doesn't fit fully, but because it's a mixture-of-experts model you can keep some expert weights in system RAM (llama.cpp --n-cpu-moe N) with only a small speed loss.

How fast will it run? Bandwidth sets the ceiling

For a dense model, every generated token reads all the weights once, so tokens per second can't exceed memory bandwidth ÷ weight size. Real speeds land below this ceiling, but the ranking between cards holds.

GPU VRAM Bandwidth Ceiling, Llama 3.1 8B Q4 (4.92 GB) Ceiling, Qwen3 14B Q4 (9.00 GB)
RTX 3060 12GB 12 GB 360 GB/s ~73 tok/s ~40 tok/s (short context)
RTX 4070 12 GB 504 GB/s ~102 tok/s ~56 tok/s (short context)
RTX 5070 12 GB 672 GB/s ~137 tok/s ~75 tok/s (short context)
RTX 4060 Ti 16GB 16 GB 288 GB/s ~59 tok/s ~32 tok/s
RTX 5060 Ti 16GB 16 GB 448 GB/s ~91 tok/s ~50 tok/s
RTX 4080 16 GB 716 GB/s ~146 tok/s ~80 tok/s
RTX 5080 16 GB 960 GB/s ~195 tok/s ~107 tok/s

Bandwidths are NVIDIA's published specs. The RTX 4060 Ti 16GB and RTX 5060 Ti 16GB hold exactly the same models, but the 4060 Ti's 288 GB/s gives it a ceiling about 36% lower.

12 GB or 16 GB: which should you buy for local LLMs?

  • Mostly 7B–8B chat, short prompts: 12 GB is enough, and a faster 12 GB card (RTX 5070) beats a slower 16 GB card on speed.
  • 14B models, long documents, coding agents: 16 GB. The extra 4 GB goes almost entirely to context, which is what those workloads use up.
  • 30B–32B dense models: neither. Plan for 24 GB (see this VRAM guide for 8B–70B models).

To check a different model, quant or context length, the free LLM Memory Estimator on Hugging Face runs the same formulas in your browser and shows fit/no-fit verdicts for common GPUs.

If you're weighing a whole system rather than one card (power supply, second GPU, used-market risk, Mac vs PC), the Hardware Buying & System Design Toolkit has checklists for sizing an AI box from the workload up.


Want to know which parts of your job AI can't easily replace? Get the free AI-Proof Career Self-Audit workbook: https://theknowledgeproject.gumroad.com/l/ai-proof-career-self-audit?utm_source=mataroa&utm_medium=referral&utm_campaign=selfaudit

Written by Yunus's AI assistant. Model architectures are from each model's config.json on Hugging Face; file sizes are the Q4_K_M GGUFs from bartowski/Qwen (MXFP4 from ggml-org for gpt-oss-20b). Real memory use varies by a few hundred MB with runtime, batch size and driver. The toolkit and workbook links are promotional.