TL;DR: Local LLM VRAM now depends more on attention design than on parameter count. On an 8 GB card, Qwen3.5-9B at Q4_K_M holds 55.3K tokens of context, while the smaller Llama 3.1 8B holds 19.9K, because Qwen3.5 caches only 8 of its 32 layers. Gemma 4 12B needs a 12 GB card in practice, and gpt-oss-20b needs 16 GB.
Illustrative scenario: Someone with an RTX 4060 and 8 GB of VRAM downloads a 5.7 GB model file, sees that it is smaller than the card, and expects it to work. It loads, answers a short question, and then fails or slows to a crawl when they paste a long document. The file fit; the conversation did not.
Thesis: The question “which local LLM fits my GPU” has two halves, and most guides answer only the first. Weights decide whether a model loads. The KV cache, the memory a model keeps for every token of context, decides how long a conversation can get, and in 2026 models it varies by a factor of eight between architectures of similar size. A buyer choosing between an 8 GB and a 12 GB card, or between two models, should compare usable context, not file size.
Conventions: card sizes are NVIDIA’s marketing figures, which are binary, so an “8 GB” card holds 8 GiB, or 8.59 GB. File sizes are decimal GB (10^9 bytes) read from Hugging Face on November 26, 2026. “K” for context means 1,024 tokens. The KV cache is computed for llama.cpp with its default 16-bit cache, read from its source code at commit a07831a. We did not run these models; “we computed” means our script.
Local LLM VRAM has two parts: the file and the conversation
A model’s weights are a fixed cost. In GGUF format, the file llama.cpp and its front ends load, the weights in VRAM are close to the file size. Qwen3.5-9B at Q4_K_M is a 5.68 GB file, Llama 3.1 8B at Q4_K_M is 4.92 GB, and Gemma 4 12B in Google’s own quantization-aware (QAT) Q4_0 build is 6.98 GB. Those are exact sizes from the Hugging Face API, not rounded marketing numbers.
The KV cache is the variable cost. For every token in the context window, each attention layer stores a key and a value vector. Bytes per token are 2 × layers × KV heads × head dimension × bytes per element. For Llama 3.1 8B that is 32 layers × 2 × 8 heads × 128 × 2 bytes, or 128.0 KiB per token, which comes to 1.07 GB at 8K tokens and 4.29 GB at 32K.
A third, smaller cost is overhead: the CUDA context, llama.cpp’s compute buffers and, on a desktop PC, whatever the display is using. It varies by driver, runtime and settings, so we treat it as an editorial reserve of 1.0 GB and show how the results move when it changes. On an 8 GB card that leaves 7.59 GB for weights and cache; on 12 GB, 11.88 GB; on 16 GB, 16.18 GB.
| Memory tier | Cards (desktop) | Memory as bytes | Left after a 1.0 GB reserve |
|---|---|---|---|
| 8 GB | RTX 4060, RTX 4060 Ti 8 GB, RTX 5050, RTX 5060, RTX 5060 Ti 8 GB | 8.59 GB | 7.59 GB |
| 12 GB | RTX 4070, RTX 4070 SUPER, RTX 5070 | 12.88 GB | 11.88 GB |
| 16 GB | RTX 4060 Ti 16 GB, RTX 4070 Ti SUPER, RTX 5060 Ti 16 GB, RTX 5070 Ti, RTX 5080 | 17.18 GB | 16.18 GB |
Source: NVIDIA GeForce RTX 40 and 50 Series specification pages, retrieved November 26, 2026; byte conversion and reserve by GPU Insights. Takeaway: the 4060 Ti and 5060 Ti come in two memory sizes, so check which one a listing sells before comparing it with a 12 GB card.
Why Qwen3.5 and Gemma 4 hold far more context per gigabyte
The 2026 model families no longer give every layer a full-length cache. Qwen3.5’s config files list 24 “linear_attention” layers and 8 “full_attention” layers for the 9B model. The linear layers keep a fixed-size state instead of a growing cache. llama.cpp’s source confirms the split: for Qwen3.5 it builds a hybrid memory in which only full-attention layers receive a KV cache.
The result is that Qwen3.5-9B stores 32.0 KiB per token against Llama 3.1 8B’s 128.0 KiB, a 4.0× difference for a model with more parameters. The linear layers add a fixed state that we computed at 52.7 MB, which barely matters on any card.
Gemma 4 takes another route. Its config alternates sliding-window layers, which only look at the last 1024 tokens, with full-attention layers every sixth layer. llama.cpp gives the sliding layers a cache capped at the window plus its default batch of 512 tokens, rounded up to 256 cells. Gemma 4 12B therefore pays a fixed 503.3 MB for its sliding layers and then only 16.0 KiB per token for its 8 global layers.
gpt-oss-20b uses the same idea with a 128-token window on half its layers, so its cache grows at 24.0 KiB per token. One detail surprised us when we read the source: Gemma 4’s global layers have no separate value projection, but llama.cpp still allocates a value cache for them, so the shortcut saves weights, not cache memory.
| Model | Attention design | KV per token | KV at 8K | KV at 32K | Fixed state |
|---|---|---|---|---|---|
| Llama 3.1 8B | 32 full layers | 128.0 KiB | 1.07 GB | 4.29 GB | none |
| Qwen3.5-4B | 8 full + 24 linear | 32.0 KiB | 0.27 GB | 1.07 GB | 52.7 MB |
| Qwen3.5-9B | 8 full + 24 linear | 32.0 KiB | 0.27 GB | 1.07 GB | 52.7 MB |
| Qwen3.5-27B | 16 full + 48 linear | 64.0 KiB | 0.54 GB | 2.15 GB | 156.9 MB |
| Gemma 4 E4B | 4 global + 20 sliding (own KV) | 16.0 KiB | 0.13 GB | 0.54 GB | 41.9 MB |
| Gemma 4 12B | 8 global + 40 sliding | 16.0 KiB | 0.13 GB | 0.54 GB | 503.3 MB |
| Gemma 4 31B | 10 global + 50 sliding | 80.0 KiB | 0.67 GB | 2.68 GB | 1258.3 MB |
| gpt-oss-20b | 12 full + 12 sliding | 24.0 KiB | 0.2 GB | 0.81 GB | 18.9 MB |
Source: config.json files on Hugging Face (Qwen, Google, OpenAI repositories) and llama.cpp source at commit a07831a; derived by GPU Insights (calcs/vram_fit.json). Takeaway: at 32K tokens, Llama 3.1 8B’s cache alone is larger than the whole Qwen3.5-4B Q4_K_M file, so a long-context user should rank models by KV per token first.
What fits on an 8 GB card
With 7.59 GB to spend, the 8 GB tier is decided by weights plus a few gigabytes of cache. Qwen3.5-9B at Q4_K_M leaves room for 56,662 tokens, or 55.3K. Llama 3.1 8B at Q4_K_M, a smaller file, leaves room for 19.9K. Qwen3.5-4B at Q4_K_M reaches 142.9K, and Gemma 4 E4B at Q4_K_M reaches its full 128.0K limit.
Gemma 4 12B is the edge case. Google’s QAT Q4_0 file leaves room for just 6.6K tokens on our 1.0 GB reserve, and the community Q4_K_M build does not fit at all. Raise the reserve by 25% and the QAT build stops fitting too. Treat Gemma 4 12B on an 8 GB card as a short-prompt model, or move it to 12 GB.
Image input changes the 8 GB answer. Qwen3.5-9B’s vision projector is a separate 0.92 GB file, and loading it cuts the model’s room from 55.3K to 28.0K tokens. If you only need text, do not load the projector.
| Model and file | File size | Longest context | Verdict |
|---|---|---|---|
| Qwen3.5-4B Q4_K_M | 2.74 GB | 142.9K | Long documents fit |
| Gemma 4 E4B Q4_K_M | 4.98 GB | 128.0K (model limit) | Fits at full context |
| Qwen3.5-9B Q4_K_M | 5.68 GB | 55.3K | Best large model for this tier |
| Llama 3.1 8B Q4_K_M | 4.92 GB | 19.9K | Fits, short context |
| Gemma 4 12B QAT Q4_0 | 6.98 GB | 6.6K | Marginal |
| Gemma 4 12B Q4_K_M | 7.12 GB | does not fit | Needs 12 GB |
| Qwen3.5-9B Q8_0 | 9.53 GB | does not fit | Needs 12 GB |
| gpt-oss-20b MXFP4 | 12.11 GB | does not fit | Needs 16 GB |
Source: Hugging Face GGUF repositories (unsloth, Google, bartowski, ggml-org), config.json files, llama.cpp a07831a; derived by GPU Insights. Takeaway: on 8 GB, Qwen3.5-9B Q4_K_M is the largest model that still leaves room for a long document.
What 12 GB buys over 8 GB
The local LLM VRAM gain from the 12 GB tier, the RTX 4070 and 5070 class, is 4.29 GB of usable memory, and its main effect is to make the 12B class practical. Gemma 4 12B in Google’s QAT build reaches its full 256.0K context, and the Q4_K_M build 253.9K. Qwen3.5-9B at Q4_K_M rises to 183.3K, and at Q8_0, a near-lossless 8-bit file, it fits with 68.7K tokens.
For older dense models the gain is smaller. Llama 3.1 8B at Q4_K_M goes from 19.9K to 51.9K, and its Q8_0 file fits with 24.9K. The extra 4 GB of VRAM is worth more to a model with a small per-token cache, because each gigabyte buys more tokens.
A 12 GB card still does not hold the next model class. gpt-oss-20b’s MXFP4 file is 12.11 GB, larger than the 11.88 GB a 12 GB card has left after our reserve, and Qwen3.5-27B’s smallest common 4-bit file is 14.98 GB.
What 16 GB buys, and what still does not fit
At 16 GB of local LLM VRAM the 20B class opens up. gpt-oss-20b at MXFP4 fits with its full 128.0K context, and Qwen3.5-9B at Q8_0 reaches 196.7K. Gemma 4 12B at Q8_0 fits with 179.2K tokens, which is the option for users who want a higher-precision 12B model.
Qwen3.5-27B fits only in its IQ4_XS file and only with 15.6K tokens; the Q4_K_M file, 16.74 GB, does not fit. The two mixture-of-experts (MoE) models in our set, Gemma 4 26B-A4B at 16.55 GB and Qwen3.5-35B-A3B at 21.59 GB in MXFP4, do not fit entirely in 16 GB. Gemma 4 31B at IQ4_XS, 16.37 GB, does not fit either once its 1258.3 MB sliding-window cache is counted.
MoE models are the case where splitting between GPU and system RAM is attractive, because each token reads only the active experts. We did not model or measure that split, so we make no speed claim about it.

