Gemma4All logoGemma4All
Gemma 4Mac StudioHardware

Gemma 4 on Mac Studio: Running the 26B and 31B Models

Which Mac Studio configuration to buy for Gemma 4's biggest models. Memory matrix for M4 Max and M3 Ultra, real tokens/sec, and an honesty check first.

July 10, 20269 min read

The Mac Studio is where Gemma 4's two largest models — the 26B A4B MoE and the 31B dense model — stop being a tight squeeze and start being genuinely comfortable, even at higher-precision quantization than most machines can afford. Here's exactly which configuration you need and what to expect.

Quick Answer

For Gemma 4 26B A4B (MoE) at full BF16 precision (48 GB): the base Mac Studio M4 Max, 36GB is tight but workable at Q4_0/SFP8; step up to 64GB for BF16 headroom. Either config comfortably runs 26B A4B at Q4_0 (15.6 GB).

For the full 31B dense model at BF16 (58.3 GB): you need the Mac Studio M3 Ultra, 96GB — currently Apple's only Mac Studio config with enough room to run 31B at full precision with real headroom left over for a long context window.

Don't need the big models? Read the honesty section below before you spend $2,499+ — a lot of real-world use cases don't need a Mac Studio at all.

Config × Model Matrix

The two current Mac Studio chip options, per Apple's specs and buy page:

  • M4 Max — 410–546 GB/s memory bandwidth, starts at $2,499 with 36GB, configurable to 64GB (128GB is listed as the chip's architectural spec but has been pulled from Apple's store amid the 2026 memory shortage — Macworld, 9to5Mac).
  • M3 Ultra — 819 GB/s memory bandwidth, starts at $5,299 fixed at 96GB (the 256GB and 512GB configs Apple originally offered are also gone for the same reason — MacRumors).

Here's how each Gemma 4 model fits, using Google's official Q4_0/SFP8/BF16 weight sizes:

Config12B and below26B A4B (15.6/25/48 GB)31B (17.4/30.4/58.3 GB)
M4 Max, 36GB — $2,499TrivialComfortable at Q4_0; SFP8 tight; BF16 noComfortable at Q4_0; SFP8 tight; BF16 no
M4 Max, 64GB — ~$3,000+TrivialComfortable at all three quant levelsComfortable at Q4_0/SFP8; BF16 tight (~6 GB headroom)
M4 Max, 128GB (spec max, currently unavailable)TrivialComfortable, BF16 with room to spareComfortable at BF16 with room to spare
M3 Ultra, 96GB — $5,299TrivialComfortable at every quant level, including BF16Comfortable at every quant level, including BF16
M3 Ultra, 256GB/512GB (formerly offered, no longer available)TrivialComfortableComfortable, room for multiple models loaded at once

"Comfortable" assumes macOS and background overhead of roughly 4–8 GB is subtracted before you calculate headroom — the same rule of thumb used throughout our hardware requirements guide, just less of a constraint here since even the base Mac Studio configuration has 36GB to work with.

The practical takeaway: a 96GB M3 Ultra is the one config on this page that runs literally every Gemma 4 model at every precision level Google publishes, with headroom left for long conversations. That's rare — most hardware forces a tradeoff between model size and quantization.

Do You Actually Need a Mac Studio?

Be honest with yourself before spending $2,499+: if 12B or smaller covers your use case, you don't need a Mac Studio. Gemma 4 12B needs only 6.7 GB of weights at Q4_0 and runs comfortably on a 16GB Mac Mini M4 starting at $799 — a fraction of the Mac Studio's price, for a machine that's silent, small, and just as capable for that model size. We cover exactly which Mac Mini configuration fits which model in our Gemma 4 on Mac Mini guide.

The Mac Studio earns its price specifically when you want one (or more) of these things that a Mac Mini can't deliver:

  • 26B A4B or 31B at BF16 precision, not just Q4_0 — meaningfully better output quality if you're doing serious research, long-form writing, or code review where accuracy compounds.
  • A large KV cache alongside a big model — running 31B and keeping a 200K-token conversation in context simultaneously needs memory the Mac Mini's 48GB ceiling doesn't have.
  • Running the model as a dedicated always-on server while your actual laptop or desktop stays free for other work — the Mac Studio's larger memory pool and higher bandwidth make it a better fit for that role than a Mac Mini.
  • Headroom to run multiple models, or a big model alongside other memory-hungry tools (a full IDE, a database, other ML workloads) without hitting a wall.

If none of that describes your workflow, the honest recommendation is to save the money and go with a Mac Mini instead — or even a MacBook Air with 16GB, per our full hardware requirements guide.

Which Model to Pick, by Configuration

M4 Max, 36GB (the base config): Run 26B A4B at Q4_0 (15.6 GB) — this is the sweet spot for this tier, leaving comfortable room for a long context window. The 31B model also fits at Q4_0 (17.4 GB), so if dense-model quality matters more to you than the MoE speed advantage, that's a reasonable choice too.

M4 Max, 64GB: This is where things open up — 26B A4B or 31B at SFP8 (25 GB / 30.4 GB) both fit with real headroom, giving you a meaningful quality step up from Q4_0 without moving to the M3 Ultra. BF16 31B (58.3 GB) technically fits but leaves only ~6 GB for everything else — workable for short sessions, not for long ones.

