How much RAM or VRAM do you need to run an LLM locally? See real model file sizes, a simple formula, context-length costs and what 8, 16, 32 and 64 GB can run.
Running a local LLM is mostly a memory question: can the model weights and the context fit? Illustration: ProductFire.
Key takeaways
A quick estimate: model file size is roughly parameters x bits per weight / 8. At Q4_K_M (about 4.9 bits per weight), an 8B model is about 4.9 GB, based on the llama.cpp project's own table.
The model weights are only part of the memory bill. Longer context needs extra memory, and your operating system and apps need RAM too.
For a first local model, 16 GB of RAM (or unified memory on a Mac) is a sensible starting point for 7B to 8B models, in line with LM Studio's own recommendation.
A GPU with enough VRAM is much faster. If the model does not fit, Ollama splits it between GPU and system RAM, which works but is slower.
Heavier quantization (like Q4) shrinks the file a lot compared with 16-bit, with some quality trade-off, so pick the smallest quantization you are happy with.
In this article
"Can my computer run a local LLM?" is mostly a memory question. A large language model has to sit in fast memory while it runs. If it does not fit, it either runs very slowly or not at all.
This guide shows how much RAM or VRAM you need, using real file sizes from the llama.cpp project and official documentation from Ollama and LM Studio.
The short answer
Your memory
Realistic starting point
8 GB
Small models, short context. LM Studio says 8 GB Macs work with smaller models and modest context
16 GB
7B to 8B models at 4-bit and often higher quality. LM Studio recommends 16 GB or more
32 GB
Larger mid-size models. Calculated 4-bit weights for a 14B model are about 8.6 GB; for a 32B model about 19.6 GB (see formula below)
64 GB and up
Very large models. Llama 3.1 70B at Q4_K_M is 43.1 GB on its own
These are starting points, not guarantees. The next sections show how to work out your own answer.
Step 1: Estimate the model size with a simple formula
A model file is basically the number of parameters multiplied by how many bits each parameter uses. So:
Quantization is how the bits per weight get reduced. The llama.cpp quantization table for Llama 3.1 8B shows the exact numbers:
Quantization
Bits per weight
Size (GiB)
Q2_K
3.16
2.95
Q4_K_M
4.89
4.58
Q5_K_M
5.70
5.33
Q6_K
6.56
6.14
Q8_0
8.50
7.95
F16 (no quantization)
16.00
14.96
Source: llama.cpp quantization README, Llama 3.1 8B. GiB is slightly bigger than GB (1 GiB = 1.074 GB).
Check the formula: 8 billion parameters × 4.89 bits ÷ 8 ≈ 4.9 GB. That matches the llama.cpp "memory and disk requirements" table, which lists Llama 3.1 8B at 4.9 GB in Q4_K_M, compared with 32.1 GB at full 32-bit precision (F32). The llama.cpp README calls that column the original size, and the number matches 8 billion parameters at 4 bytes (32 bits) each.
Llama 3.1 size
Original (F32)
Q4_K_M
8B
32.1 GB
4.9 GB
70B
280.9 GB
43.1 GB
405B
1,625.1 GB
249.1 GB
The Ollama library shows nearly the same download sizes: 4.9 GB for llama3.1:8b, 43 GB for 70b and 243 GB for 405b, all with a 128K context window.
For other model sizes, you can use the same formula as an estimate. Using Q4_K_M's 4.89 bits per weight (my own calculation, not a published figure for those models):
Parameters
Estimated Q4_K_M weights
3B
about 1.8 GB
8B
about 4.9 GB (matches llama.cpp)
14B
about 8.6 GB
32B
about 19.6 GB
70B
about 43 GB (matches llama.cpp)
Real files differ a little by model design, so check the exact size on the model page before you download.
Step 2: Add room for context (the KV cache)
The weights are only the start. The model also keeps your conversation, your prompt and any pasted documents in memory. The longer the context, the more memory it needs.
Ollama's context length docs say that setting a larger context length increases the memory required to run a model. They also say Ollama chooses a default context based on your VRAM:
VRAM
Default context
Under 24 GiB
4k
24-48 GiB
32k
48 GiB or more
256k
Tasks that need large context, such as web search, agents and coding tools, should be set to at least 64,000 tokens, according to the same page.
How much extra memory is that? One independent test by Arynwood (Ollama 0.11.4 on an RTX 3060 12 GB, September 2026) measured Qwen2.5 7B at Q4_K_M. Memory went from 5.4 GB at 2,048 tokens of context to 8.9 GB at 32,768 tokens. That is about 65% more memory (8.9 / 5.4 = 1.65), from one model on one machine, so treat it as an example, not a rule. It shows why a model that "fits" at a short context can stop fitting at a long one. In the same test, going from 4,096 to 16,384 tokens added about 25% (5.6 GB to 7.0 GB), while 32,768 tokens added about 59% (8.9 GB). So the common "add 20-30% for context" shortcut only holds for fairly short contexts.
Measured sizes at 4,096 context
The same Arynwood test also reports what Ollama showed for each model at its default 4,096-token context. These figures already include the memory reserved for that context, using the default 4-bit downloads (Q4_K_M or Q4_0):
Model (Arynwood test)
Memory at 4,096 context
Llama 3.2 3B
3.3 GB
Qwen2.5 7B, Mistral 7B, Llama 3 8B
5.6 to 5.8 GB
Qwen2.5 Coder 14B
10.4 GB
DeepSeek Coder 33B
21.1 GB
For the 7B to 33B models in that table, the measured figure works out to about 0.64 to 0.81 GB per billion parameters (the small 3B model is higher, at about 1.03). That matches Arynwood's own rule of thumb: budget about 0.6 to 0.8 GB per billion parameters for 7B and larger (small models need more, about 1 GB per billion). Two of the larger models did not fully fit on that 12 GB card: Arynwood reports that 27% of gpt-oss 20B (14.9 GB) and 47% of DeepSeek Coder 33B ran from system RAM.
Step 3: Leave room for your computer
Your operating system, browser and other apps use memory too. A simple rule I use: keep a few GB free beyond the model and context. It is a rule of thumb, not an official figure.
Mac: Apple Silicon (M1/M2/M3/M4), macOS 14.0 or newer, and 16 GB+ RAM recommended. 8 GB Macs may work with smaller models and modest context sizes. Intel Macs are not supported.
Windows: x64 with AVX2 or ARM (Snapdragon X Elite), at least 16 GB of RAM recommended, and at least 4 GB of dedicated VRAM recommended.
Linux: x64 or ARM64, Ubuntu 20.04 or newer.
RAM vs VRAM vs unified memory
System RAM is used when the model runs on the CPU, or for any part that does not fit on the GPU.
VRAM is the GPU's own memory. If the model fits there, it runs on the GPU, which is usually much faster.
Unified memory (Apple Silicon Macs) is one shared pool for CPU and GPU. Ollama's quickstart recommends "8 GB of available VRAM, or unified memory on a Mac" for its example model, Gemma 4 E2B, a download of about 7.2 GB.
Ollama's quickstart also says that with less VRAM, Ollama can use system RAM, but responses may be slower.
You can check where your model is running with ollama ps. According to the Ollama FAQ, the PROCESSOR column shows:
100% GPU: the model is fully on the GPU
100% CPU: the model is fully in system memory
a split such as 48%/52% CPU/GPU: the model is partly on each
If you see a big CPU share and slow speed, a smaller model, a lower-bit quantization or a shorter context will usually help.
What can 8, 16, 32 and 64 GB run?
This table uses the file sizes above plus my own safety margin. It is a planning guide, not a benchmark.
Memory
Sensible choices
Notes
8 GB
1B to 4B models, or an 8B at Q4 with short context
Llama 3.1 8B Q4_K_M is 4.9 GB, which leaves little room on an 8 GB machine once the OS is running
16 GB
7B to 8B at Q4 to Q8
Llama 3.1 8B Q8_0 is 7.95 GiB, so there is room for context
32 GB
14B at Q4 to Q8, or up to about 30B at Q4
A 32B at Q4 is roughly 19.6 GB by the formula
64 GB
70B at Q4 (43.1 GB) with moderate context
Leaves roughly 20 GB for context and system
128 GB+
Very large models
405B at Q4_K_M is 249.1 GB, so even 128 GB is not enough
Which quantization should you choose?
The llama.cpp table also lists speed. For Llama 3.1 8B in that table, text generation ran at about 72 tokens per second with Q4_K_M, about 51 with Q8_0 and about 29 with F16 (on the hardware llama.cpp tested, so your numbers will differ). In general, smaller files mean less data to move per token, which helps speed.
Practical advice:
Start with Q4_K_M. It is a widely used balance of size and quality.
Go up (Q5, Q6, Q8) if you have spare memory and want higher quality.
Go down (Q3, Q2) only if you must fit a bigger model. Quality can drop more, so test it on your own tasks.
Quick checklist before you download a model
Find the model's file size on its page (Ollama and Hugging Face both list it).
Add roughly 20-30% for context if you will use short contexts, and more for long ones (about 65% in the 2K-to-32K test above), then a few GB for your system. (Rule of thumb.)
Decide your context length. Agents and coding tools need much more than a basic chat.
Pick the machine type: GPU VRAM for speed, or unified memory on a Mac.
Run ollama ps after loading to confirm whether it is fully on the GPU.
Key points to remember
Local LLM memory is simple maths plus a safety margin: weights + context + your operating system. For most people, a 16 GB machine and a 7B to 8B model at 4-bit is the easiest place to start. Bigger models are possible, but file sizes grow fast: Llama 3.1 70B is 43.1 GB even after quantization.
It depends on the model size and quantization. A 7B to 8B model at 4-bit quantization has weights of roughly 4 to 5 GB (Llama 3.1 8B Q4_K_M is 4.9 GB per llama.cpp), so 16 GB of system RAM is a comfortable starting point. LM Studio recommends 16 GB or more on Mac and Windows.
Can I run an LLM on 8 GB of RAM?
+
Yes, but stick to small models and short context. LM Studio says 8 GB Macs can still be used with smaller models and modest context sizes. Ollama recommends 8 GB of available VRAM (or unified memory on a Mac) for its Gemma 4 E2B quickstart model, which downloads at about 7.2 GB.
Is VRAM or RAM more important for running local LLMs?
+
VRAM matters for speed. If the whole model fits in GPU memory it runs on the GPU. If not, Ollama can split it across GPU and system RAM, or run it fully on the CPU, but responses may be slower. On Apple Silicon, unified memory is one shared pool.
How much memory does a bigger context window use?
+
More context needs more memory. Ollama's docs say a larger context length increases the memory required. In one third-party test with Qwen2.5 7B on Ollama, raising context from 2,048 to 32,768 tokens increased memory from 5.4 GB to 8.9 GB.
How much RAM does a 70B model need?
+
The llama.cpp project lists Llama 3.1 70B at 43.1 GB in Q4_K_M, and Ollama lists llama3.1:70b at 43 GB. Add room for context and your operating system, so plan for 48 GB or more of combined fast memory, or more for long context.
Mo Arfaj is the founder and editor of ProductFire. He writes and edits explainers on AI, tech, business and gaming, and checks every article before it is published.
Comments (0)
No comments yet. Be the first to share your view.