Unified memory for local AI

Mac LLM RAM Calculator

Pick a model, quantization, and context. See right away how much unified memory your Mac needs for a local LLM, including KV cache and room for macOS.

Step 1

What do you want to run locally?

Pick a task. The calculator sets a matching model and text length.

Step 2 · Model and text length

More settings Quantization, runtime, KV cache, sessions, and reserve. The defaults work for most setups.
Quantization How much the weights are compressed. Q4_K_M is the usual trade-off: about a quarter of the original size with little quality loss. Q8_0 is nearly lossless but needs almost twice the memory.
Runtime The program that runs the model. Each runtime uses some memory of its own. MLX is Apple's own framework and is often the fastest on a Mac.
KV cache precision The KV cache is the short-term memory for the text so far. F16 is the default. Q8_0 roughly halves it, but you have to enable it in the runtime.

Matching Macs

Only show this chip generation Filters only the Mac suggestions. The memory estimate stays the same.

Memory breakdown

18.3 GB
Model weights The actual model data. All of it stays in memory, even for MoE models where only part of it computes each token.
7.3 GB
KV cache Grows with context length and the number of sessions. In hybrid models such as Gemma 4 or Qwen 3.6 it grows much more slowly.
1.0 GB
Runtime & work buffers Runtime work buffers for intermediate results, roughly 0.5 to 2.4 GB depending on the program.
0.6 GB
macOS & apps Your chosen reserve for macOS and apps.
12.0 GB
Free headroom Room up to the recommended memory size. It keeps usage under 85%.
3.7 GB
Calculated need
20.3 GB

Memory estimate, not a speed promise: memory bandwidth and prompt length also drive speed.

How the calculation works

Unified memory estimate: Model weights + KV cache + runtime/work buffers + optional extra parts (vision, n-gram table) + your app reserve. “Not enough” only appears when this need exceeds available memory. Recommendations target at most 85% memory use.

Current KV reference profile: 48L · 8 KV-Heads · 128d

Estimate, not a benchmark: fitting in memory is not a speed promise. Prompt length, runtime version, model format, and image count change actual memory use. In most runtimes, you have to enable quantized KV cache manually.

Methodology & primary sources: llama.cpp GGUF, llama.cpp KV-Cache, Gemma 4, Qwen 3.6, Qwen 3.8, Qwen 3.5, Muse Glimmer, gpt-oss, Qwen 2.5, Llama 3.1. Interaction model checked against APXML.

Short answer

How much RAM does a local LLM need on a Mac?

A local LLM on a Mac needs space for its quantized weights, KV cache, runtime buffers, and macOS. As a rule of thumb at 4-bit (Q4) and 8K context: 16GB of unified memory runs 7B–8B models, 24–32GB covers 12B–32B, 64GB is the first practical tier for 70B, and 96–128GB leaves room for higher precision and long context.

Unified memory by model size at Q4_K_M and about 8K context
Model sizeQ4 weightsMinimumComfortable
3B–4B ≈ 2–3 GB 8 GB 16 GB
7B–8B ≈ 5 GB 16 GB 24 GB
12B–14B ≈ 8–9 GB 16 GB 24–32 GB
27B–32B ≈ 17–20 GB 32 GB 48 GB
70B ≈ 43 GB 64 GB 96–128 GB
100B–120B ≈ 60–70 GB 96 GB 128 GB
405B ≈ 249 GB 512 GB 512 GB

Weights follow llama.cpp’s Q4_K_M examples (8B ≈ 4.9GB, 70B ≈ 43.1GB, 405B ≈ 249.1GB); minimum and comfortable include KV cache, runtime and macOS. Read RAM guide · Last reviewed:

Model table

RAM needed for popular local models in 2026

Calculated with the same formula as the calculator above: Q4_K_M, Ollama, F16 KV cache, one session. “Tight fit” means 8K context with 5GB for macOS and a few apps. “Comfortable” means 32K context with an 8GB reserve and at most 85% memory use. Ollama downloads are often 1–4GB larger than pure Q4 weights because embeddings and vision towers stay at higher precision. The “Comfortable” column leaves room for that. gpt-oss ships in MXFP4. For the 120B model, this Q4 estimate sits a few GB above Ollama's 65GB file, so it errs on the safe side.

