Weight memory in gigabytes is roughly parameters in billions times bits per weight divided by 8. An 8B model in BF16 is about 16 GB, in Q4_K_M about 4.9 GB, and a 70B model in Q4_K_M about 43 GB. The formula is the fastest way to check whether a model fits before you download a file that is tens of gigabytes.
Before you start
The parameter count of the model you want, the bits per weight of the quantization level, and the VRAM or RAM available.
Apply the formula
Multiply the parameter count in billions by the bits per weight, then divide by 8. For Q4_K_M, use 4.89 bits per weight, not 4: the K-quant variants mix bit-widths across layers and average above 4.
Work the arithmetic for the levels you are choosing between, so the comparison is in numbers, not in feelings.
Add the real-file margin
Add 5 to 26 percent to the formula result, because published files run above the plain arithmetic: most formats keep embedding and output layers in 16 bits and store scales. A 70B model at Q4_K_M is about 43 GB by the formula and 42.5 GB on the hub, while other formats land higher.
Check the actual file size on the model page before you download. The formula is a planning tool, not a download size.
Check the result against the card
Compare the estimated size with the memory available, and leave room for the KV cache and the runtime. A model that exactly fills the card will fail on the first long prompt.
If it does not fit, step down one quantization level and redo the arithmetic before you try a smaller model.
Practice check: fictional Maple Corner choice, 32B model, 48 GB card
The table below is fictional practice material, worked out by hand from the stated formula. It is the expected result for the practice model, not a run of any download.
| Level | Bits per weight | Formula GB | Verdict |
|---|---|---|---|
| BF16 | 16 | 64.0 | Fail – over 48 GB |
| Q8_0 | 8.5 | 34.0 | Pass |
| Q4_K_M | 4.89 | 19.6 | Pass – room to spare |
| Q2_K | 3.0 | 12.0 | Pass, quality fails |
BF16 at 64 GB does not fit the 48 GB card. Q8_0 at 34 GB fits and keeps the most quality, so it is the choice here; Q4_K_M fits with more room but gives up quality for space that is not needed.
Expected result. UNTESTED: the figures in the practice table are worked out by hand from the stated formula, not measured by running any model. Apply the formula to your own model and levels, add the file-size margin, and check the result against your card.
Limits
- The formula covers weights only: KV cache, activations and runtime overhead all need memory too.
- Bits per weight is a file average, not a constant: Q4_K_M averages 4.89, not 4.
