Can I run Gemma 3 12B on the Apple M4 Pro?

Runs greatQ4_K_M fits in unified memory (8.4 of 16.8 GB usable by the GPU): Runs great, est. 20.9 tok/s (16.7–25.1, calibrated estimate ±20%).

Unified memory — by default the GPU can use about 70% of itCustom license · Gemma — check terms before commercial useCommunity GGUF · bartowski

24 GB unified memory · 273.0 GB/s · FP16 17.0 TFLOPS. Assumes 8k context and an f16 KV cache. Verdicts are shown for each memory size.

Verdict by memory size

The page uses the 24 GB configuration; here is every size.

  • 24 GBRuns greatest. 20.9 tok/s (16.7–25.1, calibrated estimate ±20%)
  • 48 GBRuns greatest. 20.9 tok/s (16.7–25.1, calibrated estimate ±20%)
  • 64 GBRuns greatest. 20.9 tok/s (16.7–25.1, calibrated estimate ±20%)

Every quant of Gemma 3 12B on the Apple M4 Pro

4 tracked GGUF files, smallest first, at 8k context
QuantFile sizeVerdictSpeedMemoryRuns asNotes
Q2_K4.77 GBRuns great
est. 30.9 tok/s24.7–37.0calibrated estimate ±20%
5.9 / 16.8 GBUnified memory—
IQ4_XS6.55 GBRuns great
est. 23.1 tok/s18.5–27.7calibrated estimate ±20%
7.7 / 16.8 GBUnified memory—
Q4_K_Mbaseline7.30 GBRuns great
est. 20.9 tok/s16.7–25.1calibrated estimate ±20%
8.4 / 16.8 GBUnified memory—
Q8_012.51 GBRuns well
est. 12.6 tok/s10.0–15.1calibrated estimate ±20%
13.6 / 16.8 GBUnified memory—

Where the memory goes at Q4_K_M

Weights, KV cache and compute buffer are the model; the OS reservation is the display driver.
Unified memory
Weights
7.3 GB
KV cache
0.5 GB
Compute buffer
0.6 GB
Free
8.4 GB
Not usable by the GPU
7.2 GB

Context length vs. KV cache

KV cache

Memory needed and verdict at Q4_K_M for each context length and KV cache type, with estimated tokens per second.
ContextKV f16KV q8_0KV q4_0
4k
8.1 GBRuns great
est. 21.6 tok/s17.3–26.0calibrated estimate ±20%
8.0 GBRuns great
est. 22.0 tok/s17.6–26.4calibrated estimate ±20%
7.9 GBRuns great
est. 22.2 tok/s17.8–26.6calibrated estimate ±20%
8k
8.4 GBRuns great
est. 20.9 tok/s16.7–25.1calibrated estimate ±20%
8.2 GBRuns great
est. 21.6 tok/s17.3–25.9calibrated estimate ±20%
8.0 GBRuns great
est. 22.0 tok/s17.6–26.4calibrated estimate ±20%
16k
9.0 GBRuns well
est. 19.6 tok/s15.6–23.5calibrated estimate ±20%
8.5 GBRuns great
est. 20.8 tok/s16.6–25.0calibrated estimate ±20%
8.3 GBRuns great
est. 21.5 tok/s17.2–25.8calibrated estimate ±20%
32k
10.2 GBRuns well
est. 17.3 tok/s13.9–20.8calibrated estimate ±20%
9.2 GBRuns well
est. 19.4 tok/s15.5–23.3calibrated estimate ±20%
8.7 GBRuns great
est. 20.7 tok/s16.6–24.8calibrated estimate ±20%
64k
12.7 GBRuns well
est. 14.1 tok/s11.3–17.0calibrated estimate ±20%
10.7 GBRuns well
est. 17.1 tok/s13.7–20.5calibrated estimate ±20%
9.6 GBRuns well
est. 19.2 tok/s15.4–23.1calibrated estimate ±20%
128k
15.9 GBRuns slowly
est. 6.0 tok/s4.2–7.8theoretical estimate ±30%
13.6 GBRuns well
est. 13.8 tok/s11.0–16.5calibrated estimate ±20%
11.4 GBRuns well
est. 16.8 tok/s13.4–20.2calibrated 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 8k context with an f16 KV cache, and up to 16k with q8_0.

Estimated speed

Generation
est. 20.9 tok/s (16.7–25.1, calibrated estimate ±20%)
Prompt processing
about 765 tok/s (459–1,071, 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

How to run it

Commands for the Q4_K_M file. Both tools download from Hugging Face on first run.

File: google_gemma-3-12b-it-Q4_K_M.gguf (7.30 GB) from bartowski/google_gemma-3-12b-it-GGUF.

llama.cpp
llama-server -hf bartowski/google_gemma-3-12b-it-GGUF: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.29 GB at 8k context.
Ollama

Terminal:

OLLAMA_CONTEXT_LENGTH=8192 ollama serve
ollama run hf.co/bartowski/google_gemma-3-12b-it-GGUF: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

Frequently asked questions

Can I run Gemma 3 12B on the Apple M4 Pro?

Q4_K_M fits in unified memory (8.4 of 16.8 GB usable by the GPU): Runs great, est. 20.9 tok/s (16.7–25.1, calibrated estimate ±20%). Q4_K_M needs 8.4 GB at 8k context; the GPU can use 16.8 GB of the unified memory.

How much context can Gemma 3 12B use on the Apple M4 Pro?

At Q4_K_M the verdict stays Runs great up to 8k context with an f16 KV cache (0.5 GB of KV) and up to 16k with a q8_0 KV cache (0.6 GB). The model supports up to 128k.

Which quant should I use, and how fast is it?

Q4_K_M (7.30 GB) is the recommended balance: Runs great, est. 20.9 tok/s (16.7–25.1, calibrated estimate ±20%). It is also the largest tracked file that gets this verdict.

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.