Estimate whether a laptop, desktop, or workstation has enough VRAM and RAM for a specific local model, quantization, and context length.
When to use this
Use it before downloading a large model or upgrading a GPU
This checker is for Ollama, LM Studio, llama.cpp, Open WebUI, and similar local AI setups where the practical question is whether model weights plus KV cache fit in memory.
Default result
Llama 3.1 8B at Q4_K_M with 8,192 tokens needs about 7.7 GB after reserve and safety margin, so an 8 GB GPU fits with a thin margin.
Worked example: Llama 3.1 8B on an 8 GB GPU
Using Q4_K_M at about 4.5 effective bits per weight, an 8B model needs about 8 x 4.5 / 8 = 4.5 GB for weights before runtime overhead. The Ollama Llama 3.1 8B row lists a 4.9 GB model file, which is a useful real-world check against the formula.
With the Llama 3.1 8B architecture, an 8,192-token FP16 KV cache is 2 x 32 layers x 8 KV heads x 128 head dimension x 8,192 tokens x 2 bytes / 2^30 = 1.0 GB. Add a 1.5 GB runtime reserve and a 10% safety margin: (4.5 + 1.0 + 1.5) x 1.10 = 7.7 GB.
That default scenario fits into 8 GB VRAM, but the margin is only about 0.3 GB. If you raise context to 32,768 tokens, the KV cache becomes 4.0 GB and the same setup no longer has a comfortable 8 GB GPU fit.
How we calculate local model memory
The estimate separates model weights from the KV cache. Weight memory uses the model parameter count and the selected effective bits per weight. KV cache memory uses the Llama-style formula: 2 x layers x KV heads x head dimension x context tokens x bytes per KV value, divided by 2^30.
Can I run Llama 3.1 8B on 8 GB VRAM?
Often yes at Q4 with moderate context, but the margin is small. The default example fits because the estimated total is 7.7 GB. A longer context, multiple sessions, or a heavier runtime can push the same setup into spill territory.
How context length changes local AI memory
Context length affects KV cache memory linearly. If you raise context from 8,192 to 32,768 tokens, the KV cache is about four times larger for the same architecture and KV precision.
What to change when the model spills out of VRAM
First reduce context length or active sessions. Then test Q4 if you were using Q8 or FP16. If the model weights alone are larger than VRAM, expect CPU/RAM offload or a smaller model to be the more realistic path.
Benchmark anchor vs real tokens per second
The speed estimate is an anchor from a cited llama.cpp CPU benchmark, scaled only as a planning hint. Real throughput depends on memory bandwidth, GPU backend, CPU generation, drivers, batch size, prompt shape, and runtime settings.
Source notes and assumptions
Reference values are stamped as of June 2026. Verify Ollama model sizes, context windows, and provider documentation before using the result for a purchase decision. Runtime reserve, safety margin, and size-adjusted speed are editable planning assumptions.
Why can a small model fail when the context window is large?
Model weights are not the only memory load. The KV cache stores key and value states for previous tokens, so memory use grows with context length, layer count, KV heads, and active sessions.
Does Q4 mean the whole model uses exactly 4 bits per parameter?
Not exactly. GGUF formats include metadata and some tensors may stay at higher precision. This checker uses the cited Q4_K_M effective-bit benchmark as a planning estimate, then shows the published Ollama file sizes as a reality check.
Can I run a model if it does not fully fit in VRAM?
Sometimes. A runtime may offload layers or KV cache to system RAM, but that usually lowers throughput and increases latency. Treat a spill result as a test-first path, not a comfortable setup.
Are the tokens/sec numbers guaranteed?
No. The speed number is anchored to a cited llama.cpp CPU benchmark for Llama 3.1 8B on a specific dual-Xeon system. Your GPU, CPU, memory bandwidth, runtime, drivers, and prompt shape can change real speed.
Should I choose Q4, Q8, or FP16?
Q4 is usually the first local test when memory is limited. Q8 uses more memory and can preserve more detail. FP16 is much larger and is mostly for hardware with generous memory or validation work.
Should I buy hardware from this result alone?
No. Use this as a screening tool. Before buying, test the exact model file, runtime, quantization, context length, and workload you plan to use.
Privacy choices
Choose your cookie settings
We use necessary browser storage to keep Useful Atlas working and self-hosted Plausible for cookieless aggregate statistics. Optional Google Analytics and future marketing tools stay off unless you allow them.
Necessary storage
Required for privacy choices, theme preference, security, and requested site features.
Optional Google Analytics
Used only after consent to measure visits and improve calculators, guides, and navigation.
Necessary storage
Required for core site functions and privacy preference storage.
Always on
Optional analytics
Controls Google Analytics and similar optional tools. Plausible remains cookieless and does not set tracking cookies.
Advertising and partner tracking are not active. Future advertising or affiliate tools must be added behind consent controls and documented before they are enabled.