Tool · plain arithmetic

Model memory estimator

Type a model's parameter count and the bits stored per weight to see how much memory the weights take, then add an overhead allowance of your own. Results are estimates of weight memory only. What a model really uses on your card also depends on context length, how many requests run at once, and the serving software and its settings. The form starts with an example (8 billion parameters, 16 bits, a 20% allowance and a 24 GB card); change any of it. Nothing you type leaves this page.

Inputs

From the model card, for example 8 billion. Must be above zero.

Between 1 and 64. Treated as one average for every weight. If the model card or checkpoint gives an average bits per weight, type that figure.

Whole percent from 0 to 200, your own allowance on top of the weights. The starting value of 20 is an editable example and a placeholder, not a typical or measured figure.

Leave empty to skip the comparison; otherwise it must be above zero. Check whether your figure is in GB or GiB.

Estimate

Weights
16 GB (14.9 GiB)
Overhead allowance
3.2 GB
Total estimate
19.2 GB (17.88 GiB)

Utilization: 80% of the card (total ÷ card memory).

By this estimate, the weights and allowance fit in 24 GB with 4.8 GB left over.

Worked: 8,000,000,000 × 16 ÷ 8 = 16,000,000,000 bytes

How the numbers are worked out

  • Weight memory in bytes = parameters × bits per weight ÷ 8. There are 8 bits in a byte.
  • Parameters = the number you type × 1,000,000 (million) or × 1,000,000,000 (billion). Overhead allowance in bytes = weight bytes × overhead % ÷ 100, and total estimate = weight bytes + allowance. The overhead is a whole percent you pick; this page does not supply one, and the starting 20% is an editable example.
  • Card bytes = the memory you type × bytes per selected unit (GB or GiB). Utilization = 100 × total bytes ÷ card bytes. The margin is card bytes − total bytes: positive means the estimate fits with that much to spare, negative means it needs that much more.
  • GB here means 1,000,000,000 bytes. GiB means 1,073,741,824 bytes (230). Tools and spec sheets differ in which they use, so both are shown.
  • Bits per weight is treated as one average for every weight. If a checkpoint mixes precisions, use the average its model card gives, if it gives one.
  • Check: 8 billion parameters at 16 bits gives 8,000,000,000 × 16 ÷ 8 = 16,000,000,000 bytes, about 16 GB. That matches the common rule of about 2 GB per billion parameters for 16-bit weights.

What it leaves out

  • Context length and the KV cache. Generation also needs memory for the key-value (KV) cache and for runtime allocations. Budget for them separately; how much you need depends on the context length you set and how many requests run at once.
  • The serving software. Each runtime and its settings change what is really used. With vLLM, launch the exact checkpoint on your own card and read the GPU KV cache size and Maximum concurrency lines in its startup log.
  • Everything else on the card. Anything else using the same card shares its memory. Check how much is free before you plan around the full figure.

For a full sizing walk-through, read the guide to GPUs for self-hosted vLLM workstations.

Sources

  1. Optimizing LLMs for Speed and Memory, Hugging Face Transformers documentation: weight memory from parameter count and precision (about 2 GB per billion parameters at 16 bits).
  2. Conserving Memory, vLLM documentation (v0.30.0): memory settings such as context length, batch size and CUDA graph memory.
  3. Parallelism and Scaling, vLLM documentation (v0.30.0): the GPU KV cache size and Maximum concurrency startup log fields. The concurrency figure holds only for the tokens per request the log line states.
  4. Prefixes for binary multiples, NIST: 8 bits per byte, and the gigabyte (109 bytes) and gibibyte (230 bytes) factors.
  5. SI prefixes, BIPM: the factors 106 (mega, million) and 109 (giga, billion).
  6. NIST Guide to the SI, Chapter 7: Rules and Style Conventions for Expressing Values of Quantities, NIST (SP 811), section 7.10.2: percent as 0.01.