M3 Ultra, 96GB: Run 31B at BF16 (58.3 GB) if maximum quality is the goal — this is as good as Gemma 4 gets locally, full stop, with roughly 38 GB left over for context and multitasking. If speed matters more than the last percentage point of quality, 26B A4B at any quantization level runs faster thanks to its MoE architecture activating only ~4B parameters per token, while still comfortably fitting in 96GB.

Realistic Tokens/Sec

Apple and Google haven't published Gemma-4-specific Mac Studio benchmarks, so every number below is a labeled proxy from a comparably-sized model on the same or similar hardware — treat these as directional estimates, not guaranteed throughput.

  • M3 Ultra, 32B-class dense model (proxy for Gemma 4 31B): a systematic MLX benchmark across quantization levels and context lengths found Q4 quantization hitting 31.2 tokens/second at a 1K-token context, declining to roughly 8.5 tokens/second at 128K context as the KV cache grows (ml-explore/mlx GitHub discussion). This is a real benchmark on comparable-size hardware, not a Gemma 4 measurement — but it's a solid proxy given the similar parameter count and dense architecture.
  • M4 Max, larger dense models: one third-party benchmark reported a 128GB M4 Max Mac Studio running 70B-class models at roughly 22 tokens/second at Q4 quantization (CraftRigs). Since Gemma 4's 31B dense model is under half that parameter count, expect noticeably faster throughput on the same chip — a reasoned expectation, not a direct measurement.
  • M4 Max, mid-size dense models: a separate MLX benchmark clocked a 32-33B class model at roughly 38 tokens/second on M4 Max (markaicode) — the closest size-matched proxy we found for Gemma 4 31B on this chip.
  • 26B A4B (MoE) on either chip: no direct benchmark exists. Because this model activates only ~4B of its 26B total parameters per token, expect it to run substantially faster than the dense proxies above — likely 40+ tokens/second on M4 Max and even higher on the M3 Ultra's 819 GB/s bandwidth. This is a reasoned estimate based on the MoE active-parameter principle already established in our hardware requirements guide, not a measured figure.

The consistent pattern across every source: Apple Silicon LLM inference is memory-bandwidth-bound, not compute-bound, which is why the M3 Ultra's 819 GB/s outperforms the M4 Max's 410–546 GB/s on large dense models specifically — and why the MoE model's lower active-parameter count matters more for speed than its larger total size.

Setting It Up

Model selection is the hard part — running it takes minutes once you've picked the right size:

  1. Run Gemma 4 with Ollamaollama pull gemma4:31b or ollama pull gemma4:26b downloads the GGUF weights and Metal acceleration kicks in automatically on Apple Silicon.
  2. Run Gemma 4 in LM Studio — if you want a GUI and easy access to both GGUF and MLX-format downloads (MLX often runs faster than llama.cpp-based Ollama on Apple Silicon for the same model).

For a large model that's going to stay loaded, also set OLLAMA_KEEP_ALIVE=-1 so it doesn't unload between requests — worth doing on any machine, but especially one this expensive to leave idle-and-reloading.

FAQ

Can a Mac Studio run Gemma 4's 31B model? Yes, every current Mac Studio configuration (36GB and up) fits 31B at Q4_0 (17.4 GB). For BF16 precision (58.3 GB) — the highest quality Gemma 4 offers — you need at least 64GB, and 96GB (the M3 Ultra) gives you comfortable headroom rather than a tight fit.

Do I need the M3 Ultra, or is M4 Max enough? If you want BF16 precision on the 31B model with real context headroom, the 96GB M3 Ultra is the safer choice. If Q4_0 or SFP8 quality is good enough for your use case — which it is for most people — the 64GB M4 Max handles both 26B A4B and 31B comfortably at a lower price.

Is the 26B A4B MoE model actually faster than 31B on a Mac Studio? Yes, meaningfully. It activates only around 4 billion of its 26 billion total parameters per token, so despite loading a larger total footprint into memory, it generates tokens faster than the fully-dense 31B model — the same MoE speed advantage documented on lower-end hardware in our hardware requirements guide.

Is a Mac Studio overkill for Gemma 4 12B? Yes. Gemma 4 12B needs only 6.7 GB of weights and runs comfortably on hardware costing a fraction of a Mac Studio's price — see the honesty section above, and our Gemma 4 on Mac Mini guide for the specific configuration to buy instead.

Why can't I order a 128GB M4 Max or a 256GB/512GB M3 Ultra anymore? Apple pulled those configurations from its online store during 2026 amid an industry-wide memory chip shortage tied to AI data center demand, alongside broader price increases across the Mac lineup (MacRumors). They may return if the shortage eases — check Apple's current configurator before assuming they're gone for good.

The Full Picture

This guide covers the Mac Studio specifically. For the complete memory breakdown across all five Gemma 4 models — including NVIDIA GPUs, CPU-only setups, and what Q4_0/SFP8/BF16 actually mean — see our Gemma 4 hardware requirements guide. If a Mac Studio is more than you need, our Gemma 4 on Mac Mini guide covers the same model-fit question for Apple's smaller desktop.