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 ·

Gemma 4 12Brunning on this Mac One shared pool · 16 GB macOS, appsGemma 4 · 6.7 GBfree The processor and graphics chip draw on the same memory
On a Mac, the model shares one pool of memory with everything else.
M1 or laterApple silicon recommended
16 GBEnough for the Gemma 4 12B
160 t/sE2B on a MacBook Pro M4 Max
0Drivers to install
The Mac advantage

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.

Sizing

Which model for which Mac

Go by your Mac's memory. Leave several gigabytes free for macOS and your other apps.

Your Mac's memoryRecommendedOllama nameDownloadMemory for weightsAlso possibleAvoid
8 GBGemma 4 E2Bgemma4:e2b-it-qat4.3 GB2.9 GBE4B, with little else open12B and above
16 GBGemma 4 12Bgemma4:12b-it-qat7.2 GB6.7 GBE4B, for more headroom26B A4B and 31B
24 GBGemma 4 12Bgemma4:12b-it-qat7.2 GB6.7 GB26B A4B, tightly31B
32 GBGemma 4 26B A4Bgemma4:26b-a4b-it-qat16 GB14.4 GB31B, with a modest context-
48 GBGemma 4 31Bgemma4:31b-it-qat19 GB17.5 GBLonger contexts-
64 GB or moreGemma 4 31Bgemma4:31b-it-qat19 GB17.5 GB8-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.

Setup

Four ways to run it on a Mac

  1. Install the app

    Download it from ollama.com/download, drag it to Applications and open it.

  2. Open Terminal

    Find it with Spotlight.

  3. 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.

  1. Install LM Studio

    From lmstudio.ai. No terminal needed.

  2. Search for "Gemma"

    Press Cmd + Shift + M, pick a size that fits your memory and download it.

  3. 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.

A fifth option. Google's AI Edge Gallery app, known from phones, also lists Macs with an M1 chip or later on macOS 14. It runs the two small models, E2B and E4B. See mobile downloads.

Unsure which to pick? The runtime selector can help. Files and sizes are in the download hub and how to download.

Formats

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.

ModelQAT GGUFMLX
E2B4.3 GB7.5 GB
E4B6.1 GB9.5 GB
12B7.2 GB7.7 GB
26B A4B16 GB18 GB
31B19 GB19 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.

Performance

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

Tokens per second, higher is better
E2B · graphics chip160.2 t/s
E4B · graphics chip101.1 t/s
E2B · in a browser (WebGPU)73 t/s
E2B · processor only41.6 t/s
E4B · processor only27.0 t/s
Model and backendWritingFirst wordMemory
E2B · graphics chip160.2 t/s0.1 s1,623 MB
E2B · processor only41.6 t/s1.1 s736 MB
E4B · graphics chip101.1 t/s0.4 s3,217 MB
E4B · processor only27.0 t/s3.7 s890 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 · released October 6, 2026
Search on your Mac

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.

Text Image Audio Video Embedding Gemma 2 one shared vector space query
Different formats, same meaning, neighbouring points.

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.

Advanced

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.

Be careful. If you give the graphics chip too much, macOS itself runs short and the whole Mac can freeze. Raise the value a little at a time and always leave several gigabytes for the system.

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.

Mac-specific

Things that only happen on a Mac

SymptomLikely causeFix
The model fits, but everything crawlsMemory is shared, and the Mac has started using the disk as overflowClose other apps, lower the context length, or use a smaller model. Check Memory Pressure in Activity Monitor
The whole Mac stalls when loadingThe model is too large for the memory left overChoose a smaller model; if you raised the memory ceiling, lower it
It will not load despite free memoryIt exceeds the share macOS gives the graphics chipUse a smaller build, or see the memory ceiling
Speed drops during long sessionsHeat. A MacBook Air has no fan and slows itself down to stay coolExpected; take breaks, or use a smaller model for long jobs
Slow first reply, then fineThe model is loading into memoryNormal after a pause; keep the chat open
Very slow on an older MacIntel Macs lack Apple silicon's shared graphics memoryUse 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.

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.

Top '