LLM VRAM calculator

See how weights, context and parallel requests add up—before choosing a model or a GPU.

Method & assumptions

Decode-only, full-cache, single-device planning. Estimate resident weights and a conventional decoder-only KV cache, plus a reserve you choose. Start with illustrative manual values or a dated named architecture preset; quantization and reserve remain adjustable assumptions, not measured requirements. Explicit share links include your numeric inputs in a URL fragment. This is not measured allocation, peak memory, a training estimate or a throughput prediction.

Memory estimate

In-browser · explicit URL sharing

Single-device planning estimate

≈ 7.11 GiB

Weights + full KV cache + your runtime reserve

8B parameters4.5-bit weights4096 tokens × 1
Weights, incl. overhead
4.61 GiB
Full KV cache
0.50 GiB
Runtime reserve
2.00 GiB

Against 12.00 GiB available

4.89 GiB below budget

Below budget on paper does not guarantee fit. Unmodeled allocations can consume this headroom.

Rounded to 0.01 GiB for readability, not measurement accuracy. Budget status uses unrounded numbers. Very small components may round to 0.00 GiB.

A transparent estimate, not a GPU benchmark. No model is loaded and no device memory is measured.

Model storage

Defaults are illustrative, not a specific model. A named preset changes only total parameters and attention geometry; all workload, precision, overhead and reserve values remain yours to adjust.

Official configs and model cards reviewed November 11, 2026. Conventional decoder-only attention with sliding-window caching disabled. Editing parameters or geometry switches to manual mode; selecting manual keeps the numbers.

Official architecture sources: Qwen2.5 3B config · Qwen2.5 7B config.

There is no universal “4-bit” memory size. Effective weight bits, KV precision, weight overhead and runtime reserve stay adjustable below; the default reserve is not measured. No format or kernel compatibility is checked.

Guidance & range

Total resident parameters, not just active MoE parameters. One billion = 1,000,000,000. Range: 0.001–10,000.

Guidance & range

Average payload bits per parameter; fractional values are allowed. Account for mixed precision, not just the quantization label. Range: 0.5–64.

Workload & device budget

Plan for the full context of every parallel sequence on one device.

Guidance & range

Total cached tokens per sequence: prompt, chat-template tokens and generated output combined, up to your configured maximum. Not prompt length alone. Range: 1–2,097,152; whole numbers.

Guidance & range

Simultaneously cached sequences, including beams where applicable. Each gets a full independent cache. Range: 1–4,096; whole numbers.

Guidance & range

Available memory on one device after other workloads. Use GiB, not advertised decimal GB. Range: 0.125–65,536.

Architecture & overhead

Architecture comes from your selected preset or manual edits. KV precision, effective weight bits, weight overhead and runtime reserve are independent planning assumptions, not preset-validated runtime requirements. Review them before planning a deployment.

Number of layers storing KV tensors. Assumes the same cache geometry in every layer. Range: 1–512; whole numbers.

Use num_key_value_heads from the model config, not query heads for GQA/MQA. For ordinary MHA, these match. Range: 1–512; whole numbers.

Elements per key/value head. Use the explicit head_dim where provided; do not assume hidden size / heads always applies. Range: 1–1,024; whole numbers.

Storage bits per KV element, independent of weight precision. A lower value does not mean your runtime supports it. Range: 1–32; whole numbers.

Extra weight storage for scales, zero points, padding and metadata. Avoid double-counting anything already included in effective bits. Range: 0–100.

Your allowance for workspaces, activations, allocator slack and cache metadata. The illustrative 2 GiB is not a measured safety margin. Range: 0–65,536.

Current architecture assumptions

Layers
32
KV heads
8
Head dim.
128
KV bits
16
10% weight overhead · 2 GiB reserve. Edit in architecture & overhead.
View estimate Updates as you type. Review the estimate before planning a deployment.

Sharing explicitly includes every numeric assumption in the URL fragment, not a server query. No automatic input storage. Keep sensitive values out of shared links; browser history and anyone receiving the link can retain them.

Under the arithmetic

Three parts. No hidden multiplier.

All calculations use bytes internally. One GiB is 2³⁰ bytes (1,073,741,824); one billion parameters is 10⁹. Decimal GB and binary GiB are not interchangeable.

Open each input’s guidance for accepted ranges. Architecture values remain in the estimate when their panel is closed; the summary always shows your current assumptions.

Resident parameters

