
LLM VRAM Calculator
Use this LLM VRAM calculator to estimate model weights, KV cache and memory headroom for local inference. Compare context and quantization with transparent assumptions—not a compatibility guarantee.
Estimated memory target
Enable JavaScript to calculate an estimate.
- Idealized model weights
- —
- Extra weight storage
- —
- KV cache
- —
- Working allowance
- —
- Additional headroom
- —
Estimates, not measured GPU results.
Compare weight precision
Same context & memory budget
Quantized rows use your extra-storage percentage; the 16-bit row uses 0%. Working memory, KV precision and headroom stay unchanged. This does not compare model quality or speed.
| Weights | Weight storage | Memory target | Budget result |
|---|---|---|---|
| Calculate a configuration to compare. | |||
LLM VRAM calculator for local inference
Use this free LLM VRAM calculator to estimate model weights, KV-cache memory and a planning allowance before trying a local language model. It is a single-device inference planner, not an AI chatbot or a GPU benchmark. The result answers a memory-budget question under your inputs; it does not prove that a model is compatible with your computer.
- Choose a reference model, or select Custom and enter the total parameter count.
- Choose the weight precision and the number of tokens you expect each sequence to hold, including the prompt and generated tokens.
- Enter one device’s memory capacity and subtract a realistic reserve for other use.
- Open Advanced to review architecture, KV precision, concurrent sequences and allowances.
- Calculate, compare the precision rows and copy or download the assumptions with the result.
Use the memory amount and units reported by your device or runtime. For shared/unified memory, enter one pool—not RAM plus a second VRAM figure. The tool does not inspect your hardware, fetch a model or contact an AI API.
How the LLM memory estimate works
All arithmetic uses bytes internally. A billion parameters means 1,000,000,000 parameters. GB means 1,000,000,000 bytes; GiB means 1,073,741,824 bytes. Changing the unit converts the capacity and allowance inputs rather than silently changing the physical memory budget.
Idealized weights = parameters × bits per weight ÷ 8
Extra weight storage = idealized weights × storage allowance %
KV cache = 2 × layers × KV heads × head dimension
× tokens per sequence × concurrent sequences
× bytes per cache element
Subtotal = idealized weights + extra storage + KV cache
+ working-memory allowance
Planning target = subtotal × (1 + headroom %)
Usable budget = device capacity − other-use reserve
The two in the KV formula accounts for separate keys and values. For grouped-query attention, use the KV head count, not the larger query-head count. This formula models conventional full attention with separate, fully resident caches and no prefix sharing. It does not model sliding-window, hybrid/linear attention or compressed/latent caches.
Quantized weight formats store more than a perfect stream of nominal bits. Metadata, scales, mixed-precision tensors and runtime layout can change the allocation. The default 10% extra-storage value is an illustrative, editable assumption—not a calibrated Q4_K_M, AWQ or GPTQ profile. The 1 GiB working allowance and 10% headroom are also assumptions, not measured runtime requirements. Set larger allowances when your actual workload requires them.
“Within budget” means the target is below the entered usable budget, with at least 10% of that budget remaining. “Tight” means the target fits arithmetically but leaves less than 10%. “Exceeds” means it is above budget. These are planning labels, not probability estimates. The component bar shows shares of the target, not device utilization measured on your machine.
Example: why the weight file is not the total
Consider an illustrative 8B dense full-attention model with 32 layers, eight KV heads and a head dimension of 128. These are example inputs, not a claim about every model called “8B.” At 4-bit weights, 10% extra weight storage, 8,192 tokens, one sequence and 16-bit KV cache:
| Component | Calculated amount |
|---|---|
| Idealized weights | 3.73 GiB |
| Extra weight storage (10%) | 0.37 GiB |
| KV cache | 1.00 GiB |
| Working allowance | 1.00 GiB |
| Additional headroom (10% of subtotal) | 0.61 GiB |
| Planning target | 6.71 GiB |
An 8 GiB device with a 1 GiB other-use reserve has a 7 GiB usable budget. That example is labelled tight, since only about 0.29 GiB remains after the target. It is not a guarantee that the model will run. Doubling context to 16,384 tokens doubles this example’s KV cache to 2 GiB; the weights do not change. Totals use unrounded bytes, so displayed components may not sum exactly.
Sourced reference profiles, not a live model directory
The initial profiles use Qwen’s published total parameter counts and configuration dimensions. They are established examples for checking the calculation—not a recommendation of the newest or best model. A model name’s “7B” label is not substituted for the publisher’s 7.61B total.
| Reference model | Total parameters | Layers | KV heads | Head dimension |
|---|---|---|---|---|
| Qwen2.5-7B-Instruct | 7.61B | 28 | 4 | 128 |
| Qwen2.5-14B-Instruct | 14.7B | 48 | 8 | 128 |
| Qwen2.5-32B-Instruct | 32.5B | 64 | 8 | 128 |
These configs disable sliding-window attention and set a 32,768-token position limit. Longer contexts need additional supported configuration; entering a larger number here estimates memory but does not enable that context. Head dimension is calculated from hidden size divided by query heads: 3584/28 for 7B, and 5120/40 for 14B and 32B. Parameter counts are rounded publisher figures, not a tensor-by-tensor artifact inspection.
What this calculator cannot tell you
- No hardware compatibility verdict: drivers, backend support, quantization kernels, model format and operating system must be checked separately.
- No training or fine-tuning estimate: gradients, optimizer states and training activations are not calculated.
- No speed prediction: memory capacity does not determine tokens per second, latency or model quality.
- No multi-GPU or partial-offload model: do not sum several GPUs and assume they behave like one device. Host RAM and data-transfer requirements are not estimated.
- No universal architecture support: MoE, sliding-window, hybrid, recurrent/linear, multimodal and compressed-cache models need their own model. Choose weights-only mode when uncertain.
- No measured runtime profile: temporary buffers, graph capture, prefill activations, fragmentation and runtime preallocation may exceed your allowances.
Hugging Face’s cache-strategy documentation explains why dynamic, static, offloaded and quantized caches behave differently. The Accelerate memory estimator also distinguishes memory to load weights from memory to perform inference. This planner is an explicit approximation, not a replacement for testing the exact runtime.
For Ollama, read the context-length documentation and inspect the running configuration rather than assuming the downloaded model’s advertised maximum is the allocated context. Lowering context or concurrency can reduce cache memory; using a smaller model or more aggressive weight quantization can change quality. Always test your actual task.
Frequently asked questions
How much VRAM does a 7B or 8B model need?
There is no single correct number. Total resident weights, their format, attention architecture, context, concurrency and runtime allocations all matter. Use the calculator’s components rather than equating a download size with peak VRAM.
Are 4-bit weights and 4-bit KV cache the same setting?
No. Weight quantization and cache precision are independent. This release offers 16-bit or 32-bit KV elements; it does not model quantized-cache formats. Selecting 4-bit weights does not silently quantize the KV cache.
Can I use it for Apple Silicon or another unified-memory system?
You can budget one shared memory pool, but this is not a Metal/MLX compatibility check. OS reservations and GPU allocation limits still matter. Do not count the same memory twice or assume all installed memory can be assigned to the GPU.
Does “within budget” guarantee no out-of-memory error?
No. It means only that the selected planning target is below your stated budget. Runtime behavior can differ substantially, especially during prefill and at long context lengths.
Is the calculator itself AI-powered?
No. It uses documented arithmetic in your browser. It does not send your configuration to an AI service, run a model or require signup. Existing site ads and analytics are separate; calculator events contain the tool identifier and action, not the entered values.
Sources, tests and verification
Profile data and documentation checked 24 October 2026. Version 1.0.0 is an arithmetic-tested planner; no GPU benchmark measurements are claimed. Model weights are not downloaded, and the bundled reference data does not update automatically.
- Qwen2.5-7B-Instruct model card and configuration (revision a306ca6 at review)
- Qwen2.5-14B-Instruct model card and configuration (76ca6ba)
- Qwen2.5-32B-Instruct model card and configuration (e470900)
- Hugging Face Transformers cache strategies
- Hugging Face Accelerate model memory estimator
- Ollama context-length and allocation guidance
Explore our Tools directory for the AI & GPU category and other Linux utilities. For scheduling local maintenance, see the crontab generator. Neither tool executes commands on your server.




