Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

RAM for Local AI: How Much You Need

· 6 min read · Home Tech

In this article
  1. Why RAM Matters for Local AI
  2. How Local AI Uses RAM
  3. RAM vs. VRAM: What's the Difference?
  4. How Much RAM Do You Really Need?
  5. What Changes After Upgrading RAM?
  6. How to Choose the Right RAM for Your AI Workload
  7. Common Problems and Misconceptions
  8. Cost Considerations
  9. Frequently Asked Questions

For local AI, you need at least 16 GB of RAM for basic use, but 32 GB is the practical starting point for running modern large language models comfortably. Upgrading from 16 GB to 32 GB or more dramatically expands what models you can run, how fast they respond, and whether you can multitask while they work.

Why RAM Matters for Local AI

When you run AI locally—like Llama, Mistral, or Stable Diffusion—the model files must be loaded into memory. Unlike cloud AI, where the heavy lifting happens on remote servers, local AI uses your computer's RAM (and sometimes VRAM) to hold the model weights, the context window, and the working data. If your RAM is too small, the system either refuses to load the model or spills over to slower storage, making generation painfully slow.

The key relationship is simple: bigger models need more RAM. A 7-billion-parameter model in 4-bit quantization requires roughly 4–6 GB just for the weights, while a 70-billion-parameter model can need 35–40 GB. Add the operating system, the inference software, and your browser, and the total climbs quickly.

How Local AI Uses RAM

Local AI software (like Ollama, LM Studio, or llama.cpp) loads the model into RAM at startup. The model's size is determined by the number of parameters and the precision (quantization level). A 13B model in 8-bit precision uses about 13 GB; the same model in 4-bit uses about 7 GB. The context window—how much text the model can remember—also consumes RAM, roughly 0.5–1 GB per 2048 tokens depending on the model.

During generation, the CPU reads the model from RAM for every token. Faster RAM (higher MHz) and dual-channel configurations reduce latency. If you have integrated graphics (like Intel Iris or AMD Radeon), the GPU shares system RAM, so you need even more headroom.

RAM vs. VRAM: What's the Difference?

VRAM (video RAM) is the memory on your graphics card. It's much faster than system RAM and is the preferred place for AI models. If you have a GPU with 8 GB VRAM, you can run models up to about 7B parameters in 4-bit entirely on the GPU. Larger models must be split between VRAM and system RAM, or run entirely on CPU—which is slower but works with enough system RAM.

Upgrading system RAM does not increase VRAM. They are separate pools. However, if you use CPU inference (no GPU), system RAM is everything. For most users, a balanced setup: a GPU with 8–12 GB VRAM and 32 GB system RAM is the sweet spot for running 7B–13B models with reasonable speed.

How Much RAM Do You Really Need?

Here's a practical breakdown based on model size and quantization:

  • 16 GB RAM: Good for 7B models in 4-bit (about 4 GB) plus overhead. You can run small models, but multitasking is limited. You'll likely close your browser to free memory.
  • 32 GB RAM: Comfortably runs 13B models in 4-bit (7–8 GB) and even 30B models in 4-bit (about 20 GB) with no other heavy apps open. This is the recommended baseline for most enthusiasts.
  • 64 GB RAM: Allows 70B models in 4-bit (35–40 GB) with room for the OS and other software. Also great for running multiple models simultaneously or using large context windows.
  • 128 GB+ RAM: Overkill for most, but useful for researchers running huge models or fine-tuning on CPU.

Remember, these are just for the model weights. Add 4–8 GB for the OS and other programs. If you're using Windows, plan for more overhead than Linux.

What Changes After Upgrading RAM?

Upgrading from 16 GB to 32 GB can transform your local AI experience:

  • Bigger models: You can move from 7B to 13B or 30B models, which produce more coherent and knowledgeable responses.
  • Longer context: With more RAM, you can increase the context window, allowing the AI to remember more of your conversation or analyze longer documents.
  • Faster generation: If your previous setup used swap (pagefile), the upgrade eliminates disk thrashing, speeding up token generation dramatically.
  • Multitasking: You can keep your browser, IDE, or other apps open while the AI runs, without hitting memory limits.
  • Better quantization: You might choose higher precision (e.g., 8-bit instead of 4-bit) for better output quality, at the cost of more RAM.

How to Choose the Right RAM for Your AI Workload

Start by deciding which models you want to run. Check the model's parameter count and the quantization you prefer. Add 8 GB for the OS and other software. That's your target RAM. For example, if you want to run a 13B model in 4-bit (7 GB), you need at least 15 GB, so 32 GB is safe.

Also consider your motherboard's maximum RAM capacity and the number of slots. If you have two slots and 16 GB total, you can replace with 2x16 GB for 32 GB. Check if your CPU supports dual-channel memory—it does for almost all modern CPUs—and install RAM in pairs for best performance.

Common Problems and Misconceptions

"More RAM is always better"—not entirely. Once you have enough to hold the model and context, extra RAM doesn't speed up generation. The bottleneck becomes CPU speed or memory bandwidth. However, having too little is worse.

"I have a 16 GB GPU, so I don't need much system RAM"—partially true. The GPU handles the model, but the system still needs RAM for the OS, the inference software, and any data you feed. 16 GB system RAM is still a good minimum.

"RAM speed doesn't matter"—for CPU inference, it does. Faster RAM (e.g., 3600 MHz vs. 2400 MHz) can improve token generation speed by 10–20% because the CPU reads model weights from RAM constantly.

Cost Considerations

RAM prices fluctuate, but as of 2025, 16 GB DDR4 costs around $30–40, while 32 GB DDR4 is $60–80. DDR5 is pricier but faster. For a new build, 32 GB is a cost-effective sweet spot: it's only slightly more than 16 GB but doubles your capability. If you're on a tight budget, start with 16 GB and upgrade later—most motherboards have spare slots.

Frequently Asked Questions

Can I run local AI with 8 GB RAM? Yes, but only very small models (1–3B parameters) in 4-bit. You'll likely need to close all other applications and may experience slow generation. It's not recommended for serious use.

Does RAM speed affect AI performance? Yes, especially for CPU inference. Higher frequency and dual-channel configuration reduce the time to read model weights, improving tokens per second. The effect is modest but noticeable.

Is 32 GB RAM enough for Stable Diffusion? Yes, for most Stable Diffusion models (1.5, XL), 32 GB is plenty. The image generation happens on the GPU, so system RAM is mainly for the OS and the model's text encoder. Even 16 GB works, but 32 GB gives headroom.

Can I use a pagefile instead of RAM? Technically yes, but it's extremely slow. The OS will swap to disk, and generation speed will drop to a crawl. It's better to have enough physical RAM.

What's the difference between RAM and VRAM for AI? VRAM is faster and directly connected to the GPU. Models run best when fully in VRAM. System RAM is slower but much larger. If a model doesn't fit in VRAM, the software can offload layers to system RAM, but with a speed penalty.

Will upgrading RAM improve my LLM's answer quality? Indirectly, yes. With more RAM, you can run a larger model or use higher precision, both of which typically produce better answers. But simply adding RAM without changing the model won't improve output.