The figure makes the 2026 pattern visible. Hybrid and sliding-window models (the Qwen3.5 and Gemma 4 bars) reach their model limits on cards where Llama 3.1 8B is still context-bound. A model’s bar at zero means its weights do not fit at that tier at all.
Editorial estimate — Methodology: For each model and file we subtract the GGUF size, the fixed state (sliding-window cache or recurrent state) and a 1.0 GB reserve from the card’s memory, then divide by KV bytes per token and cap at the model’s maximum context (calcs/vram_fit.py). KV layout follows llama.cpp at commit a07831a with its default F16 cache and 512-token micro-batch. Gemma 4 E4B’s global layers use 2 KV heads, an assumption because its config leaves the global head count empty.
| Assumption | Value | Basis |
|---|---|---|
| Reserve for runtime and display | 1.0 GB | Editorial choice; tested at ±25% and ±50% |
| KV cache precision | F16, 2 bytes | llama.cpp default (common.h) |
| Micro-batch for sliding caches | 512 tokens | llama.cpp default n_ubatch |
| Weights in VRAM | GGUF file size | Hugging Face API, November 26, 2026 |
| Laptop OS and apps | 3.0 GB | Editorial choice for an 8 GB laptop |
Source: calcs/vram_fit.json; llama.cpp common.h and llama-kv-cache-iswa.cpp. Takeaway: the reserve moves 8 GB results the most; a 50% larger reserve cuts Qwen3.5-9B from 56,662 to 41,403 tokens and removes Gemma 4 12B entirely.
Worked example
Take an RTX 4060 with 8 GB and Qwen3.5-9B at Q4_K_M, text only, in llama.cpp with default cache settings.
- Card memory: 8 GiB = 8.59 GB. Subtract the 1.0 GB reserve: 7.59 GB.
- Subtract the weights, 5,680,522,464 bytes (5.68 GB): about 1.91 GB left.
- Subtract the fixed recurrent state of the 24 linear layers, 52.7 MB.
- KV per token: 8 full layers × 2 × 4 heads × 256 × 2 bytes = 32,768 bytes, or 32.0 KiB.
- Divide what is left by 32,768 bytes: 56,662 tokens, or 55.3K.
- Repeat for Llama 3.1 8B Q4_K_M: 4.92 GB of weights and 131,072 bytes per token leave 20,364 tokens, or 19.9K.
- Switch the cache to 8-bit (q8_0, 34 bytes per 32 values): Qwen3.5-9B rises to 106,659 tokens and Llama 3.1 8B to 38,332.
llama.cpp’s default context is the model’s training context (n_ctx = 0), which is 262,144 tokens for Qwen3.5. Set the context explicitly, for example to 32K, or the runtime will try to reserve far more than the card holds. Our LLM VRAM calculator runs this arithmetic for other models and cards.
Laptops with 8 GB of RAM and no usable GPU
Many local LLM VRAM searches come from laptops with integrated graphics, such as a Core i5-7200U with 8 GB of RAM running a Qwen3.5 or Gemma 4 model. Intel lists that processor at 2 cores, 4 threads and a maximum memory bandwidth of 34.1 GB/s. Without a discrete GPU, the model runs on the CPU from system RAM, and the operating system and browser take a share of that RAM first.
With an editorial 3.0 GB reserved for the OS and apps, 5.59 GB remains. Qwen3.5-4B at Q4_K_M fits with 83.3K tokens of context, Gemma 4 E4B with 34.0K, and Llama 3.1 8B with only 5.0K. Qwen3.5-9B at Q4_K_M does not fit.
Speed is the harder limit for local LLM VRAM planning on a laptop, where system RAM stands in for VRAM. Each generated token of a dense model such as Qwen3.5-4B reads roughly the whole weight file from memory, so 34.1 GB/s divided by the 2.74 GB Qwen3.5-4B file gives a ceiling of 12.4 tokens per second. That is an upper bound from memory bandwidth, not a measurement, and a dual-core CPU will usually land below it.
The counterargument: just use a smaller quantization
The obvious objection is that context problems disappear with a more aggressive quantization: a 3-bit weight file frees memory, and an 8-bit KV cache nearly halves the cache.
Both moves help, and we include the second in the worked example: an 8-bit cache about doubles the context for the models we checked. But a smaller weight file saves a fixed amount once, while a large per-token cache keeps charging for every token. Llama 3.1 8B with an 8-bit cache still holds 38,332 tokens on 8 GB, fewer than Qwen3.5-9B with a 16-bit cache. Lower-bit files can also trade away quality, which we did not measure. The architecture effect is larger than the quantization effect for anyone who needs long context.
What this analysis can’t tell you
The primary limitation is that this is a memory model, not a measurement. We read file sizes, configs and llama.cpp source, and we did not load these files on a card. Real usage adds driver allocations, flash-attention buffers and display memory that vary by system; our 1.0 GB reserve stands in for all of them, and the sensitivity table shows how much the results move.
Second, the model is llama.cpp-specific. llama.cpp keeps the input embedding layer in system RAM (its source says it is “always” kept on the CPU), so actual VRAM use can be lower than the file size; we did not subtract it, which makes our figures conservative. Other runtimes allocate caches differently, and llama.cpp’s own swa_full option reserves the full sliding-window cache. Third, we did not assess output quality, speed on any GPU, or how well a model handles its full context. A model that fits 256.0K tokens is not necessarily useful at 256.0K tokens.
Finally, Gemma 4 E4B’s global KV head count is not in its config, so its cache figure rests on an assumption, and we give no GPU speed estimates: NVIDIA’s comparison page lists bandwidth for RTX 50 cards (448 GB/s for the RTX 5060 and 5060 Ti, 672 GB/s for the RTX 5070) but not for RTX 40 cards.
Decision framework by role: what to buy and what to run
Buyer choosing a card for local LLM VRAM. If your target is a 9B-class model with long documents, an 8 GB card is enough with Qwen3.5-9B (55.3K tokens, Table 3). If you want 12B-class models with long context, buy 12 GB: Gemma 4 12B goes from 6.6K tokens on 8 GB to its full 256.0K on 12 GB (Tables 3 and the 12 GB section). If you want gpt-oss-20b, only the 16 GB tier holds it, with its full 128.0K context.
Developer running agents or RAG. If your prompts exceed 20K tokens on an 8 GB card, do not use Llama 3.1 8B at a 16-bit cache; the worked example shows it stops at 19.9K. Choose a hybrid or sliding-window model, or switch to an 8-bit cache.
Laptop user with 8 GB of RAM. Use a 4B-class model: Qwen3.5-4B Q4_K_M fits with 83.3K tokens and a 12.4 tokens-per-second ceiling on a Core i5-7200U (laptop section). Close the browser before long sessions, because every gigabyte the OS takes comes out of context.
Team lead comparing local and rented GPUs. If a workload needs a model that does not fit 16 GB, such as Qwen3.5-27B with long context, compare buying a larger card with renting one; our GPU VPS vs cloud GPU cost model prices that option.
FAQ: local LLM VRAM edge cases
Why does my model load but crash when I paste a long document?
Loading allocates the weights; the KV cache grows with the context. If the runtime reserves context up front, the failure appears at load time; if not, it appears when the prompt grows. Set the context length explicitly to what your card holds from Table 3.
Is an RTX 4060 Ti 16 GB better than an RTX 4070 12 GB for local LLMs?
For fitting models, yes: 16 GB holds gpt-oss-20b and Gemma 4 12B at Q8_0, which 12 GB does not. NVIDIA lists a 128-bit memory interface for the 4060 Ti and 192-bit for the 4070. A wider bus usually means more memory bandwidth, which drives generation speed, but NVIDIA’s comparison page does not list bandwidth for RTX 40 cards and we did not measure speed.
Does the vision projector count against VRAM?
Yes. Qwen3.5-9B’s projector file is 0.92 GB and Gemma 4 E4B’s is 0.99 GB. On an 8 GB card, loading Qwen3.5-9B’s projector cuts its context from 55.3K to 28.0K tokens.
Can I run Qwen3.5-35B-A3B on a 16 GB card?
Not entirely in VRAM: its smallest common 4-bit file is 21.59 GB. It is a mixture-of-experts model, so splitting experts into system RAM is possible in llama.cpp, but we did not model the speed of that setup.
Sources & further reading
- Qwen3.5-9B config.json on Hugging Face: layer types, KV heads, head dimension, maximum context (read November 26, 2026).
- Gemma 4 12B config.json on Hugging Face: sliding window of 1024, global head dimension (read November 26, 2026).
- gpt-oss-20b config.json on Hugging Face: 128-token sliding window, 8 KV heads (read November 26, 2026).
- Google Gemma 4 12B QAT Q4_0 GGUF: official 6.98 GB quantized file (read November 26, 2026).
- unsloth Qwen3.5-9B GGUF files: file sizes for Q4_K_M, Q8_0 and the vision projector (read November 26, 2026).
- llama.cpp common.h: default F16 cache, n_ubatch of 512, n_ctx of 0 (commit a07831a, November 26, 2026).
- llama.cpp sliding-window KV cache: window plus micro-batch, padded to 256 cells (commit a07831a).
- NVIDIA GeForce RTX 5060 family specifications: 8 GB and 16 GB memory configurations (read November 26, 2026).
- NVIDIA GeForce RTX 4070 family specifications: 12 GB and 16 GB configurations, interface widths (read November 26, 2026).
- Intel Core i5-7200U specifications: cores, threads, 34.1 GB/s memory bandwidth for a Kaby Lake laptop CPU without a discrete GPU (read November 26, 2026).
Related reading
- LLM VRAM calculator: run the same weights-plus-cache arithmetic for your own model and card.
- Nemotron Labs Dory 1.0 4B on an 8 GB GPU: a single-model memory budget on the same 8 GB tier.
- Hardware guide for running AI models locally: CPUs, RAM, power supplies and full build tiers around the card.
- Local AI hardware in the DRAM crunch: whether to buy memory-heavy hardware now or wait.
- KV cache memory for Llama 3 on H200: the same KV formula at data center scale.
Updated: November 2026. What changed (November 30, 2026): corrected a statement that NVIDIA does not publish memory bandwidth for these cards; it lists bandwidth for the RTX 50 series, though not for the RTX 40 series. This article is independent engineering analysis for educational and informational purposes, not purchasing, legal, financial, or investment advice. File sizes, model configurations, card memory sizes and CPU specifications are reported from Hugging Face, NVIDIA, Intel and llama.cpp sources; KV cache sizes, context limits and the CPU speed ceiling are computed by GPU Insights. This article contains no affiliate links and no sponsored content.
1 thought on “Local LLM VRAM in 2026: Which Models Fit on 8, 12 and 16 GB Cards, and With How Much Context”