Skip to content

Search

Articles, tools, solutions and knowledge base guides

Start typing to search across articles, tools and apps.

AI Model Memory Calculator

NEW

Estimate how much memory an AI model needs for inference: weights, quantization metadata, KV cache and runtime reserve. Compare precisions and check what fits in GPU memory.

Free to use No registration Privacy protection

Inference memory

Model memory on one GPU

Custom GPU

Runtime compatibility not evaluated · illustrative engineering estimate

Model

Parameters

custom model

Weight precision

with group scales

Workload

Prompt

and history

Output

reserved tokens

Sequences

served concurrently

KV cache

precision

Hardware

GPU memory

available

Reserve

buffers, runtime

Advanced
Model architecture
Group-wise quantization

Used by the INT formats. MXFP4, NVFP4 and MXFP8 fix their blocks and scales by specification; BF16, FP16, FP32 and FP8 carry no per-group metadata.

This version models one GPU, a dense or grouped-query attention Transformer and a cache allocated for the full sequence length. Mixture of Experts, latent attention, multi-GPU placement and offloading come in later versions.

Maximum context and sequences

Memory only. Speed and quality are not estimated.

Other weight precisions

    How it is calculated

    Not included: display and operating system memory, runtime workspace beyond the reserve, file format headers and padding.

    Show every step

    Found a bug or missing something? Write to us

    Scope and limits

    Exact bytes, stated assumptions

    Every figure can be checked by hand

    The calculation works in bytes and is tested against reference cases: 8B parameters in INT4 with 128-element groups and 16-bit scales take exactly 4,125,000,000 bytes, and a 32-layer GQA cache of 8,192 tokens is exactly 1 GiB. Everything the estimate leaves out is listed under the formulas.

    Help

    FAQ

    How is the memory of an AI model calculated?

    Weights take parameters × bits ÷ 8 bytes, plus one scale per group of weights (and one zero point per group for asymmetric formats). The KV cache takes 2 × layers × KV heads × head dimension × bytes per element for every token of every sequence. The reserve covers the runtime. The total is counted in bytes and shown in GiB or GB.

    What is the difference between GiB and GB?

    1 GiB is 1,073,741,824 bytes (2^30) and 1 GB is 1,000,000,000 bytes. GPU memory is built in binary sizes, so a "16 GB" card holds 16 GiB. The calculator never writes a binary figure with a decimal unit: switch the unit and every figure is converted.

    Why does a 4-bit model take more than half a byte per weight?

    Quantized formats store scales next to the weights. INT4 with 128-weight groups and 16-bit scales takes 4.125 bits per weight, MXFP4 4.25 and NVFP4 4.5. Asymmetric formats add zero points. Different 4-bit formats therefore need different amounts of memory.

    Does "fits" mean the model will run on the GPU?

    No. It means the estimated memory fits. Whether a runtime supports the format, how much workspace it actually needs and how fast the model runs are not evaluated. The reserve should cover the runtime in use, ideally a measured value, and the result is an engineering estimate.

    Why does the KV cache grow with context and sequences?

    Every token of every sequence stores a key and a value in every layer. Doubling the tokens or the sequences doubles the cache. Grouped-query attention lowers the number of KV heads, and an 8-bit cache halves the bytes per element. Weight precision does not change the cache.

    Are the entered values sent to a server?

    No. Every figure is calculated in the browser. The settings are kept in the page address, so a link can be shared; nothing else is stored or sent.