Skip to content
ProductFire

How Much RAM to Run an LLM Locally? 2026 Guide

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.

By , Founder and Editor-in-Chief

Published 8 min read

Illustration of a laptop with a glowing processor chip and a graphics card on a desk, with neural network lines flowing from the screen
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.

"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:

file size (GB) ≈ parameters (billions) × bits per weight ÷ 8

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).

Bar chart of Llama 3.1 8B file size by quantization: Q2_K 2.95 GiB, Q4_K_M 4.58 GiB, Q5_K_M 5.33 GiB, Q6_K 6.14 GiB, Q8_0 7.95 GiB, F16 14.96 GiB

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
Grouped bar chart comparing original (F32) and Q4_K_M file sizes for Llama 3.1 8B, 70B and 405B on a log scale: 32.1 vs 4.9 GB, 280.9 vs 43.1 GB, 1,625.1 vs 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.

Bar chart showing memory used by Qwen2.5 7B on Ollama rising from 5.4 GB at 2,048 tokens of context to 8.9 GB at 32,768 tokens

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.

LM Studio's system requirements are a helpful official reference:

  • 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

  1. Find the model's file size on its page (Ollama and Hugging Face both list it).
  2. 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.)
  3. Decide your context length. Agents and coding tools need much more than a basic chat.
  4. Pick the machine type: GPU VRAM for speed, or unified memory on a Mac.
  5. 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.

If you are choosing software, read our comparison of Ollama vs LM Studio. If you want to give a local model your own documents, see RAG vs fine-tuning. More explainers are in the ProductFire AI section.

Frequently asked questions

How much RAM do I need to run an LLM locally?

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.

Sources

  1. llama.cpp quantize tool README - memory/disk requirements and quantization table
  2. Ollama library: llama3.1 (model sizes and context window)
  3. Ollama docs: Context length
  4. Ollama docs: Quickstart
  5. Ollama docs: FAQ (how to tell if a model is on GPU or CPU)
  6. LM Studio docs: System Requirements
  7. How Much VRAM for a 7B, 14B, 20B or 32B Model? Measured - Arynwood (third-party test)

Spotted a mistake? Read our corrections policy or tell us.

Mo Arfaj

About the author

Mo Arfaj, Founder and Editor-in-Chief

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.

More from MoHow we fact-check

Comments (0)

No login needed. Your name and comment are public.

0/1000

No comments yet. Be the first to share your view.

Keep reading

The ProductFire Brief

Get explainers like this every week

Free, one email a week. Unsubscribe anytime.

  1. Company RevenueHow Does Marvell Make Money in 2026? Q3 FY27 Preview
  2. EntrepreneurshipMissed Self Assessment Registration Deadline: What to Do
  3. BusinessGmail Send As Ends Jan 2027: 6 Custom Domain Alternatives
  4. Company RevenueHow Does Dell Make Money? AI Servers, PCs & a $132B Backlog
  5. AIAre GGUF Models Safe? 5 Malware Models on Hugging Face