parametersBillions × 10⁹ × weightBits / 8 × (1 + overhead / 100)

Effective bits are an average across resident parameters, not a claim that every tensor uses the same precision. Mixed quantization, unquantized tensors, scales and padding vary by format and runtime.

Use weight overhead only for storage not already included in your effective-bit average. The default 4.5 bits and 10% overhead are illustrative inputs, not a universal “4-bit” conversion.

Retained context

2 × layers × kvHeads × headDimension × contextTokens × parallelSequences × kvBits / 8

The factor of two counts keys and values. Each attention layer retains a key tensor and a value tensor for every sequence and token. We assume equal head dimensions for keys and values and the same geometry in each layer.

Use KV heads, not query heads, for GQA/MQA. Every parallel sequence is assumed to reach the full entered context, with no prefix sharing. Doubling context or concurrency doubles this cache estimate—not the weights.

Your runtime allowance

totalGiB = (weightsBytes + kvBytes) / 2³⁰ + runtimeReserveGiB

The reserve is a user-selected allowance for allocations the two storage formulas do not predict. It is added once per device, not multiplied by parallel sequences.

The default 2 GiB is not calibrated to your runtime. Prefill activations, attention kernels, CUDA graphs, dequantization buffers, cache scales, allocator fragmentation and other workspaces can require more.

Know the edges

A budget check, not a fit guarantee.

Even a total below available memory is only a planning signal. Use the actual model config and runtime documentation, then measure peak memory with your intended workload.

Full residency, one device
All entered weights and KV cache are assumed to stay on one device. CPU/disk offload and tensor or pipeline parallelism are not modeled. Adding multiple GPUs’ memory is not a valid single-device budget.
Conventional decoder-only attention
This is not an architecture-aware simulator. MLA (latent attention), sliding-window or hybrid caches, recurrent/state-space layers, encoder-decoder and multimodal architectures need different accounting. Sliding caches may stop growing on some layers; latent caches cannot be represented reliably just by changing the head count.
MoE needs resident weights
Active parameters per token are not the resident parameter count. For a fully resident mixture-of-experts model, include every loaded expert. Expert routing, expert offloading and their temporary allocations are outside this estimate.
Storage precision is not compute precision
Weight and KV bits are independent. A quantization label does not tell you all storage overhead or supported KV types. Quantized cache metadata, residual full-precision regions and alignment are not calculated separately; allow for them in the reserve.
Full context is not prompt length alone
Include template/system tokens and the desired generated tokens. Beam search or simultaneous requests can retain several sequences. Paged allocation, prefix sharing, cache eviction, speculative decoding and runtime preallocation policies can change actual use.
Guardrails, not hardware limits
Each field displays its accepted range. Architecture dimensions, layers, tokens, sequences and KV bits must be whole numbers; effective weight bits may be fractional. Named presets copy conventional decoder geometry from official configs and rounded total parameter counts from model cards. Manual changes are not architecture-validated, and no preset checks kernel, quantization or runtime compatibility.

Primary references

Where the method comes from

The formulas follow the tensor layout and precision relationships described by Hugging Face. Named presets use Qwen’s official configs and model cards, reviewed November 11, 2026; both configs disable sliding-window attention. Quantization, overhead and reserve are explicit adjustable planning choices, not source-prescribed constants. Inputs are not automatically stored; only explicitly created share links retain scenarios in their URL fragment.

  1. Hugging Face: Optimizing LLMs for Speed and Memory

    Weight precision, KV element counts, and the distinction between query heads and KV heads for MQA/GQA.

  2. Hugging Face: How caching works

    Per-layer key/value tensors with batch, head, sequence and head-dimension axes—the basis for the KV formula.

  3. Hugging Face: Cache strategies

    Dynamic versus static allocation, sliding/chunked layers, cache offloading and quantized-cache trade-offs.

  4. Qwen2.5-3B-Instruct: Official config

    36 layers, 2 KV heads and 128 head dimension (2048 hidden / 16 query heads). Official model card: 3.09B total parameters, rounded.

  5. Qwen2.5-7B-Instruct: Official config

    28 layers, 4 KV heads and 128 head dimension (3584 hidden / 28 query heads). Official model card: 7.61B total parameters, rounded. Both presets use the published 32,768-token config as their context reference, not a guarantee that larger entered workloads are supported.

Keep your context

Plan the rest of your local stack.

Building a tool around your own engineering assumptions? Get in touch with Shipfoundary.