Gemma 4 on Mac
Macs with Apple silicon are some of the best machines for running Gemma 4 at home, because the whole model can sit in memory the graphics chip can reach. Here is which model fits your Mac, how to set it up, and how to add EmbeddingGemma 2.
For Macs with an M1 chip or later · no drivers to install ·
Why Macs punch above their weight
Shared memory
On a PC, a model must fit in the graphics card's own memory, often 8 to 24 GB. On Apple silicon the processor and graphics chip share one pool, so a 32 GB Mac can load models that would need a 32 GB graphics card.
Nothing to install first
Graphics acceleration is built into macOS. There are no drivers to update or versions to match before a model will use the graphics chip.
The catch
That one pool is also used by macOS, your browser and your other apps. A model that "fits" on paper can still slow the whole Mac if nothing is left over.
Which model for which Mac
Go by your Mac's memory. Leave several gigabytes free for macOS and your other apps.
| Your Mac's memory | Recommended | Ollama name | Download | Memory for weights | Also possible | Avoid |
|---|---|---|---|---|---|---|
| 8 GB | Gemma 4 E2B | gemma4:e2b-it-qat | 4.3 GB | 2.9 GB | E4B, with little else open | 12B and above |
| 16 GB | Gemma 4 12B | gemma4:12b-it-qat | 7.2 GB | 6.7 GB | E4B, for more headroom | 26B A4B and 31B |
| 24 GB | Gemma 4 12B | gemma4:12b-it-qat | 7.2 GB | 6.7 GB | 26B A4B, tightly | 31B |
| 32 GB | Gemma 4 26B A4B | gemma4:26b-a4b-it-qat | 16 GB | 14.4 GB | 31B, with a modest context | - |
| 48 GB | Gemma 4 31B | gemma4:31b-it-qat | 19 GB | 17.5 GB | Longer contexts | - |
| 64 GB or more | Gemma 4 31B | gemma4:31b-it-qat | 19 GB | 17.5 GB | 8-bit builds, about 35 GB | - |
On 16 GB, choose the 12B
It needs about 6.7 GB for the weights, takes images and audio, and leaves room for everything else. The 26B A4B needs 14.4 GB and will not fit comfortably.
Context costs memory too
The figures cover the weights only. A long conversation or document needs more, so keep the context length moderate on smaller Macs.
Memory beats chip
For running models, more memory matters more than a faster chip tier. A model that does not fit will not run well on any chip.
Memory figures are Google's estimates from the model card; download sizes from Ollama's tag list; the recommendations are this site's guidance. Compare the models on the models page and in the model comparison; more on memory in the VRAM guide; the 12B has its own guide.
Four ways to run it on a Mac
Install the app
Download it from ollama.com/download, drag it to Applications and open it.
Open Terminal
Find it with Spotlight.
Run a model
The first run downloads it, then opens a chat.
# After installing the app from ollama.com/download: ollama run gemma4:12b-it-qat # Give it a longer memory for this chat /set parameter num_ctx 32768
The quickest route. More detail in the install guide.
Install LM Studio
From lmstudio.ai. No terminal needed.
Search for "Gemma"
Press Cmd + Shift + M, pick a size that fits your memory and download it.
Load it and chat
Press Cmd + L, choose the model and start typing. On Apple silicon LM Studio can use MLX builds as well as GGUF.
The full walkthrough is on the LM Studio page.
pip install mlx mlx-lm mlx-vlm # Text mlx_lm.generate --model mlx-community/gemma-4-e2b-it-4bit --prompt "Who are you?" # Ask about an image mlx_vlm.generate --model mlx-community/gemma-4-e2b-it-4bit \ --prompt "Describe this image." --image photo.jpg # A local server that speaks the OpenAI format, at http://localhost:8080/v1 mlx_vlm.server --model mlx-community/gemma-4-e2b-it-4bit
MLX is Apple's machine-learning framework for Apple silicon. Commands from Google's MLX guide for Gemma; other sizes are published by the MLX community on Hugging Face.
git clone https://github.com/ggml-org/llama.cpp && cd llama.cpp cmake -B build && cmake --build build --config Release -j ./build/bin/llama-server \ -hf google/gemma-4-12B-it-qat-q4_0-gguf \ --ctx-size 32768 --n-gpu-layers 99 --port 8080
Needs Xcode's command-line tools and CMake. It downloads Google's official 4-bit build on first run and uses the graphics chip.
Unsure which to pick? The runtime selector can help. Files and sizes are in the download hub and how to download.
GGUF or MLX?
On a Mac you can choose between two model formats. Both use the graphics chip.
GGUF - the default
Used by Ollama, LM Studio and llama.cpp. It is the format of Google's official QAT 4-bit builds, which are trained to keep quality at that size. Start here.
MLX - Apple's own
Made for Apple silicon. Choose it if you work in Python with Apple's tools, or want to experiment. Available through LM Studio, Ollama's -mlx names and the MLX tools.
| Model | QAT GGUF | MLX |
|---|---|---|
| E2B | 4.3 GB | 7.5 GB |
| E4B | 6.1 GB | 9.5 GB |
| 12B | 7.2 GB | 7.7 GB |
| 26B A4B | 16 GB | 18 GB |
| 31B | 19 GB | 19 GB |
Download sizes on Ollama, from its tag list: the -it-qat names against the -mlx names, such as gemma4:12b-mlx. This page makes no claim about which is faster, because it found no measurement it could confirm. Try both on your own Mac.
More on the 4-bit builds under QAT builds.
Measured speed on a Mac
Google's published figures for the two small models on a MacBook Pro M4 Max, using its LiteRT-LM runtime.
Writing speed, MacBook Pro M4 Max
| Model and backend | Writing | First word | Memory |
|---|---|---|---|
| E2B · graphics chip | 160.2 t/s | 0.1 s | 1,623 MB |
| E2B · processor only | 41.6 t/s | 1.1 s | 736 MB |
| E4B · graphics chip | 101.1 t/s | 0.4 s | 3,217 MB |
| E4B · processor only | 27.0 t/s | 3.7 s | 890 MB |
From Google's E2B and E4B LiteRT-LM model cards, with 1,024 tokens in and 256 out. Google does not publish Mac figures for the 12B, 26B A4B or 31B, so none are quoted here; expect them to be slower, and slower again on older or smaller Macs. Other devices are on the benchmarks page.
EmbeddingGemma 2 on Mac
Google's new open model for search turns text, code, images, video and audio into vectors, so you can find things by meaning. At 1.3 GB or less it runs on any Apple silicon Mac alongside Gemma 4, with nothing leaving the machine.
With Ollama
# Ollama - full model, 1.3 GB ollama pull embeddinggemma-2 # Or text and code only, 378 MB ollama pull embeddinggemma-2:270m # Test it curl http://localhost:11434/api/embed -d '{ "model": "embeddinggemma-2", "input": "hello from my Mac" }'
With Python
pip install -U "sentence-transformers[image,audio,video]" transformers
python -c "from sentence_transformers import SentenceTransformer as S; print(S('google/embeddinggemma-2').encode('hello').shape)"
Google's guide asks for sentence-transformers 6.1.0 or later. The test line should print (768,).
Private search over your files
Index notes, documents, photos or recordings on your own Mac, and search them in plain words.
Pair it with Gemma 4
EmbeddingGemma 2 finds the right passages; Gemma 4 writes the answer. See how to use both.
MLX is on Google's list
Google's guide names MLX, LM Studio and Ollama among supported tools. Check each for an EmbeddingGemma 2 build; the model is new.
One setting to avoid
Google's model card says not to use float16. Use bfloat16 or float32.
Install command and supported tools from Google's EmbeddingGemma 2 developer guide; the float16 note from the model card. Specs, task prompts and more code are in this site's EmbeddingGemma 2 guide; LM Studio's status is on the LM Studio page.
Raising the graphics memory ceiling
Most people never need this. macOS keeps part of memory back from the graphics chip, so a model slightly too large for that share may refuse to load even though your Mac has the memory.
# See the current limit (0 means the system default) sysctl iogpu.wired_limit_mb # Raise it, for example to 28,000 MB on a 32 GB Mac sudo sysctl iogpu.wired_limit_mb=28000
The setting returns to its default every time the Mac restarts.
Try the simpler fixes first
A smaller context length, a 4-bit build or the next model size down solves most loading problems without touching system settings.
This is a general macOS setting, described here from common practice; it is not part of Google's or Apple's Gemma documentation and was not tested for this page.
Things that only happen on a Mac
| Symptom | Likely cause | Fix |
|---|---|---|
| The model fits, but everything crawls | Memory is shared, and the Mac has started using the disk as overflow | Close other apps, lower the context length, or use a smaller model. Check Memory Pressure in Activity Monitor |
| The whole Mac stalls when loading | The model is too large for the memory left over | Choose a smaller model; if you raised the memory ceiling, lower it |
| It will not load despite free memory | It exceeds the share macOS gives the graphics chip | Use a smaller build, or see the memory ceiling |
| Speed drops during long sessions | Heat. A MacBook Air has no fan and slows itself down to stay cool | Expected; take breaks, or use a smaller model for long jobs |
| Slow first reply, then fine | The model is loading into memory | Normal after a pause; keep the chat open |
| Very slow on an older Mac | Intel Macs lack Apple silicon's shared graphics memory | Use E2B, or a hosted option from the playground |
Causes and fixes are this site's guidance. General problems are covered in the install guide and the FAQ.
Mac questions
Which Gemma 4 model should I run on a 16 GB Mac?
The 12B at 4-bit. It needs about 6.7 GB for the weights, accepts images and audio, and leaves room for your other apps.
Can I run Gemma 4 on an 8 GB Mac?
Yes: E2B, which needs about 2.9 GB. E4B is possible with little else open.
Do I need to install drivers?
No. Graphics acceleration is built into macOS on Apple silicon.
Can I run the 31B on a MacBook?
With 32 GB of memory or more, at 4-bit, where it needs about 17.5 GB for the weights. 48 GB gives comfortable room.
Does it work on an Intel Mac?
Only the smallest models, and slowly. This guide assumes Apple silicon.
MacBook Air or MacBook Pro?
Both work. The Air has no fan, so it slows down in long sessions. How much memory you have matters more than which model of Mac.
Is MLX faster than GGUF?
This page found no measurement it could confirm either way for Gemma 4. Start with GGUF through Ollama or LM Studio, and try the MLX build on your own Mac if you are curious.
Can I use EmbeddingGemma 2 on a Mac?
Yes. Run ollama pull embeddinggemma-2, or load it in Python. It is at most 1.3 GB. What it is for is explained in features and capabilities.
Put Gemma 4 on your Mac
Pick the size that fits your memory and you are chatting in minutes.