No file required

LLM memory estimator

Plan memory before downloading a model. Enter its stored parameter count and attention configuration, then explore how quantization, context, and simultaneous sequences affect the estimate.

Copy architecture values from the model's published config or the GGUF metadata viewer. Parameter count alone cannot determine the KV cache. If a required value is unknown, leave it blank and obtain it before calculating. This tool is for dense, full-attention decoder inference.

Prefilled with a Phi-4 ONNX export example: 32 layers, 8 KV heads, key/value dimensions of 128, and FP32 cache storage. The rounded weight defaults (4.45 billion stored weights at 8.73 effective bits each) reflect packed Q4 tensors, FP32 scales, and separate embedding/output matrices in the example export; they are not a universal Phi-4 parameter count or quantization setting. A context of 4,096 cached tokens and one parallel sequence are editable workload assumptions, not a declared context limit. Change any value for your model.

Model weights
Attention configuration and workload

Use the number of KV heads, which may differ from query heads for grouped-query attention. Enter key and value dimensions separately; neither is guessed.

Or upload a model to estimate memory →Have a GGUF or ONNX file? The inspector reads its metadata locally to estimate memory.

Phi-4 ONNX example prefilled. Adjust the inputs or calculate the estimate. No file is needed.

How to use the estimate

Compare configurations while keeping the architecture fixed. Lower weight precision reduces weight memory but does not reduce an FP16 cache. Doubling cached tokens or independent sequences doubles cache memory. A range reflects the selected GGUF quantization profile, not a confidence interval or a measured peak.

Formulas and assumptions

weight bytes = stored parameters × effective bits per weight ÷ 8
KV bytes = layers × KV heads × (key dimension + value dimension) × cache bytes per element × cached tokens × sequences
runtime allowance = max(weight bytes × 10%, 256 MiB)
total = weights + KV cache + runtime allowance

GiB uses 1,073,741,824 bytes; MiB uses 1,048,576 bytes. The allowance reuses the file inspector’s planning rule. It is not a backend benchmark. GGUF profile endpoints reuse the existing quantization ranges; for a known effective storage rate, choose custom bits per weight. File headers, tokenizer storage, and alignment are not included in projected weights.

The cache formula assumes identical full-attention layers with separate key and value tensors and no shared prefixes. It follows the standard KV tensor layout. It does not represent sliding-window or hybrid attention, MLA/compressed latent caches, recurrent state, encoder-decoder cross-attention, or quantized-cache overhead.

Estimates, not measurements

Actual peaks depend on backend workspaces, prefill activations, allocators, memory mapping, extra host copies, and device placement. Operating-system memory and other applications need additional headroom. This calculator cannot certify that a model fits a particular device.

Read the file-estimator reference for GGUF and ONNX differences. If you already have a model file, inspect it locally or learn about the ONNX viewer to examine declarations instead of entering them manually.