If you have tried to run an open model locally, you have probably hit a wall: the model is 140 GB in full precision and your GPU has 24 GB of memory. Quantization closes that gap by storing weights in fewer bits, and the arithmetic is straightforward: going from 16-bit to 4-bit cuts memory by 4 times, so a 70B model drops from about 140 GB to about 35 GB, which suddenly fits on a single 48 GB GPU. Work the numbers out before downloading, not after.
What you need
- The parameter count of the model
- The quantization format you plan to use
- Your GPU memory and the context length you plan to run
Step 1: Multiply parameters by bytes per weight
Use 2 bytes per weight for FP16, 1 byte for INT8 and half a byte for INT4. A 7B model at FP16 needs about 14 GB for weights; at INT4 it needs about 4 to 4.5 GB.
Step 2: Add overhead for the KV cache and activations
Add 20 to 30 percent on top of the weight-only figure as a rough margin for short contexts. The KV cache grows with context length, so a long context needs more room.
Step 3: Compare with your GPU and drop a level if needed
If the total does not fit, drop one quantization level, for example from FP16 to INT8 or from INT8 to INT4, and re-check. A larger model at INT4 often outperforms a smaller model at FP16 while using similar memory.
Worked example: synthetic memory budget for a 70B model
The table below is a synthetic example. It shows the expected result of a memory budget; no model was loaded.
| Format | Weights for 70B | Fits a 48 GB GPU? |
|---|---|---|
| FP16 | About 140 GB | No |
| INT8 | About 70 GB | No |
| INT4 | About 35 GB | Yes, with room for cache |
| Choice | INT4 | Fits |
Expected result (UNTESTED). the 70B model fits a 48 GB GPU only at INT4, at about 35 GB for weights plus cache overhead. This check was not run live; the table shows the expected result for the synthetic example.
Limits
- These are weight-only estimates; total memory during inference is higher because of the KV cache, activations and framework overhead.
- The KV cache scales with context length, so a long context needs a bigger margin.
- Quantization is a memory and bandwidth optimization: a 4-bit model often generates faster because there is less data to read, not because the maths is cheaper.
- If the model still does not fit, a smaller model at higher precision may serve better than a large model squeezed too far.