ModelReleasedQ4 weightsKV cache 8KKV cache 32KTight fitComfortableArchitecture
Qwen 3.5 9B 5.1GB 0.3GB 1.0GB 16GB 24GB Gated DeltaNet + attention, vision
Granite 4.2 8B 5.1GB 1.3GB 5.0GB 16GB 24GB full attention, text only
Gemma 4 12B 6.8GB 0.4GB 0.6GB 16GB 24GB hybrid attention, vision
gpt-oss 20B (MoE) 11.9GB 0.2GB 0.8GB 24GB 32GB MoE, 3.6B active, text only
Gemma 4 26B A4B (MoE) 14.8GB 0.3GB 0.5GB 24GB 32GB MoE, 4B active, all 26B resident
Qwen 3.8 27B 15.4GB 0.6GB 2.1GB 24GB 36GB Gated DeltaNet + attention, vision
Muse Glimmer 30B 16.0GB 0.2GB 0.5GB 24GB 32GB sliding window + global, vision
Qwen3 Coder 30B A3B (MoE) 17.4GB 0.8GB 3.0GB 24GB 36GB MoE, 3.3B active, coding, text only
Granite 4.2 30B 16.5GB 2.0GB 8.0GB 32GB 48GB full attention, text only
Gemma 4 31B 17.5GB 1.1GB 2.0GB 32GB 48GB hybrid attention, vision
Qwen 3.6 35B A3B (MoE) 19.9GB 0.2GB 0.7GB 32GB 48GB MoE, 3B active, Gated DeltaNet
Llama 3.1 70B 39.9GB 2.5GB 10.0GB 64GB 96GB full attention
gpt-oss 120B (MoE) 66.6GB 0.3GB 1.1GB 96GB 96GB MoE, 5.1B active, text only
Qwen 3.8 Flash Next 125B A6B (MoE) 42.2GB 0.3GB 0.9GB 128GB 128GB MoE, 6B active, 51B n-gram table, vision
GLM-5.3-Flash 320B A18B (MoE) 182.3GB 0.2GB 0.7GB 192GB 256GB MoE, 18B active, linear + sparse attention, vision

The math

Worked example: Qwen 3.8 27B with 32K context

Model weights (Q4_K_M)
15.4GB
KV cache and DeltaNet state
+ 2.1GB
Runtime and work buffers
+ 0.8GB
Vision & extra parts
+ 1.1GB
Reserve for macOS and apps
+ 8.0GB
Calculated need
= 27.4GB

This fits starting at 32GB. To stay under 85% memory use, you need 36GB. On a 24GB Mac, you need less context and a smaller app reserve.

KV cache

Why architecture matters as much as size

Full-attention models store keys and values for every token in every layer. Gemma 4 and Muse Glimmer mostly use sliding-window layers, while Qwen 3.6 and 3.8 mostly use Gated DeltaNet layers with a fixed-size state. That is why their cache grows much more slowly with longer context:

ModelKV cache at 32KKV cache at 128K
Llama 3.1 70B 10.0GB 40.0GB
Mistral Small 24B 5.0GB not supported
Gemma 4 31B 2.0GB 5.8GB
Muse Glimmer 30B 0.5GB 1.7GB
Qwen 3.8 27B 2.1GB 8.1GB

In practice

How to fit a bigger model

  1. Drop one quantization step

    Q4_K_M instead of Q6_K or Q8_0 cuts weight size by roughly a quarter to a half. Below Q4, quality drops noticeably on most models.

  2. Use less context

    Only allocate the context you need. With full-attention models like Llama 3.1 70B, dropping from 128K to 32K saves tens of gigabytes of KV cache.

  3. Quantize the KV cache

    Q8_0 KV cache roughly halves cache memory with little quality loss. In Ollama it needs flash attention and OLLAMA_KV_CACHE_TYPE; llama.cpp and LM Studio have their own switches.

  4. Pick a hybrid or MoE model

    Gemma 4, Qwen 3.6/3.8, and Muse Glimmer keep most layers on a small fixed or windowed cache. MoE models are fast for their size, but all experts still stay in memory.

  5. Close memory-heavy apps

    Browsers with many tabs, Docker, and Xcode can easily use 6–10GB. Check memory pressure in Activity Monitor: yellow or red means the model is pushing macOS into swap.

  6. Raise the GPU memory limit

    If the model fits your RAM but llama.cpp or LM Studio falls back to the CPU, the default GPU share is too small. On macOS 14 and later, sudo sysctl iogpu.wired_limit_mb=<MiB> raises it until the next reboot (0 restores the default). Leave at least 8GB for macOS.

