Can I run Gemma 4 26B-A4B on the Apple M4 Pro?
Runs greatQ4_K_M fits in unified memory (17.7 of 33.6 GB usable by the GPU): Runs great, est. 50.2 tok/s (40.2–60.2, calibrated estimate ±20%).
48 GB unified memory · 273.0 GB/s · FP16 8.1 TFLOPS. Assumes 8k context and an f16 KV cache. Verdicts are shown for each memory size.
Verdict by memory size
The page uses the 48 GB configuration; here is every size.
- 24 GBRuns slowlyest. 43.1 tok/s (30.2–56.1, theoretical estimate ±30%)Try IQ4_XS: Runs great
- 48 GBRuns greatest. 50.2 tok/s (40.2–60.2, calibrated estimate ±20%)(used on this page)
- 64 GBRuns greatest. 50.2 tok/s (40.2–60.2, calibrated estimate ±20%)
Every quant of Gemma 4 26B-A4B on the Apple M4 Pro
| Quant | File size | Verdict | Speed | Memory | Runs as | Notes |
|---|---|---|---|---|---|---|
| UD-Q2_K_XL | 10.55 GB | Runs great | est. 69.1 tok/s55.3–83.0calibrated estimate ±20% | 11.3 / 33.6 GB | Unified memory | — |
| IQ4_XS | 13.60 GB | Runs great | est. 52.9 tok/s42.3–63.5calibrated estimate ±20% | 14.3 / 33.6 GB | Unified memory | — |
| Q4_K_Mbaseline | 16.95 GB | Runs great | est. 50.2 tok/s40.2–60.2calibrated estimate ±20% | 17.7 / 33.6 GB | Unified memory | — |
| Q8_0 | 26.86 GB | Runs great | est. 43.7 tok/s34.9–52.4calibrated estimate ±20% | 27.6 / 33.6 GB | Unified memory | — |
Models with a thinking mode spend extra tokens thinking, so their speed thresholds are 1.5× stricter (30 / 12 / 3 tok/s). With thinking turned off, a model may do one grade better.
Where the memory goes at Q4_K_M
- Weights
- 17.0 GB
- KV cache
- 0.2 GB
- Compute buffer
- 0.6 GB
- Free
- 15.9 GB
- Not usable by the GPU
- 14.4 GB
Context length vs. KV cache
| Context | KV f16 | KV q8_0 | KV q4_0 |
|---|---|---|---|
| 4k | 17.6 GBRuns great est. 51.2 tok/s41.0–61.5calibrated estimate ±20% | 17.5 GBRuns great est. 51.7 tok/s41.4–62.1calibrated estimate ±20% | 17.5 GBRuns great est. 52.0 tok/s41.6–62.4calibrated estimate ±20% |
| 8k | 17.7 GBRuns great est. 50.2 tok/s40.2–60.2calibrated estimate ±20% | 17.6 GBRuns great est. 51.2 tok/s40.9–61.4calibrated estimate ±20% | 17.6 GBRuns great est. 51.7 tok/s41.4–62.0calibrated estimate ±20% |
| 16k | 17.9 GBRuns great est. 48.2 tok/s38.6–57.9calibrated estimate ±20% | 17.8 GBRuns great est. 50.1 tok/s40.1–60.1calibrated estimate ±20% | 17.7 GBRuns great est. 51.1 tok/s40.9–61.3calibrated estimate ±20% |
| 32k | 18.4 GBRuns great est. 44.8 tok/s35.8–53.7calibrated estimate ±20% | 18.1 GBRuns great est. 48.0 tok/s38.4–57.6calibrated estimate ±20% | 17.9 GBRuns great est. 49.9 tok/s39.9–59.9calibrated estimate ±20% |
| 64k | 19.4 GBRuns great est. 39.1 tok/s31.3–46.9calibrated estimate ±20% | 18.8 GBRuns great est. 44.3 tok/s35.4–53.2calibrated estimate ±20% | 18.4 GBRuns great est. 47.7 tok/s38.2–57.3calibrated estimate ±20% |
| 128k | 21.3 GBRuns great est. 31.2 tok/s25.0–37.4calibrated estimate ±20% | 20.1 GBRuns great est. 38.4 tok/s30.7–46.1calibrated estimate ±20% | 19.4 GBRuns great est. 43.9 tok/s35.1–52.6calibrated estimate ±20% |
| 256k | 25.2 GBRuns well est. 22.2 tok/s17.8–26.7calibrated estimate ±20% | 22.7 GBRuns great est. 30.3 tok/s24.3–36.4calibrated estimate ±20% | 21.4 GBRuns great est. 37.8 tok/s30.2–45.3calibrated estimate ±20% |
S = Runs great · A = Runs well · B = Runs slowly · F = Won't run
At Q4_K_M the verdict stays Runs great up to 128k context with an f16 KV cache, and up to 256k with q8_0.
Estimated speed
- Generation
- est. 50.2 tok/s (40.2–60.2, calibrated estimate ±20%)
- Prompt processing
- about 325 tok/s (195–456, rough estimate ±40%)
Measured on this exact combination
No public measurement for this exact combination yet; the numbers above are estimates.
If this is not enough
A larger model that also runs well on the Apple M4 Pro
Runs greatK2-Horizon MoVA 36B-A4B: Runs great, est. 36.8 tok/s (25.8–47.8, theoretical estimate ±30%)
A larger quant that still runs great
Runs greatQ8_0 (26.86 GB): Runs great, est. 43.7 tok/s (34.9–52.4, calibrated estimate ±20%)
How to run it
Commands for the UD-Q4_K_M file. Both tools download from Hugging Face on first run.
File: gemma-4-26B-A4B-it-UD-Q4_K_M.gguf (16.95 GB) from unsloth/gemma-4-26B-A4B-it-GGUF.
llama-server -hf unsloth/gemma-4-26B-A4B-it-GGUF:UD-Q4_K_M -c 8192 -ngl all -fa on- -ngl all loads every layer on the GPU.
- -fa on enables flash attention (needed for KV cache quantization).
- --cache-type-k q8_0 --cache-type-v q8_0 shrinks the KV cache to 0.09 GB at 8k context.
Terminal:
OLLAMA_CONTEXT_LENGTH=8192 ollama serve
ollama run hf.co/unsloth/gemma-4-26B-A4B-it-GGUF:UD-Q4_K_M- Ollama defaults to 4k context on GPUs under 24 GB. Set OLLAMA_CONTEXT_LENGTH when starting the server, or /set parameter num_ctx inside the chat.
/set parameter num_ctx 8192
Related pages
Guide: Running local LLMs on a Mac (M4, M5): how much unified memory?
Other models on the Apple M4 Pro
Gemma 4 26B-A4B on other hardware
Frequently asked questions
Can I run Gemma 4 26B-A4B on the Apple M4 Pro?
Q4_K_M fits in unified memory (17.7 of 33.6 GB usable by the GPU): Runs great, est. 50.2 tok/s (40.2–60.2, calibrated estimate ±20%). Q4_K_M needs 17.7 GB at 8k context; the GPU can use 33.6 GB of the unified memory.
How much context can Gemma 4 26B-A4B use on the Apple M4 Pro?
At Q4_K_M the verdict stays Runs great up to 128k context with an f16 KV cache (2.7 GB of KV) and up to 256k with a q8_0 KV cache (2.9 GB). The model supports up to 256k.
Which quant should I use, and how fast is it?
Q4_K_M (16.95 GB) is the recommended balance: Runs great, est. 50.2 tok/s (40.2–60.2, calibrated estimate ±20%). The largest tracked file that still gets Runs great is Q8_0 (26.86 GB), est. 43.7 tok/s (34.9–52.4, calibrated estimate ±20%).
Speeds are estimates from memory bandwidth, calibrated against public benchmarks, and each one comes with an error band and a confidence label. Real results vary with drivers, backend, context length and thermals.