Skip to main content
Section 2

Your hardware and what it can run

RAM, VRAM, and the math for what fits.

5 lessons25-question quiz
2.1

RAM vs VRAM, and why it matters

6 min read

Every model, before it can answer anything, has to be loaded into memory. Your computer has more than one kind of memory, and which kind a model lands in changes how fast it runs. The two that matter for running AI locally are RAM (system memory) and VRAM (video memory, on a graphics card).

VRAM is memory built into a GPU, sitting right next to the chip that does the math. It is very fast, which is exactly what the repeated, heavy number-crunching of running a model needs. RAM is the general-purpose memory your whole computer uses for everything: your browser, your operating system, and, if there is no room in VRAM, your model too. RAM is typically slower to read from for this kind of workload, and it is farther from the processor doing the work.

The rule that governs everything else

A model must fit in whichever memory it runs on. If you run it on a GPU, its weights need to fit in that GPU's VRAM. If you run it on the CPU instead, its weights need to fit in system RAM. Fit is not a nice-to-have; a model that does not fit either will not load at all, or will run so slowly it is not usable.

System RAMGPU VRAM
Lives onThe motherboard, shared by the whole computerThe graphics card itself
Speed for this jobSlower for model inferenceMuch faster for model inference
Typical amountOften 16 to 64 GB on a modern machineOften 6 to 24 GB on a consumer GPU, varies widely
When a model uses itCPU inference, or when a model does not fit in VRAMGPU inference, whenever the model and its working memory fit
RAM vs VRAM, at a glance
Key idea
A model has to fit in whichever memory runs it. VRAM is fast but usually smaller; system RAM is larger but slower. This single fact drives most of the sizing decisions in this section.
Some machines, notably Apple's Apple Silicon Macs, blur this line with a single pool of memory shared between CPU and GPU. That case gets its own lesson shortly.
Key terms
RAM
System memory, shared by the whole computer.
More

Random Access Memory. Every running program, including a model on CPU inference, draws from this pool.

VRAM
Video memory, built into a GPU for fast access by the graphics chip.
More

Short for video RAM. It sits physically close to the GPU and is much faster to read from than system RAM, which is why GPUs are the preferred place to run a model when it fits.

2.2

Model size and memory

6 min read

You already know a model's size is measured in parameters, such as 8B for eight billion. What actually determines whether it fits on your machine is how much memory those parameters take up once loaded, and that depends on more than the parameter count alone.

The rough formula

Each parameter is stored using some number of bits. A freshly trained model often stores each one at 16 bits. A quantized model, covered in depth in the GGUF quantization guide, stores each one at fewer bits, commonly 8, 6, 5, 4, 3, or 2, trading some precision for a much smaller file. The approximate memory for the weights alone is:

Approximate formula
memory (bytes) ≈ parameters × bits-per-weight ÷ 8

That covers only the weights. On top of that, running a model needs some working memory for the current conversation, called the KV cache, plus overhead from the software actually running the model. The next two lessons unpack both of those. For now, treat the formula above as the floor, not the whole picture.

Quant levelApprox. bits/weightApprox. size
16-bit (unquantized)16roughly 16 GB
8-bit (Q8_0)about 8.5roughly 8.5 GB
6-bit (Q6_K)about 6.6roughly 6.5 GB
4-bit (Q4_K_M)about 4.9roughly 5 GB
3-bit (Q3_K_M)about 4.0roughly 4 GB
Approximate size for an 8B model at different quantization levels (weights only, real figures vary by model)
Key idea
Approximate memory is parameters times bits-per-weight, divided by 8, plus overhead on top. Fewer bits per weight means a smaller file and less memory, at some cost to quality.
These numbers are approximate and vary by model architecture and by how a specific file was quantized. Always check the actual file size on the model's download page before committing to it.
Key terms
Quantization
Storing each parameter with fewer bits to shrink a model's memory footprint.
More

Covered in full in the GGUF quantization guide, including exactly how much quality each level costs.

Bits per weight
How many bits are used to store each parameter. Fewer bits means a smaller, less precise model.
2.3

CPU, GPU, and unified memory

6 min read

Where a model actually runs, not just where it is stored, changes how fast it feels to use. There are roughly three setups you will run into.

The three setups

  • GPU inference: the model's weights fit in VRAM and a dedicated graphics card does the work. This is generally the fastest option when it fits, because VRAM is fast and the GPU is built for exactly this kind of math.
  • CPU inference: the model runs using the processor and system RAM, either because there is no GPU or the model does not fit in VRAM. It works on almost any machine, but token generation is typically noticeably slower than on a capable GPU.
  • Unified memory: some machines, most notably Apple Silicon Macs, share a single pool of fast memory between the CPU and GPU instead of giving the GPU its own separate VRAM. That shared pool can be large, which lets these machines run bigger models than their GPU alone would suggest, though not always as fast as a discrete GPU with the equivalent amount of dedicated VRAM.
