Skip to content
ProductFireProductFire

How to Run an LLM Locally on a Mac: Setup, Best Models and Memory Math

Any Apple silicon Mac can run a local AI model, but memory decides which one. macOS lets the GPU use roughly three-quarters of unified memory on most Macs, so a 16GB MacBook Air runs a 9B model while a 32GB Mac runs a 27B model comfortably. Here's the setup, our fit table and speed math for every current Mac chip.

Published 8 min read

A silver MacBook Pro open on a wooden table beside the headline "How to run an LLM locally on a Mac"
Any Apple silicon Mac can run a local model; memory decides which one. Photo: AzureSaturn / Wikimedia Commons, CC0. Cropped, graphic by ProductFire.

Key takeaways

  • The easiest way to run an LLM on a Mac is Ollama or LM Studio. Install the app, download a model, and chat offline in about 10 minutes.
  • On 16GB to 48GB Macs, macOS lets the GPU use about 75% of unified memory by default, so a 16GB Mac has roughly 12GB for the model and its context.
  • By our math, a 16GB Mac fits Qwen3.5 9B, a 24GB Mac fits Gemma 4 26B A4B or Qwen3.8 27B at IQ4_XS, and a 32GB Mac fits Qwen3.8 27B at Q4_K_M with 32K context.
  • Memory bandwidth sets speed. A 27B Q4 model tops out near 9 tokens per second on an M5 MacBook Air, 18 on M5 Pro and 37 on M5 Max.
  • Mixture-of-experts models such as Gemma 4 26B A4B run several times faster than dense models of the same size, because only a few billion parameters work on each token.

A Mac is one of the easiest computers to run a local AI model on. Apple silicon shares one pool of fast memory between the CPU and GPU, so a laptop with 32GB can load a model that would need an expensive graphics card on a PC.

The setup takes about 10 minutes. The hard part is choosing a model that fits, because macOS doesn't give the GPU all of your memory. We did the math for every current Mac, from a 16GB MacBook Air to a Mac Studio with M5 Ultra.

Running an LLM on a Mac at a glance Answer
Easiest apps Ollama (terminal + app), LM Studio (full chat app)
Works on Apple silicon Macs (M1 and newer), macOS 14+ for LM Studio
Memory the GPU can use About 75% on 16-48GB Macs by default
16GB Mac Qwen3.5 9B, Gemma 4 12B at 4-bit
24GB Mac Gemma 4 26B A4B, Qwen3.8 27B IQ4_XS
32GB Mac Qwen3.8 27B Q4_K_M with 32K context
Speed ceiling, 27B Q4 ~9 tok/s (M5) to ~72 tok/s (M5 Ultra)

Sources: Apple specs, Ollama and LM Studio docs; ProductFire math from Hugging Face file sizes, Dec. 2, 2026.

How do you run an LLM locally on a Mac?

Download Ollama or LM Studio, open it, and pick a model. In Ollama, type a command such as "ollama run qwen3.5:9b" in Terminal and it downloads and starts the model. In LM Studio, search the built-in model browser, click download, then load the model and chat. Both run entirely on your Mac.

Here are the steps for each.

Ollama:

  1. Download the Mac app from ollama.com and drag it to Applications.
  2. Open Terminal and run "ollama run gemma4:12b" (or another tag from the Ollama library).
  3. Wait for the download, then type your question. Type /bye to exit.
  4. Other apps can now talk to Ollama's local server, which is how many coding tools and chat front ends connect.

LM Studio:

  1. Download LM Studio from lmstudio.ai. It needs macOS 14 or newer, per its system requirements.
  2. Open the Discover tab and search for a model, such as Qwen3.8 27B.
  3. Pick a download. On a Mac you'll see both MLX and GGUF versions; either works.
  4. Load the model in the Chat tab and start typing.

If you're deciding between the two, our Ollama vs LM Studio comparison goes deeper. Short version: Ollama for scripting and connecting other apps, LM Studio for a friendly chat window.

A hands-on test of which models run well on the new M6 MacBook Pro at different memory sizes.

How much memory does a Mac give a local LLM?

Not all of it. On Macs with 16GB to 48GB, macOS lets the GPU use about 75% of unified memory by default, leaving the rest for the system and apps. That means roughly 12GB on a 16GB Mac, 18GB on 24GB and 24GB on 32GB. Macs with more memory reserve a smaller share.

Bar chart of memory available to the GPU at about 75%: 12GB on a 16GB Mac, 18GB on 24GB, 24GB on 32GB and 36GB on 48GB Chart: ProductFire math from reported macOS GPU limits.

Apple exposes this limit to apps as a "recommended maximum working set size," its developer documentation says. Independent testers report about 75% on 16-48GB machines and a higher share on larger ones, according to Searoom's measurements. You can check yours in Terminal with "sysctl iogpu.wired_limit_mb"; a value of 0 means the default.

