Model size calculator
Paste a config.json and get the parameter count, weights memory at each precision and the KV cache per token.
Input
Result
The result will appear here.A model's size is not in its name. 'Qwen3-8B' has 8.2 billion parameters, a mixture-of-experts model advertises its total but runs on a fraction of it, and a multimodal checkpoint buries its language model under text_config. All of it is derivable from config.json — hidden size, layers, heads, vocabulary, expert counts — and this calculator does the arithmetic that accelerate estimate-memory does, without downloading a byte of weights. You get the total and the active parameter count, the memory the weights need in bf16, int8 and int4, and the KV-cache cost per token, which is what decides how many concurrent users fit on a card.
How it works
- Dense models are summed matrix by matrix: embeddings (tied or not), grouped-query attention from the head and kv-head counts, and a gated or ungated MLP depending on the architecture.
- Mixture-of-experts configs (Mixtral, Qwen3-MoE, DeepSeek) report both the total and the parameters active per token, including shared experts and the router.
- DeepSeek's multi-head latent attention is recognised from kv_lora_rank, so its small compressed KV cache is estimated correctly rather than as full heads.
Where your data goes
Nowhere. This tool runs entirely in your browser: the text you paste is processed by the page and is never transmitted to a server or written to a log.
This tool is free and needs no account. Its results exist only in your open page and are not saved anywhere.
What it costs
This tool is free, with no sign-in and no points.
Common questions
- How accurate is it?
- Within about two percent of the published figure for standard decoder-only transformers — Qwen3-8B comes out at 8.19B against the official 8.2B, Llama 3 8B at 8.03B. Biases, vision towers and unusual layer types are not counted, so exotic architectures can drift further.
- Why is the int4 figure 0.61 bytes per parameter and not 0.5?
- Because real 4-bit formats keep scales and zero points per group of weights: GPTQ and AWQ with group size 128 land near 4.6 bits, and llama.cpp's Q4_K_M averages about 4.9. 0.61 bytes is a middle figure; the VRAM calculator has the exact per-quant numbers.
- What should I do with the KV cache number?
- Multiply it by the context length and the number of concurrent sequences you want to serve and add it to the weights. A 70B model at 8k context needs about 2.5 GiB per sequence in fp16 — on an 80 GB card running int4 weights that is roughly 16 concurrent users before you turn on KV quantisation.
The open-source behind it
This tool is a self-contained implementation. huggingface/accelerate (Apache-2.0) does the same job as a library — if you need this behaviour inside your own program, start there rather than calling a web page.
huggingface/accelerateAlso known as
- model parameter count calculator
- llm memory requirements config.json
- how many parameters does a model have
- kv cache size calculator
- huggingface model size estimate
- moe active parameters