Your hardware and what it can run
RAM, VRAM, and the math for what fits.
RAM vs VRAM, and why it matters
6 min readEvery 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 RAM | GPU VRAM | |
|---|---|---|
| Lives on | The motherboard, shared by the whole computer | The graphics card itself |
| Speed for this job | Slower for model inference | Much faster for model inference |
| Typical amount | Often 16 to 64 GB on a modern machine | Often 6 to 24 GB on a consumer GPU, varies widely |
| When a model uses it | CPU inference, or when a model does not fit in VRAM | GPU inference, whenever the model and its working memory fit |
- 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.
Model size and memory
6 min readYou 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:
memory (bytes) ≈ parameters × bits-per-weight ÷ 8That 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 level | Approx. bits/weight | Approx. size |
|---|---|---|
| 16-bit (unquantized) | 16 | roughly 16 GB |
| 8-bit (Q8_0) | about 8.5 | roughly 8.5 GB |
| 6-bit (Q6_K) | about 6.6 | roughly 6.5 GB |
| 4-bit (Q4_K_M) | about 4.9 | roughly 5 GB |
| 3-bit (Q3_K_M) | about 4.0 | roughly 4 GB |
- 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.
CPU, GPU, and unified memory
6 min readWhere 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.
| Setup | Speed | Typical memory ceiling |
|---|---|---|
| GPU with dedicated VRAM | Fastest, when the model fits | Limited to that card's VRAM, often 6 to 24 GB |
| CPU only, using system RAM | Slower, but works almost anywhere | Can be large, limited by system RAM |
| Unified memory (e.g. Apple Silicon) | Between the two, varies by chip | Can be large, shared with the rest of the system |
- 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.
Estimating what fits
6 min readYou 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
Picking a model size for your machine
6 min readPut 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 have | A reasonable starting point | Why |
|---|---|---|
| 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 GB | A 7 to 8B model at a higher quant (Q6_K or Q8_0), or a somewhat bigger model at a 4-bit quant | Enough headroom to spend on precision, or on more parameters instead |
| 16 to 24 GB | A 13 to 14B model at a 5 to 6-bit quant, or a 30B-class model at a 4-bit quant | This is roughly where a bigger model at a lower quant starts beating a smaller model at a higher one |
| Under 6 GB, or CPU-only | A small model (roughly 1 to 3B) at a 4-bit quant, or a bigger model at a lower quant, expecting slower generation | The same math still applies. Less memory means either fewer parameters or fewer bits per weight |
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.
- 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.
What is VRAM?