Advanced users can raise the limit with the same setting, but Apple doesn't support it, and pushing it too far makes the whole Mac swap and stutter. Close browser tabs and heavy apps before loading a big model instead.

Our math: a model needs its file size, plus the KV cache that holds your conversation, plus about 1GB for the app's buffers. Qwen3.8 27B at Q4_K_M is a 16.56GB file, and 32K tokens of context add 2GB, for about 18.4GB in total. That's over the 18GB budget of a 24GB Mac, but fits a 32GB Mac's 24GB with room to spare.

Which local LLM should you run on your Mac?

Match the model to your memory. On 16GB, run Qwen3.5 9B or Gemma 4 12B at 4-bit. On 24GB, Gemma 4 26B A4B or Qwen3.8 27B at IQ4_XS. On 32GB, Qwen3.8 27B at Q4_K_M with long context, or Qwen3.6 35B A3B. With 64GB or more, try 8-bit 27B models or larger mixture-of-experts models.

Four cards of model picks: Qwen3.5 9B for 16GB, Gemma 4 26B A4B for 24GB, Qwen3.8 27B Q4_K_M for 32GB and larger models for 64GB or more Graphic: ProductFire, from Hugging Face file sizes.

Model and quant File (GB) Total at 32K context (GiB) 16GB Mac (~12) 24GB Mac (~18) 32GB Mac (~24)
Qwen3.5 9B, Q8_0 9.53 10.9 Fits, tight Fits Fits
Gemma 4 12B, Q8_0 12.67 13.6 No Fits Fits
Gemma 4 26B A4B, UD-IQ4_XS 13.60 14.5 No Fits Fits
Qwen3.8 27B, UD-IQ4_XS 14.35 16.4 No Fits Fits
Gemma 4 26B A4B, UD-Q4_K_M 16.95 17.6 No Tight Fits
Qwen3.8 27B, UD-Q4_K_M 16.56 18.4 No Only at 16K Fits
Qwen3.6 35B A3B, UD-Q4_K_M 22.13 22.2 No No Fits

ProductFire calculations from Hugging Face GGUF sizes and model configs, Dec. 2, 2026. Totals include KV cache at 32K tokens and 1 GiB of overhead. 4-bit versions of the 9B and 12B models are about half the Q8_0 size.

We used the same file sizes and KV cache math in our guide to the best local LLMs for 16GB of VRAM, so you can compare a Mac with a PC graphics card directly. A 24GB Mac has slightly more room than a 16GB card.

Analysis: on a 16GB Mac, the 75% limit is the real squeeze. A 12GB budget leaves little room once Safari and a few apps are open. That's why 4-bit versions of 9-12B models, which are around half the size of the 8-bit files above, are the sensible default on base-model Macs.

How fast will a local LLM run on a Mac?

Memory bandwidth sets the ceiling. For a dense model, the maximum speed is roughly bandwidth divided by model size. A 16.56GB Qwen3.8 27B file tops out near 9 tokens per second on an M5 MacBook Air, 18.5 on M5 Pro, 37 on M5 Max and 72 on M5 Ultra, by our math. Real speeds land below those numbers.

Bar chart of speed ceilings for a 16.56GB model: about 9 tokens per second on M5, 10 on M6, 18.5 on M5 Pro, 37 on M5 Max and 72.5 on M5 Ultra Chart: ProductFire math from Apple's bandwidth specs.

Mac chip Memory options Bandwidth Ceiling, 16.56GB model
M5 (MacBook Air) 16GB to 32GB 153GB/s ~9 tok/s
M6 (Mac mini, 14-inch MacBook Pro) 16GB to 32GB Up to 170GB/s ~10 tok/s
M5 Pro (MacBook Pro, Mac mini) Up to 64GB 307GB/s ~18.5 tok/s
M5 Max (MacBook Pro, Mac Studio) Up to 128GB Up to 614GB/s ~37 tok/s
M5 Ultra (Mac Studio) Up to 512GB 1.2TB/s ~72 tok/s

Sources: Apple Newsroom and tech specs pages; speed ceilings are ProductFire math.

Reading speed is about 5 to 10 words a second for most people, and a token is roughly three-quarters of a word. So 9 tokens a second feels slow but usable for chat, while 30 or more feels instant.

Mixture-of-experts models change the picture. Gemma 4 26B A4B only uses about 4 billion parameters per token, so it runs several times faster than a dense 27B model of similar file size. On a MacBook Air, that's often the difference between waiting and reading along.

Should you use MLX or GGUF models on a Mac?

Either works. GGUF is the format used by llama.cpp, Ollama and LM Studio across Mac, Windows and Linux. MLX is Apple's machine-learning framework, and LM Studio can run MLX versions of popular models on Apple silicon. Try both versions of the same model and keep whichever runs faster on your Mac.

