When you're choosing a local large language model, parameter count is only the beginning of the memory calculation.
A 7B model doesn't automatically require 7 GB of VRAM. But saying a 4-bit-quantized 7B model will definitely run on a 4 GB GPU is misleading, too.
Here's a practical way to estimate memory requirements before downloading a model or buying hardware.
1. Start with the model's weight-memory floor
A simple approximation is:
weight memory (bytes) ≈ parameter count × bits per parameter / 8
For 7 billion parameters at an idealized 4 bits each:
7,000,000,000 × 4 / 8 = 3,500,000,000 bytes
That's 3.5 GB in decimal units, or approximately 3.26 GiB. It's a mathematical weight-memory floor, not a real-world inference requirement.
Actual quantized formats can require more than exactly 4 bits per parameter once different tensor formats and metadata are considered.
2. Allow for runtime allocations
An inference runtime also needs memory for temporary tensors, buffers, model metadata, and other work.
For illustration, let's reserve an extra 20% of our estimated weight memory:
3.5 GB × 20% = 0.7 GB
That brings our illustrative total to 4.2 GB.
The 20% is an assumption for this example, not a measured or universally appropriate overhead figure. Runtime requirements depend on implementation and workload.
3. Consider the context window and KV cache
Increasing context capacity can materially affect memory planning. The cache cost depends on model architecture, number of layers, attention heads, cache precision, context length, batching, and runtime decisions.
There's no single accurate KV-cache-per-token constant for every model.
Suppose we provision a further 2 GB as a hypothetical context and cache reserve:
| Component | Illustrative memory |
|---|---|
| Idealized quantized weight floor | 3.5 GB |
| Runtime reserve (assumption) | 0.7 GB |
| Context/cache reserve (assumption) | 2.0 GB |
| Example capacity target | 6.2 GB |
This is a planning example, not a benchmark or a guarantee that a specific model will fit or perform acceptably.
4. Compare with usable memory
An 8 GB GPU may not have a full 8 GB available to your model after other allocations. A system can also offload some computation or storage to CPU memory, often with a speed trade-off.
Apple silicon uses unified memory; its advertised memory size should not be interpreted as equivalent to discrete GPU VRAM.
What matters is memory realistically available to your selected model, runtime, context and other concurrent workloads.
5. Validate under your intended workload
Once you have a sizing estimate, test the exact model artifact, quantization, runtime, context configuration and concurrency you plan to use.
Record whether the workload actually completes, its token generation speed, and which memory metric you're observing.
A model loading successfully is not proof that it can run your actual application at acceptable speed.
Try a transparent memory estimate
Agent Infra Guide provides a free RAM/VRAM calculator. It makes sizing assumptions visible, and its context reserve can be adjusted for your use case:
Estimate your local LLM's memory requirements — free calculator
Disclosure: I represent Agent Infra Guide, which publishes this free calculator. The calculator is a planning tool, not a measured performance benchmark.
The useful question is not just whether the model can load. It's whether your chosen configuration has enough headroom to run the workload reliably.
Top comments (0)