Black Friday week: local AI hardware on sale. See the list.

Local Model Calculator

Does the model fit at your context length? File size is half the answer. The KV cache grows with every token, so a model that loads at 4K can fail at 32K. Pick your hardware, a model, a context and the cache type you run (f16, q8_0 or q4_0). If your model is not in the list, paste its Hugging Face GGUF repo.

Hardware for local LLMs

Each card shows the memory the model and cache can use. Run the calculator and the cards with room for your result get a "Fits" tag. The tool keeps 4 GiB free on unified memory (Mac, Ryzen AI Max+, GB10) and 1 GiB on a graphics card.

DGX Spark platform (NVIDIA GB10)

Fits ASUS Ascent GX10 128GB unified memory 128GB LPDDR5X, 2TB. Same GB10 chip as the DGX Spark. Opens a new unit from a third-party seller. Check on Amazon

AMD

Fits Minisforum MS-S1 MAX 128GB unified memory Ryzen AI Max+ 395 mini PC, 128GB LPDDR5X, 2TB. Check on Amazon
Fits ASUS ROG Flow Z13 64GB unified memory Ryzen AI Max+ 395 laptop, 64GB LPDDR5X, 1TB. Opens a third-party seller bundle with a USB hub. Check on Amazon
Fits Sapphire Radeon AI PRO R9700 32GB VRAM 32GB GDDR6 graphics card, RDNA 4. Check on Amazon

Mac

Fits Mac mini M6 24GB unified memory 12-core CPU, 24GB unified memory, 512GB. Check on Amazon
Fits MacBook Pro 14-inch M6 32GB unified memory 12-core CPU, 32GB unified memory, 1TB. Check on Amazon
Fits MacBook Pro 14-inch M5 Pro 48GB unified memory 15-core CPU, 48GB unified memory, 1TB. Check on Amazon
Fits Mac mini M5 Pro 64GB unified memory 18-core CPU, 64GB unified memory, 1TB. Check on Amazon
Fits Mac Studio M5 Ultra 96GB unified memory 30-core CPU, 96GB unified memory, 1TB. Check on Amazon

Affiliate links: as an Amazon Associate, this site earns from qualifying purchases. Amazon prices and availability change. The price on Amazon at purchase applies.

Models and their cache cost

Layer counts, KV heads and head size come from each model's config.json on Hugging Face. The fixed part is the cache of sliding-window layers, which stops growing once the context passes the window. File sizes come from the GGUF repository's file list. Both were read on 2026-11-23.

ModelQ4-class fileKV cache per token (f16)Fixed partCache at 32K128K, f16128K, q8_0128K, q4_0Max context
Gemma 4 E4B Q4_K_M, 4.64 GiB 16 KiB (4 of 42 layers) 40 MiB (20 sliding layers) 0.54 GiB 2.04 GiB 1.08 GiB 0.57 GiB 128K
Qwen3.5 9B Q4_K_M, 5.29 GiB 32 KiB (8 of 32 layers) none 1.00 GiB 4.00 GiB 2.13 GiB 1.13 GiB 256K
Gemma 4 12B Q4_K_M, 6.63 GiB 16 KiB (8 of 48 layers) 480 MiB (40 sliding layers) 0.97 GiB 2.47 GiB 1.31 GiB 0.69 GiB 256K
gpt-oss 20B MXFP4, 11.28 GiB 24 KiB (12 of 24 layers) 18 MiB (12 sliding layers) 0.77 GiB 3.02 GiB 1.60 GiB 0.85 GiB 128K
Qwen3.8 27B UD-Q4_K_M, 15.43 GiB 64 KiB (16 of 64 layers) none 2.00 GiB 8.00 GiB 4.25 GiB 2.25 GiB 256K
Gemma 4 26B-A4B UD-Q4_K_M, 15.78 GiB 20 KiB (5 of 30 layers) 300 MiB (25 sliding layers) 0.92 GiB 2.79 GiB 1.48 GiB 0.79 GiB 256K
Gemma 4 31B Q4_K_M, 17.07 GiB 80 KiB (10 of 60 layers) 1200 MiB (50 sliding layers) 3.67 GiB 11.17 GiB 5.94 GiB 3.14 GiB 256K
Ornith 1.5 35B-A3B Q4_K_M, 20.22 GiB 20 KiB (10 of 40 layers) none 0.63 GiB 2.50 GiB 1.33 GiB 0.70 GiB 256K
Qwen3.6 35B-A3B UD-Q4_K_M, 20.61 GiB 20 KiB (10 of 40 layers) none 0.63 GiB 2.50 GiB 1.33 GiB 0.70 GiB 256K
Qwen3-Coder-Next 80B-A3B Q4_K_M, 45.20 GiB 24 KiB (12 of 48 layers) none 0.75 GiB 3.00 GiB 1.59 GiB 0.84 GiB 256K
gpt-oss 120B MXFP4, 59.03 GiB 36 KiB (18 of 36 layers) 27 MiB (18 sliding layers) 1.15 GiB 4.53 GiB 2.40 GiB 1.27 GiB 128K
Ornith 1.5 122B UD-Q4_K_XL, 74.24 GiB 24 KiB (12 of 48 layers) none 0.75 GiB 3.00 GiB 1.59 GiB 0.84 GiB 256K

Check a model that is not in the list

Paste a GGUF repo, for example bartowski/OLMo-2-1124-7B-Instruct-GGUF. Your browser reads the repo card, the file list and the base model's config.json from Hugging Face. It then runs the same math as the table above.

