Back to articles
Hardware & costs2 min read

How Much Memory Does a 7B Model Need? Start with the Weights

Deciding that a GPU can run a model just because its description says “7B, 4-bit” can overlook other memory needs. You can estimate weight size by hand, but weights are only part of the inference system. Keeping theoretical size separate from peak runtime usage makes hardware decisions clearer.

An unbranded computing chip surrounded by layered circuit traces and memory modules.
AI-generated editorial illustrationConcept illustration; not a product screenshot, research result or source photograph.
Three-month free access · All articles are open through January 10, 2027 (Japan time).

Start with a simplified estimate of weight size:

Weight size in bytes ≈ number of parameters × bits per parameter ÷ 8.

Taking 7B to mean approximately seven billion parameters gives these theoretical figures:

Weight precisionTheoretical weight size, in decimal GB
16-bitAbout 14GB
8-bitAbout 7GB
4-bitAbout 3.5GB

These are arithmetic estimates, not measured VRAM usage for a particular model. A real implementation also includes quantization metadata, unquantized layers, working buffers, activations, and the KV cache. Conversion between GB and GiB also produces differences in the numbers.

Hugging Face's documentation describes loading lower-precision weights with bitsandbytes, along with relevant compute types and implementation requirements. The actual benefit depends on the model and how it runs. Read the documentation ↗

If you are choosing hardware, first fix three conditions: the model and quantization version, the longest input, and the number of requests handled concurrently. Then measure peak memory, time to first token, and generation speed under those conditions. Parameter count alone misses how you actually intend to use the model.

VISUAL NOTE
Translucent file slices pass through an inspection gate to a compute chip and separate memory modules, illustrating a local inference path.
AI-generated concept illustrationLook at the whole memory budget

Try it

List the models you plan to run and calculate the theoretical weight size of each. Add four columns to your test sheet: input length, concurrency, peak memory, and speed. Leave entries blank for models you have not run; do not record theoretical estimates as measurements.

If you only process one article a day, comparing the total cost of a remote API with local hardware should also include equipment purchases, idle time, electricity, and maintenance.

EXPLAINED IN SLICES

Look at the whole memory budget

  1. Weights

    What is actually loaded

  2. KV cache

    Context and concurrent requests

  3. Runtime

    Buffers and other allocations

Editorial diagramThese are categories, not measured proportions. Active parameter count describes computation; it does not by itself specify the memory you need.

Understand it. Then try it.

Read something else
Was this useful?

No sign-in needed. One like per browser, across all languages.

Loading likes…

Original references

Use these links to verify details and learn more. A reference does not imply endorsement.

huggingface.coReference 1