SetupSpeedTypical memory ceiling
GPU with dedicated VRAMFastest, when the model fitsLimited to that card's VRAM, often 6 to 24 GB
CPU only, using system RAMSlower, but works almost anywhereCan be large, limited by system RAM
Unified memory (e.g. Apple Silicon)Between the two, varies by chipCan be large, shared with the rest of the system
Where a model runs, roughly compared
Key idea
A dedicated GPU is generally fastest when the model fits its VRAM. CPU inference is the fallback that works nearly everywhere, just slower. Unified memory offers a large shared pool that can fit bigger models, at speed that varies by machine.
None of this changes the core rule from the first lesson: the model still has to fit in whichever memory pool actually runs it, whether that pool is dedicated VRAM, system RAM, or a unified pool shared between the two.
Key terms
GPU inference
Running a model on a graphics card, using its VRAM.
More

Generally the fastest setup when the model fits in the available VRAM.

CPU inference
Running a model on the processor, using system RAM instead of a GPU.
More

Works on nearly any machine but is typically slower than running the same model on a capable GPU.

Unified memory
A single pool of memory shared between the CPU and GPU, instead of separate RAM and VRAM.
More

Common on Apple Silicon Macs. It can let a machine run larger models than its GPU alone would suggest, since the GPU can draw on the whole shared pool.

2.4

Estimating what fits

6 min read

You now have the pieces: the formula from lesson two, and the idea from the GGUF guide that weights are only the floor. Here is how to put them together before you download anything.

  1. Pick a model and a quant level, then estimate the weight size: parameters times bits-per-weight, divided by 8. An 8-billion-parameter model at roughly 4.9 bits/weight (a common 4-bit quant) works out to about 8,000,000,000 × 4.89 ÷ 8, which is approximately 4.9 GB.
  2. Add room for the KV cache, the working memory that grows with your context window (how much conversation and text the model is holding at once) and the number of layers and attention heads in the model. A short chat adds relatively little; a long conversation or a large pasted document can add real gigabytes.
  3. Add room for runtime overhead: the software actually running the model, plus buffers, plus anything else sharing the same GPU, such as your display. This is not a number you can shave to zero.
  4. Compare the total, not just the weight size, against the memory you actually have available. As a starting rule of thumb, leave roughly 10 to 20% of your VRAM free above the weight size for short conversations, and budget more if you plan to run a large context window regularly.
  5. If the total is close to your limit, drop to a smaller model or a lower quant level, or plan to run a shorter context window, and re-check the math.

Worked example: you have a GPU with 8 GB of VRAM. An 8B model at a 4-bit quant needs roughly 5 GB for weights. That leaves about 3 GB for the KV cache and runtime overhead, which is comfortable for a short-to-medium conversation but will get tight if you paste in a very large document or run a long back-and-forth session.

Key idea
Sizing is weights plus KV cache plus overhead, not weights alone. If a quant just barely fits the raw weights, it will likely not fit once you actually start using it.
The GGUF quantization guide covers this same headroom point in more depth, including how context length and quant choice interact. Worth a second read once you are choosing a specific model.
Key terms
KV cache
Working memory that grows with how much conversation and context a model is currently holding.
More

Short for key-value cache. It scales with context length and the model's number of layers and attention heads, and it sits on top of the weight memory, not instead of it.

Runtime overhead
Memory used by the software running the model, and anything else sharing the same GPU.
More

Not part of the model itself, but unavoidable. Budget for it rather than assuming every free gigabyte belongs to the model.

2.5

Picking a model size for your machine

6 min read

Put everything in this section together and you get a rough starting table. Treat it as a first guess, not a guarantee. Always check the exact file size on the model's download page, and use the math from the last lesson for anything close to your limit.

Memory you haveA reasonable starting pointWhy
6 to 8 GB (VRAM or RAM)A 7 to 8B model at a 4-bit quant (around Q4_K_M)Weights land under roughly 5 GB, leaving some room for the KV cache and overhead
10 to 12 GBA 7 to 8B model at a higher quant (Q6_K or Q8_0), or a somewhat bigger model at a 4-bit quantEnough headroom to spend on precision, or on more parameters instead
16 to 24 GBA 13 to 14B model at a 5 to 6-bit quant, or a 30B-class model at a 4-bit quantThis is roughly where a bigger model at a lower quant starts beating a smaller model at a higher one
Under 6 GB, or CPU-onlyA small model (roughly 1 to 3B) at a 4-bit quant, or a bigger model at a lower quant, expecting slower generationThe same math still applies. Less memory means either fewer parameters or fewer bits per weight
General starting points. Approximate, and varies by model architecture, context length, and what else is running on the machine.

This table mirrors, in general terms, the hardware guidance in the GGUF quantization guide, which has the fuller version with exact measured sizes for one model family. It is a starting point for exploration, not a hard rule: model architectures differ, mixture-of-experts models follow different math than dense models, and your actual usage (long documents, long conversations) shifts the numbers.

Key idea
Match model size and quant level to the memory you actually have, leave headroom beyond the weights, and confirm with the real file size before you download. When in doubt, the safer starting point is a smaller model at a higher quant rather than the reverse.
The next section moves from sizing math to actually running something: picking a runtime and getting your first local model talking back to you.
Key terms
Dense model
A model that uses all of its parameters for every token, the common case this table assumes.
More

Contrast with a mixture-of-experts model, which activates only part of its parameters per token, so it uses less compute per token and runs faster, but all of its experts still have to fit in memory, so you size it on total parameters.

Section 2 quiz

25 questions. Pass at 75% to master this section. Retakes are unlimited, and the quiz is where the learning sticks.

Section 2 quiz · Your hardware and what it can runQuestion 1 of 25

What is VRAM?