MLX builds are often a little faster on Macs, while GGUF has the widest choice of quantization levels, including the dynamic quants that keep important layers sharper at 3 or 4 bits. If a model only comes in one format, use that one.

Safety matters for either format. Download from well-known publishers on Hugging Face, and read our guide to whether GGUF models are safe before trying files from unknown uploaders.

Which Mac should you buy for local AI?

Buy memory before anything else. A 24GB or 32GB MacBook Air or Mac mini runs today's best 26-27B models; 16GB limits you to smaller ones. If speed matters, an M5 Pro or M5 Max doubles or quadruples bandwidth. A Mac Studio with M5 Ultra and up to 512GB suits people running very large models.

A Mac Studio under an Apple Studio Display on a desk with a keyboard and trackpad Photo: AzureSaturn / Wikimedia Commons, CC0.

The M6 Mac mini starts at $899 and the M5 Pro Mac mini at $1,699, according to Apple's September announcement. The 13-inch M5 MacBook Air starts at $1,099. Memory upgrades cost extra, and you can't add memory later, so buy what you'll need for three or four years. Our RAM guide for local LLMs explains the trade-offs in more detail.

What should you do: our recommendation

Start with Ollama or LM Studio and a model one size smaller than your memory allows. On a 16GB Mac, that's Qwen3.5 9B at 4-bit. On 24GB, Gemma 4 26B A4B. On 32GB, Qwen3.8 27B at Q4_K_M. Once it runs well, try the next size up and see if the speed is still comfortable.

Use this checklist:

  • Check your memory: Apple menu > About This Mac. Multiply by 0.75 for your model budget on 16-48GB Macs.
  • Add up the model: file size + about 2GB for 32K tokens of context on 27B models + 1GB overhead.
  • Pick a format: try the MLX and GGUF builds of the same model in LM Studio.
  • Prefer mixture-of-experts models on base Macs for speed.
  • Close heavy apps before loading a large model; don't raise the GPU memory limit unless you know the risks.
  • Connect tools carefully. Local models can use tools through MCP; read what an MCP server is before giving one access to your files.

Frequently asked questions

Can I run an LLM locally on a Mac?

Yes. Any Apple silicon Mac (M1 or newer) can run local models with Ollama or LM Studio. The amount of unified memory decides how big a model you can load.

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

16GB runs 8-12B models well. 24GB runs strong 26-27B models at 4-bit. 32GB gives a 27B model room for long context. 64GB or more opens up larger models.

Is Ollama or LM Studio better on a Mac?

Ollama is quicker if you're comfortable with a terminal or want to connect other apps. LM Studio has a full chat interface, a model browser, and supports Apple's MLX format as well as GGUF.

What is the best local LLM for a MacBook Air?

On a 16GB MacBook Air, start with Qwen3.5 9B or Gemma 4 12B at 4-bit. On 24GB or 32GB, Gemma 4 26B A4B is fast and capable.

How fast is a local LLM on a Mac?

It depends on memory bandwidth. By our math, a 16.56GB model can reach at most about 9 tokens per second on an M5 MacBook Air and 37 on an M5 Max. Real speeds are lower.

Does a local LLM send my data to the internet?

No. Once the model is downloaded, Ollama and LM Studio run it on your Mac. Check any extra tools or plug-ins you connect, since those can reach the web.

Sources

  1. Apple Newsroom, "The new Mac mini and Mac Studio are available today," Sept. 22, 2026
  2. Apple Newsroom, "Apple introduces the new MacBook Air with M5," Mar. 2026
  3. Apple Newsroom, "Apple introduces the new 14-inch MacBook Pro with M6," Oct. 2026
  4. Apple Support, "MacBook Pro (14-inch, M5 Pro or M5 Max) - Tech Specs"
  5. Apple, MacBook Air tech specs
  6. Apple Developer, "recommendedMaxWorkingSetSize"
  7. Ollama model library (gemma4, qwen3.8, qwen3.5)
  8. LM Studio, "System Requirements"
  9. Searoom, "How much VRAM does a Mac have? One pool, two ceilings"
  10. Fits In Memory, "M6 MacBook Pro for Local AI: How Much RAM Do You Really Need?" (video)
  11. Wikimedia Commons: "MacBook Pro (16-inch, M4 Pro, Silver).jpg" and "Apple Studio Display and Mac Studio with Peripherals.jpg" by AzureSaturn (CC0)

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

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. Personal FinanceForm 1040 citizenship question is now final: what to check on your 2026 tax return
  2. Personal FinanceIs there a stimulus check in 2026? No. Here's the status
  3. Personal FinanceTrump Account app not working? The fixes that help
  4. Personal FinanceSexual assault settlements are now tax-free under a new law: what changed
  5. Personal FinanceSaver's Match 2027: IRS says up to $1,000 federal retirement match starts with 2027 savings