Build radar
Sources 33Updates always the freshest
0 Newsletter
Animated illustration for: What fits on your own computer: memory, quantization and context
TestLAB · Local AI · Explainer · 9 min read

What fits on your own computer: memory, quantization and context

A simple calculation: parameters times bytes per weight plus memory for context. How to estimate whether a model fits and what quantization does to quality.

In short
  • A model's memory is roughly the number of parameters times bytes per parameter, plus memory for context and overhead.
  • Quantization shrinks the size at some cost to quality, and longer context needs extra memory.
  • Check on your own examples whether a smaller version still suffices.

The question “will this model run on my machine” has a simple answer if you know three numbers: how many parameters the model has, how many bits each takes and how long a context you want to handle. The calculation below is an arithmetic estimate, so treat results as an order of magnitude, not an exact measurement. If you are only choosing a tool to run it, first read the comparison of Ollama, LM Studio and llama.cpp.

Weights: parameters times bytes

A model is stored as billions of numbers, that is parameters (weights). Each takes as much memory as the number of bits allotted to storing it. At 16-bit precision that is two bytes per parameter, at 8-bit one, at 4-bit half a byte. A model with seven billion parameters therefore takes about 14 GB at 16-bit precision, about 7 GB at 8-bit and about 3.5 GB at 4-bit. A model with seventy billion parameters needs ten times more: about 140 GB, 70 GB and 35 GB. On top of that comes the overhead of the program and the system, which you need to add to the result.

Estimated memory for weights alone (parameters times bytes)
16 bits8 bits4 bits
7B parameter modelabout 14 GBabout 7 GBabout 3.5 GB
30B parameter modelabout 60 GBabout 30 GBabout 15 GB
70B parameter modelabout 140 GBabout 70 GBabout 35 GB

Quantization: a smaller file, slightly worse quality

Quantization means storing weights with fewer bits. The file shrinks, and the model loads faster and fits in less memory. The price is usually some drop in quality, which depends on the model and the task. In practice 8-bit versions are usually close to the original, and heavier shrinking needs checking on your own examples. Tools such as llama.cpp and LM Studio use the GGUF format, in which you will meet several quantization variants of the same model; on the model’s page look for which variant the author recommends.

The decision rule is simple. Start with the variant that fits in memory with room to spare, run it on your cases, and only if the result is not enough try a larger variant or another model. Reaching too early for the largest variant simply because it “is better” often ends in slow work with no visible benefit.

Context takes memory too

Weights are not everything. The longer the context, the more memory is needed to handle it, and the Ollama documentation says so plainly: increasing the context length increases the memory requirement. By default Ollama picks the length according to the available graphics memory: below 24 GiB it is 4 thousand tokens, from 24 to 48 GiB 32 thousand, and from 48 GiB 256 thousand. Tasks that need large context, such as web search, agents and coding tools, according to the documentation should be set to at least 64 thousand tokens. This means a model that “fits” with the default context may not fit after raising it to the size an agent needs.

How to check what is really happening

The ollama ps command shows the size of the loaded model, the context length and a processor column split between GPU and CPU. The documentation explains that 100% GPU means it was loaded entirely into the card’s memory, and a split, for example 48% CPU and 52% GPU, means the model is partly in system memory, which slows work down. For best performance it advises avoiding offloading the model to the CPU.

  1. 01
    ParametersCheck the parameter count on the model card.
  2. 02
    BitsPick a quantization variant.
  3. 03
    WeightsMultiply parameters by bytes per parameter.
  4. 04
    ContextAdd memory for the planned length.
  5. 05
    MarginLeave room for the system and other programs.
  6. 06
    MeasureRun it and check ollama ps or equivalent.

A final practical tip: before you buy hardware for a model, run a test on what you already have with the smallest sensible variant. It often turns out that a smaller model suffices for your task, or on the contrary that using a cloud API is better than buying an expensive card. The choice between them depends on costs, which I cover in the article Task cost in tokens, and on whether you may send data off your computer. You will find all materials in the Local AI hub.

Last checked: 20 October 2026. Default values and command names change with program versions.

Frequently asked questions

How much memory does a model with seven billion parameters need?
Roughly 14 GB at 16-bit precision, about 7 GB at 8-bit and about 3.5 GB at 4-bit, plus memory for context and program overhead. That is an arithmetic estimate, not a measurement.
What is quantization?
It is storing model weights with fewer bits, for example 4 instead of 16. The file is smaller and faster to load, and quality usually drops somewhat, which you have to check on your own tasks.
Will a model fit if I have no graphics card?
It can run from system memory on the processor, only more slowly. Ollama shows in the ollama ps command what part of the model is on the GPU and what part on the CPU.
Why does a longer context take memory?
The model keeps information about every processed token, so a larger window requires more memory. Ollama's documentation notes that increasing the context length increases the memory requirement.

Sources

Local AI

Related