Chip generations

Every Apple silicon generation from M1 through M6

The calculator covers every Apple silicon generation in our catalog, from M1 through M6, and separates current Macs from used ones.

M1 M1 · Pro · Max · Ultra Used & refurbished
M2 M2 · Pro · Max · Ultra Used & refurbished
M3 M3 · Pro · Max · Ultra M3 Ultra up to 512GB, replaced in Sept 2026
M4 M4 · Pro · Max No M4 Ultra; remaining stock and used only since fall 2026
M5 M5 · Pro · Max · Ultra MacBook Air/Pro, Mac mini Pro, Mac Studio, up to 512GB
M6 M6 Mac mini, 14″ MacBook Pro and iMac, up to 32GB

Use cases

Choose by task

The right Mac depends on the model and the work. Code, long documents, speech and images use memory differently.

FAQ

RAM calculator FAQ

How much RAM do I need to run a local LLM on a Mac?

At 4-bit quantization and moderate context, plan on 16GB of unified memory for 7B–8B models, 24–32GB for 12B–32B, 64GB for 70B, and 96–128GB for higher-precision 70B or 100B+ models. Longer context and parallel sessions add KV cache on top.

Is 16GB of unified memory enough for Ollama or LM Studio?

Yes, for 7B–8B models at Q4/Q5 with short to moderate context. 12B–14B models will load, but they leave little room for a browser and IDE. 24GB is a more comfortable starting point.

Can a Mac run a 70B model?

Yes. A 70B Q4_K_M file is about 43GB according to llama.cpp, so 64GB is the first practical tier with short context. 96GB or 128GB leaves room for longer context, higher-bit quantization, and other apps.

Does unified memory work like VRAM?

Partly. On Apple Silicon, the CPU and GPU share one memory pool, so the GPU can access far more memory than a typical consumer graphics card. macOS and every open app share that same pool, which is why the calculator holds back a reserve. One limit remains: by default, macOS lets the GPU keep only part of that pool resident (Metal’s recommendedMaxWorkingSetSize, measured at roughly two-thirds on smaller Macs and three-quarters on larger ones; llama.cpp logs the exact value). The calculator warns you when weights, KV cache, and buffers exceed that share of your Mac’s memory.

Which new local models fit which Mac (October 2026)?

At Q4 with Ollama: 16GB runs Qwen 3.5 9B and Gemma 4 12B. 24GB runs gpt-oss 20B, and runs Qwen 3.8 27B (August 2026) or Meta Muse Glimmer 30B (August 2026) only at short context. With 32–36GB, both get 32K context. gpt-oss 120B needs 96GB or more. Model list checked on Hugging Face and the Ollama library on October 4, 2026.

Do MoE models like Gemma 4 26B A4B or Qwen 3.6 35B A3B need less RAM?

No. Only 3B–4B parameters are active per token, which makes them fast, but all experts must stay in memory. Plan RAM for the full 26B or 35B weights. The real memory saving is their small KV cache at long context.

Can an 8GB Mac run a local LLM?

Only small models. 1B–4B text models at Q4, such as Llama 3.2 3B or Qwen3 4B, run with short context, because macOS itself needs several gigabytes. Multimodal models like Gemma 4 E4B already ship as files of about 10GB in Ollama. For regular local AI, 16GB is the practical minimum.

Does MLX use less memory than Ollama or LM Studio?

Not fundamentally. All of them load quantized weights, a KV cache, and runtime buffers into the same unified memory. Differences come from the quantization format and default context, so compare them at the same bit width and context length.

How accurate is this calculator?

It gives an estimate, not a benchmark. It adds model weights, KV cache, runtime buffers, optional components like vision or an n-gram table, and your app reserve, targeting at most 85% memory use. Runtime version, model format, and prompt length change actual usage.