Run Llama 3 on Mac: Ollama Setup for Apple Silicon
Want to go deeper than this article?
Free account unlocks the first chapter of all 25 courses — RAG, agents, MCP, voice AI, MLOps, real GitHub repos.
Ollama’s running. Here’s what to build with it. Go from “ollama run” to RAG apps, agents, and fine-tuned models — structured and hands-on. First chapter free.
Short answer
Install Ollama, then run one command: ollama run llama3.1:8b. On any Apple Silicon Mac the Metal GPU backend is used automatically — there is no CUDA, no driver, and no configuration file to edit. The only thing you need to check first is memory: an 8B model at Q4 needs about 4.8GB of weights plus room for context, and macOS only lets the GPU address roughly two-thirds of your unified memory. 16GB is the comfortable floor for an 8B model; 8GB works better with Llama 3.2 3B.
Apple Silicon is unusually well suited to local LLMs, for one specific reason: the CPU and GPU share a single pool of high-bandwidth memory, so "how much VRAM do I have" becomes "how much RAM did I buy". A 64GB Mac Studio holds models that no single consumer graphics card can.
This guide covers the install, and then the part most Mac guides skip — working out what your particular chip can actually deliver, from Apple's own published memory bandwidth figures, with the arithmetic shown so you can check it.
Running Windows or Linux as well? Pair this with the Windows install guide and the Linux setup guide.
What do you need before you start?
| Requirement | Minimum | Comfortable |
|---|---|---|
| macOS | A currently-supported release — Ollama lists its minimum on the download page | Sonoma 14 or later |
| Chip | Any Apple Silicon (M1 onward) | M-series Pro/Max for larger models |
| Unified memory | 8GB, running Llama 3.2 3B | 16GB for Llama 3.1 8B, 64GB for 70B |
| Free disk | 10GB | 40GB+ if you plan to keep several models |
| Admin access | Yes, to approve the app on first launch | — |
Intel Macs will run Llama 3, but on the CPU only — there is no Metal path to an Intel integrated GPU for Ollama, and no NVIDIA driver on macOS at all. See the Intel section near the end.
Reading articles is good. Building is better.
Free account = 20+ free chapters across 25 courses, with a per-chapter AI tutor. No card. Cancel anytime if you ever upgrade.
Step 1: install Ollama
Two supported routes. The app is the easier one and gives you a menu-bar service that starts at login.
# Option A — Homebrew cask (installs Ollama.app)
brew install --cask ollama
# Option B — download the .dmg from ollama.com/download,
# then drag Ollama.app into /Applications
Launch it once and approve the macOS security prompt (System Settings → Privacy & Security). The app starts a local server on http://localhost:11434 and keeps it running.
If you would rather not run the menu-bar app, brew install ollama installs the CLI on its own and brew services start ollama runs the server as a background service. Do not use both routes at once — they will fight over port 11434.
Verify:
ollama --version
curl -s http://localhost:11434/api/version
Step 2: pull a Llama 3 model
Pick the tag that matches your memory, not the biggest one that will technically download.
| Tag | Model | Approx. download | Sensible on |
|---|---|---|---|
llama3.2:3b | Llama 3.2 3B, Q4_K_M | ~2GB | 8GB Macs |
llama3.1:8b | Llama 3.1 8B, Q4_K_M | ~4.9GB | 16GB and up |
llama3.1:8b-instruct-q5_K_M | Llama 3.1 8B, Q5_K_M | ~5.7GB | 18GB and up |
llama3.1:8b-instruct-q8_0 | Llama 3.1 8B, Q8_0 | ~8.5GB | 24GB and up |
llama3.3:70b | Llama 3.3 70B, Q4_K_M | ~43GB | 64GB and up |
ollama pull llama3.1:8b
ollama list
Not sure which family to commit to? Our RAM requirements guide sizes models against machines, and Llama vs Mistral vs CodeLlama covers when to pick something other than Llama.
Step 3: run Llama 3 and confirm it is on the GPU
ollama run llama3.1:8b --verbose "Write one sentence about the sea."
The --verbose flag prints timings after the response, including an eval rate in tokens per second. That number is the one to trust for your machine — it is measured on your hardware rather than borrowed from someone else's.
Then check where the model actually landed:
ollama ps
The PROCESSOR column should read 100% GPU. If it reads something like "40%/60% CPU/GPU", the model did not fit in the memory macOS allows the GPU to address, and everything you measure afterwards is telling you about the CPU path instead. The memory section below explains why that happens and what to do about it.
Reading articles is good. Building is better.
Free account = 20+ free chapters across 25 courses, with a per-chapter AI tutor. No card. Cancel anytime if you ever upgrade.
How fast will Llama 3 run on your Mac?
Token generation is memory-bandwidth bound. To produce one token the runtime reads the model's weights out of unified memory once, which gives a hard arithmetic ceiling:
Throughput ceiling
tokens/sec ceiling = memory bandwidth (GB/s) ÷ model weights (GB)
An upper bound, not a prediction. Attention over the KV cache, sampling and framework overhead all take a cut, so a real --verbose eval rate lands well below this. Use it to compare machines and to sanity-check a number someone quotes you.
And the weight footprint, using the rule of thumb for Q4_K_M:
Weight footprint
Q4_K_M weights (GB) ≈ 0.6 × parameters in billions
So Llama 3.2 3B ≈ 1.8GB, Llama 3.1 8B ≈ 4.8GB, a 70B ≈ 42GB. Roughly: Q5_K_M ≈ 0.71 GB/B, Q6_K ≈ 0.82 GB/B, Q8_0 ≈ 1.06 GB/B.
Apple publishes memory bandwidth for every M-series chip on its tech-spec pages — the MacBook Pro specs cover the Pro and Max chips, the Mac Studio specs cover the Ultra. Given that figure, the ceiling for an 8B model at Q4_K_M is just division:
| Chip | Apple-published memory bandwidth | 8B Q4 ceiling | 70B Q4 ceiling |
|---|---|---|---|
| M1 | 68.25 GB/s | ~14 tok/s | insufficient memory |
| M2 / M3 | 100 GB/s | ~21 tok/s | insufficient memory |
| M4 | 120 GB/s | ~25 tok/s | insufficient memory |
| M3 Pro | 150 GB/s | ~31 tok/s | insufficient memory |
| M1 Pro / M2 Pro | 200 GB/s | ~42 tok/s | insufficient memory |
| M4 Pro | 273 GB/s | ~57 tok/s | insufficient memory |
| M3 Max (base config) | 300 GB/s | ~63 tok/s | ~7 tok/s at 64GB+ |
| M1 Max / M2 Max / M3 Max (top config) | 400 GB/s | ~83 tok/s | ~10 tok/s at 64GB+ |
| M4 Max (14-core CPU) | 410 GB/s | ~85 tok/s | ~10 tok/s at 64GB+ |
| M4 Max (16-core CPU) | 546 GB/s | ~114 tok/s | ~13 tok/s at 64GB+ |
| M1 Ultra / M2 Ultra | 800 GB/s | ~167 tok/s | ~19 tok/s |
| M3 Ultra | 819 GB/s | ~171 tok/s | ~20 tok/s |
The two right-hand columns are that division and nothing more — bandwidth ÷ 4.8GB for the 8B, bandwidth ÷ 42GB for the 70B. They are not measurements, and no real machine will hit them.
Two things worth noticing. First, the ceiling scales with bandwidth and nothing else — GPU core count matters for prompt processing, which is compute-bound, but not for the token-by-token generation you feel while chatting. Second, the spread from a base M1 to an Ultra is more than tenfold, so "will Llama 3 run on my Mac" and "will it feel fast on my Mac" are genuinely different questions.
Why does an M2 Pro beat an M3 Pro for local LLMs?
Because Apple reduced memory bandwidth on the M3 Pro. The M1 Pro and M2 Pro both run 200 GB/s; the M3 Pro runs 150 GB/s, a 25% cut. Apple narrowed the memory bus on that particular chip.
For most Mac workloads this is invisible. For local LLM generation it is the single number that matters, so a two-generation-old M2 Pro has a higher arithmetic ceiling on an 8B model than a newer M3 Pro. The M4 Pro reverses it decisively at 273 GB/s.
This is exactly the sort of thing a tokens-per-second table lifted from someone's blog will get wrong, and the sort of thing the arithmetic gets right. When you are choosing between two Macs for local AI, look up the published bandwidth first and the chip generation second.
How much memory does macOS let a model use?
This is the constraint that actually bites on Mac, and it surprises people who assume unified memory means all of it is available.
macOS reserves a portion of unified memory for the system and caps what the GPU may wire down. The default working limit is roughly two-thirds of total RAM on smaller machines, rising to about three-quarters on the large-memory configurations.
| Unified memory | Roughly available to the model | Largest Q4 model that fits comfortably |
|---|---|---|
| 8GB | ~5GB | Llama 3.2 3B (1.8GB), 8B only with a short context |
| 16GB | ~10.7GB | Llama 3.1 8B with a long context, or a 14B |
| 18GB | ~12GB | 8B at Q8_0, or a 14B comfortably |
| 24GB | ~16GB | A 27B at Q4 with a modest context |
| 32GB | ~21GB | A 32B at Q4 |
| 36GB | ~24GB | A 32B at Q4 with real context headroom |
| 64GB | ~48GB | A 70B at Q4 (42GB), tight but workable |
| 128GB+ | ~96GB+ | A 70B at Q6, or several models resident at once |
When ollama ps reports a CPU/GPU split rather than 100% GPU, you have crossed this line. The fixes, in order of how much you should like them:
- Use a smaller model or a smaller quant. Almost always the right answer.
- Shorten the context. The KV cache is the other consumer, and it grows linearly with context length.
- Quantise the KV cache with
OLLAMA_KV_CACHE_TYPE=q8_0, which roughly halves it. - Close what is holding memory. Browsers are the usual culprit.
There is a sysctl that raises the wired-memory limit, and you will find it recommended around the internet. It works, and it also lets you push the machine into swapping so hard that the Mac becomes unresponsive. Treat it as a last resort on a machine with memory to spare, not as a routine step.
Which quantisation should you pick?
| Format | Bits per weight (approx.) | 8B footprint | Use when |
|---|---|---|---|
| Q4_K_S | ~4.5 | ~4.5GB | You are squeezing an 8GB machine |
| Q4_K_M | ~4.8 | ~4.8GB | Default. Best balance for almost everyone |
| Q5_K_M | ~5.7 | ~5.7GB | You have headroom and want a little more fidelity |
| Q6_K | ~6.6 | ~6.6GB | 32GB+ machines, quality-sensitive work |
| Q8_0 | ~8.5 | ~8.5GB | Effectively lossless; only worth it with memory to burn |
The K-quants keep higher precision on the weights that matter most, which is why Q4_K_M holds up far better than the flat 4-bit formats it replaced. Our quantisation explainer goes into what each format is actually doing.
Note the interaction with the ceiling table above: a larger quant is also a slower one, because throughput is bandwidth divided by footprint. Moving from Q4_K_M to Q8_0 nearly halves your ceiling. On a bandwidth-constrained machine that trade is usually not worth it.
Which model should you run on a Mac?
Llama 3 is a good default, not an obligation. All of these run through Ollama on Apple Silicon:
| Model | Params | Q4_K_M footprint | Ceiling on a 100 GB/s chip | Known for |
|---|---|---|---|---|
| Llama 3.2 3B | 3.2B | ~1.9GB | ~53 tok/s | The 8GB-Mac option |
| Llama 3.1 8B | 8.0B | ~4.8GB | ~21 tok/s | General chat, summarising, tool use |
| Mistral 7B | 7.2B | ~4.3GB | ~23 tok/s | Instruction following, permissive Apache licence |
| CodeLlama 7B | 6.7B | ~4.0GB | ~25 tok/s | Code completion, fill-in-the-middle |
| Gemma 7B | 8.5B | ~5.1GB | ~20 tok/s | Short-form generation |
| Phi-3 Medium | 14B | ~8.4GB | ~12 tok/s | Reasoning, at a real speed cost |
| Llama 3.1 70B | 70B | ~42GB | 64GB Mac required | The reason to own a Mac Studio |
The footprint column applies the 0.6 GB-per-billion rule to each model's true parameter count — which is why "Gemma 7B" (actually 8.5B parameters) is larger than "Llama 3.1 8B". The ceiling column is the same division as before, run against a 100 GB/s chip (a base M2 or M3) so the models are comparable to each other. Scale it for your own machine using the bandwidth table.
The honest summary: on Apple Silicon, model size drives speed far more than model family does, because they are all reading weights out of the same memory at the same rate. A 7B is faster than an 8B by roughly the ratio of their footprints, and that is most of the story. Pick on capability and licence; the speed follows from the parameter count. Our model selection framework and the full model rankings cover the capability side.
How do you configure Ollama on macOS?
Start by deleting a myth: there is no ~/.ollama/config.yaml. Ollama has no YAML configuration file, and it does not need one to use the GPU. On Apple Silicon the Metal backend is compiled in and selected automatically. Guides that tell you to set compute: [metal] are describing a file that does not exist.
Configuration happens in three real places: environment variables, the interactive /set command, and Modelfiles.
Environment variables
# These are the ones that matter for a Mac
OLLAMA_CONTEXT_LENGTH=8192 # default context for every model
OLLAMA_KV_CACHE_TYPE=q8_0 # halve KV cache memory (needs flash attention)
OLLAMA_FLASH_ATTENTION=1 # lower memory use for attention
OLLAMA_KEEP_ALIVE=30m # how long a model stays resident after use
OLLAMA_MAX_LOADED_MODELS=1 # avoid holding two models in memory at once
OLLAMA_HOST=127.0.0.1:11434 # bind address for the API
OLLAMA_MODELS=/Volumes/Ext/ollama # move the model store to an external drive
If you run the menu-bar app, exporting these in your shell will not reach it — the app is launched by launchd, not by your terminal. Set them properly and restart the app:
launchctl setenv OLLAMA_CONTEXT_LENGTH 8192
launchctl setenv OLLAMA_FLASH_ATTENTION 1
# then quit Ollama from the menu bar and reopen it
If you run ollama serve yourself, a normal export in the same shell is all you need.
Per-session parameters
Sampling settings are not command-line flags. Set them inside the interactive session:
ollama run llama3.1:8b
>>> /set parameter num_ctx 8192
>>> /set parameter temperature 0.2
>>> /set parameter top_p 0.9
>>> /set parameter repeat_penalty 1.1
Rough guidance: temperature near 0.1–0.3 for code and factual extraction, 0.7 for general chat, 0.9 and above for creative work. Lower top_k and top_p narrow the candidate pool; repeat_penalty above 1.0 discourages loops in long generations.
Making it permanent with a Modelfile
cat > Modelfile <<'EOF'
FROM llama3.1:8b
PARAMETER num_ctx 8192
PARAMETER temperature 0.2
SYSTEM "You are a concise technical assistant. Answer in at most five sentences."
EOF
ollama create llama3-tuned -f Modelfile
ollama run llama3-tuned
Keeping the Mac awake
Long generations on a laptop will be interrupted by sleep, and macOS throttles under battery. Both are one-liners:
# Prevent sleep for the duration of the command
caffeinate -i ollama run llama3.1:8b
# Check whether the system is thermally throttling
pmset -g thermlog
Keep the machine plugged in for sustained work. That is not a benchmark claim, it is how macOS power management is documented to behave.
How do you connect Llama 3 to Shortcuts, Raycast and Alfred?
Ollama exposes an HTTP API on http://localhost:11434, which means anything on your Mac that can make a request can talk to it.
A Quick Action in Automator
- Open Automator → new Quick Action
- Set it to receive text in any application
- Add Run Shell Script, set "Pass input" to as arguments
- Paste:
#!/bin/bash
INPUT="$1"
printf '%s' "$INPUT" | ollama run llama3.1:8b "Summarise this text concisely:"
- Save as "Summarise with Llama". It now appears under Services when you right-click selected text.
Shortcuts
Use the Get Contents of URL action pointed at http://localhost:11434/api/generate, method POST, with a JSON body containing model and prompt keys. Set stream to false so the shortcut receives one complete response rather than a stream of chunks.
Raycast
Install the Ollama extension from the Raycast store. It handles model switching and conversation history without you leaving the launcher.
Alfred, or any hotkey tool
pbpaste | ollama run llama3.1:8b "Rewrite this more clearly:"
Bind that to a hotkey and you have clipboard-to-Llama on any text on the system.
For a broader tour of Mac tooling, see the Mac local AI setup guide.
What goes wrong on a Mac?
"Ollama.app is damaged and can't be opened." The quarantine attribute from the download. Clear it:
xattr -d com.apple.quarantine /Applications/Ollama.app
The model loads onto the CPU instead of the GPU. Check with ollama ps. It means the model plus its KV cache exceeded what macOS lets the GPU wire down. Drop to a smaller quant, shorten the context, or enable OLLAMA_KV_CACHE_TYPE=q8_0.
Generation is slower than the ceiling table suggests. Expected — the ceiling is an upper bound. But if you are far below it, confirm ollama ps shows 100% GPU, confirm nothing else large is resident, and confirm the machine is plugged in and not thermally throttling (pmset -g thermlog).
Permission errors on the model directory.
sudo chown -R "$USER":staff ~/.ollama
chmod 755 ~/.ollama
Downloads stall or time out. Check that the firewall is not blocking Ollama in System Settings → Network → Firewall, then test reachability with curl -I https://ollama.com. A partially downloaded model can be resumed by re-running the same ollama pull.
Port 11434 already in use. You are running both the menu-bar app and a brew services instance. Pick one.
Reclaiming disk space. ollama list shows what you have; ollama rm llama3.1:70b removes one model. A full uninstall is quitting the app, deleting /Applications/Ollama.app, and rm -rf ~/.ollama.
More systematic help lives in our local AI troubleshooting guide.
Can Intel Macs run Llama 3?
Yes, on the CPU — with real limitations you should know before you invest an afternoon. Check Ollama's download page for whether your macOS version and architecture are still on the supported list before you start.
- No GPU acceleration of any kind. Metal on Intel Macs does not provide a supported path for Ollama, and macOS has had no NVIDIA driver since macOS 10.13, so an external NVIDIA GPU is not an option either.
- No unified memory. Model weights sit in system RAM and are read across a conventional memory bus, which on a 2019-era Intel Mac is a fraction of even a base M1's bandwidth. Apply the same ceiling formula with your machine's published bandwidth and the answer will be sobering.
- Thermals are the practical limit on Intel laptops far more than on M-series ones.
If Intel is what you have, run the smallest capable model — Llama 3.2 3B or Mistral 7B at Q4_K_S — keep the context short, and set expectations accordingly. The honest recommendation is that an entry-level Apple Silicon Mac will outrun a high-end 2019 Intel Mac at this task by a wide margin, because bandwidth is the whole game.
Frequently asked questions
Can my M1 MacBook Air with 8GB run Llama 3?
It can run Llama 3.2 3B comfortably. Llama 3.1 8B at Q4_K_M is about 4.8GB of weights against roughly 5GB of GPU-addressable memory on an 8GB machine, so it fits only with a short context and nothing else running — and it will spill to the CPU the moment it does not. Check ollama ps for "100% GPU" to know which situation you are in. The M1's 68.25 GB/s bandwidth puts the 8B ceiling around 14 tok/s regardless.
Do I need a GPU to run Llama 3 on macOS?
Every Apple Silicon chip has one built in, and Ollama uses it through Metal automatically. There is nothing to install and nothing to enable. Intel Macs run CPU-only.
How much RAM do I need for Llama 3?
Take the model's Q4 footprint — about 0.6GB per billion parameters — add room for the KV cache, then divide by about 0.67 to account for what macOS reserves. For Llama 3.1 8B that lands around 10-12GB of unified memory, which is why 16GB is the practical floor. For a 70B, it lands around 64GB.
How fast is Llama 3 on my Mac?
Look up your chip's memory bandwidth, divide by the model's footprint in GB, and treat the result as a ceiling you will land under. The table above does this for every M-series chip. Then measure the real figure with ollama run llama3.1:8b --verbose, which prints your own eval rate — worth far more than any number quoted on a web page.
Is an M3 Pro faster than an M2 Pro for local AI?
For token generation, no. The M2 Pro has 200 GB/s of memory bandwidth against the M3 Pro's 150 GB/s, and generation speed tracks bandwidth. The M3 Pro wins on prompt processing and on everything that is compute-bound rather than memory-bound. The M4 Pro, at 273 GB/s, is faster than both.
Does more RAM or a newer chip matter more?
RAM decides which models you can run at all; bandwidth decides how fast they run. A 16GB M1 will run models that an 8GB M4 cannot touch. Between two machines that both fit your model, pick the one with higher published bandwidth.
How do I update to the latest Llama weights?
ollama pull llama3.1:8b fetches the current build for that tag. ollama list shows what you have locally and ollama rm removes what you no longer need. New model families arrive under new tags, so check the Ollama model library rather than expecting an existing tag to change underneath you.
How long does the setup take?
The install itself is a couple of minutes. The model download dominates — an 8B model at Q4_K_M is roughly 4.9GB, so budget from a few minutes on a fast connection to considerably longer on a slow one.
What is the difference between running Llama 3 locally and using ChatGPT?
Local inference keeps your prompts on your machine, has no subscription, and works with no network at all. Cloud models are larger than anything a laptop will hold and will generally produce better answers on hard tasks. The sensible framing is that they are complementary — our local AI vs ChatGPT comparison works through the trade in detail.
How do I uninstall Ollama and free the disk space?
Quit the app from the menu bar, drag /Applications/Ollama.app to the Trash, then rm -rf ~/.ollama to remove the model store — which is usually where the tens of gigabytes are.
Next steps
- Size your next machine properly with the AI hardware requirements guide
- Browse what else runs locally in the models directory
- Harden the setup for offline use with Run AI Offline
- Match tasks to models using the Choose the Right AI Model framework
- Hitting memory limits? RAM requirements for local AI covers the upgrade decision
Ollama’s running. Here’s what to build with it.
Go from “ollama run” to RAG apps, agents, and fine-tuned models — structured and hands-on. First chapter free.
Stop piecing Ollama together from blog posts
Ollama Mastery is 15 chapters end to end — install, model choice, Modelfiles, GPU offload, the API, and the 20 errors that actually happen. Plus 24 more courses.
Liked this? 20 full AI courses are waiting.
From fundamentals to RAG, agents, MCP servers, voice AI, and production deployment with real GitHub repos. First chapter free, every course.
Build Real AI on Your Machine
RAG, agents, NLP, vision, and MLOps - chapters across 25 courses that take you from reading about AI to building AI.
Want structured AI education?
25 courses, 519+ chapters, from $9. Understand AI, don't just use it.
Continue Your Local AI Journey
- PILLARBest Ollama Models 2026: 15 Ranked (Coding, Reasoning, Chat)
- AI on Steam Deck: Run Local LLMs with Ollama on SteamOS
- Air-Gapped AI Deployment: Install Ollama With No Internet
- Best Free Local AI Models to Run With Ollama (No API Key)
- Best Ollama Embedding Models Compared for Local RAG
- Best Ollama Models for 8GB RAM 2026: 12 Tested Local Picks
- Best Ollama Models for AI Agents 2026: Ranked by Tool Use
- Best Ollama Models for Tool Calling: BFCL Ranked (2026)
- Best Uncensored Local LLMs: Abliterated Ollama Models
- Build a Local AI Slack & Discord Bot with Ollama + Python
Comments (0)
No comments yet. Be the first to share your thoughts!