Pasted repos work for Llama-architecture models (including Mistral), Qwen2, Qwen3, Qwen3-Next, Qwen3.5, OLMo 2, Phi-3, SmolLM3 and gpt-oss. You get no verdict when the base model is gated, the card names no base model, or the family has cache rules the tool does not model, such as DeepSeek, Gemma or Llama 4. Gemma 4 is in the list above. Pasted results come from config values and file sizes. They were not checked against a load log.

How the number is calculated

memory needed = file size + KV cache
KV cache      = context tokens x full-attention layers x 2 (K and V) x KV heads x head size x bytes per value
              + fixed part: sliding layers x cells x 2 x sliding KV heads x sliding head size x bytes per value
bytes/value   = f16: 2    q8_0: 34 / 32 = 1.0625    q4_0: 18 / 32 = 0.5625

Hardware for each memory tier

Prices as of November 2026. They move weekly in 2026, so check the listing. Rental rates are RunPod on-demand, Secure Cloud and Community Cloud, from runpod.io/pricing (page updated November 12, 2026).

MemoryPickPriceRent the same memory
12 GB RTX 3060 12GB Check current listings Not on the list
16 GB RTX 5060 Ti 16GB $800 lowest US retail price (GPUPrix, Newegg/Best Buy/B&H, November 4, 2026) Not on the list
24 GB RTX 3090 24GB (Amazon Renewed) $1,626 used average on 313 listings (resaleprices.com, November 13, 2026) RTX 3090 24GB: $0.50 / $0.22 per hour
32 GB RTX 5090 32GB $6,331 to $6,643 lowest daily average (GPU Poet, November 7-8, 2026) RTX 5090 32GB: $1.39 / $0.69 per hour
48 GB RTX A6000 48GB Check current listings A40 48GB: $0.59 / $0.35 per hour
96 GB RTX PRO 6000 Blackwell 96GB $15,299.99 at Central Computer (November 9, 2026) RTX PRO 6000 96GB: $2.69 / $1.69 per hour
128 GB ASUS Ascent GX10 128GB (same GB10 chip, 2TB) Check current listings Not on the list

Affiliate links. The full list by budget is on the gear page.

Questions

How much VRAM does context length use?

Context is stored in the KV cache, and its size depends on the model. Qwen3.8 27B has 16 full-attention layers, 4 KV heads and a head size of 256, which is 64 KiB per token at f16. That is 2.00 GiB at 32K, 8.00 GiB at 128K and 16.00 GiB at 256K, on top of the weights. Qwen3.6 35B-A3B needs 20 KiB per token and gpt-oss 20B needs 24 KiB.

Does Qwen3.8 27B fit on a 24GB GPU?

Yes at short and medium context. The UD-Q4_K_M file is 15.43 GiB. With 32K of context it needs 17.43 GiB, and with 64K it needs 19.43 GiB. Both fit a 24GB card with 1 GiB kept free. At 128K it needs 23.43 GiB, which does not fit. Use a smaller file or a shorter context.

Why does a model load at 4K context and fail at 32K or 128K?

The weights stay the same size, but the KV cache grows with every token of context. A file that leaves 2 GiB free at 4K has no room left once the cache passes 2 GiB. For Qwen3.8 27B the cache reaches 2 GiB at 32K. This calculator adds the cache to the file size before it gives a verdict.

How much VRAM does a q8_0 KV cache save?

A q8_0 block stores 32 values in 34 bytes, so the cache takes 53.1% of the f16 size, not exactly half. q4_0 stores 32 values in 18 bytes, 28.1% of f16. For Qwen3.8 27B at 128K that is 8.00 GiB at f16, 4.25 GiB at q8_0 and 2.25 GiB at q4_0. On a 24GB card the saving buys a bigger file: the largest one that fits at 128K is UD-IQ4_XS with an f16 cache, UD-Q5_K_M with q8_0 and UD-Q6_K with q4_0.

How do I turn on a q8_0 KV cache?

In llama.cpp, add -ctk q8_0 -ctv q8_0. A quantized V cache needs flash attention. With the default -fa auto, llama.cpp turns flash attention on for you; with -fa off it refuses to start. In Ollama, set OLLAMA_KV_CACHE_TYPE=q8_0 on the server and restart it. The setting applies to every model, and it works only when flash attention is on.

How much memory does Gemma 4 12B need at long context?

Less than its size suggests. Gemma 4 12B has 48 layers. Only 8 are full-attention layers, and each stores 1 KV head of size 512, which is 16 KiB per token at f16. Qwen3.5 9B needs 32 KiB per token. The other 40 layers see a 1,024-token window and hold a fixed 480 MiB. The cache is 0.97 GiB at 32K and 4.47 GiB at 256K. With the Q4_K_M file (6.63 GiB) that is 11.10 GiB at 256K. Gemma 4 31B needs 80 KiB per token plus a fixed 1200 MiB.

Does Gemma 4 12B fit on a Mac mini M4 with 16GB?

Yes by memory. The Q4_K_M GGUF is 6.63 GiB. With 4 GiB kept free for macOS, a 16GB Mac has 12 GiB for the model, and the file plus cache fits up to 256K context (11.10 GiB). The vision projector file is extra and is not counted here. This is a memory result, not a speed test.

How much memory does a 256K context need?

For Qwen3.8 27B, 256K of context is 16.00 GiB of KV cache at f16, so the UD-Q4_K_M file plus cache needs 31.43 GiB. For Qwen3.6 35B-A3B the same context is 5.00 GiB of cache. gpt-oss 20B stops at 128K, the maximum in its config.

Submit your benchmark

Ran one of these models? Send the hardware, model, quantization and tokens per second. Good submissions become benchmark notes.

Related guides

Generate DITA/XML docs Turn setup notes into structured documentation on MarkdownMe. Practice AI cert questions Use CloudYeti's free AWS AI Practitioner diagnostic.