Run Gemma 4 31B on Apple Silicon

Gemma 4 31B is Google's largest dense Gemma 4 model, released on 2 April 2026 under Apache 2.0, with a 256K context and image input. At Q4_K_M the weights are about 19 GB, so a Mac with 32 GB runs it and 48 GB or more leaves room for a long context.

Parameters
31B dense
Min memory (Q4_K_M)
32 GB
From
$99/mo

How much memory does Gemma 4 31B need?

Weight size is parameter count × bits per weight; recommended memory adds 15% runtime headroom plus a KV-cache allowance for the 262,144-token context window.

QuantizationWeightsRecommended RAMCheapest fitNotes
Q4_K_M~19 GB32 GBM4 (Mac mini)Best quality/size trade-off — the default for most deployments
Q8_0~33.3 GB48 GBM4 Pro (Mac mini)Near-lossless; noticeably better on code and long reasoning
FP16~62.6 GB80 GBM4 Max (Mac Studio)Full precision — research and eval baselines

Which Mac should you pick?

Generation speed on Apple Silicon scales mostly with memory bandwidth, so the chip choice sets both whether the model fits and how fast it runs.

ChipMax RAMBandwidthFits Gemma 4 31B?From
M4 · Mac mini32 GB120 GB/s Q4$99/mo
M4 Pro · Mac mini64 GB273 GB/s Q4 + Q8$200/mo
M4 Max · Mac Studio128 GB546 GB/s Q4 + Q8 + FP16$286/mo
M3 Ultra · Mac Studio256 GB819 GB/s Q4 + Q8 + FP16$571/mo

Deploy Gemma 4 31B in about 5 minutes

  1. 1

    Build a Mac in the constructor — pick an M4 with at least 32 GB of unified memory.

  2. 2

    Pick any Ollama-based stack (or a clean machine) and pull Gemma 4 31B with one command — every deployment ships the OpenAI-compatible API.

  3. 3

    Point your existing OpenAI SDK code at the new base_url and ship.

from openai import OpenAI

client = OpenAI(
    api_key="mcy_live_...",
    base_url="https://dep-xxxx.macyou.cloud/v1",
)
response = client.chat.completions.create(
    model="gemma-4-31b",
    messages=[{"role": "user", "content": "Hello!"}],
)

License and what it's good at

Apache 2.0 — Apache 2.0: commercial use is allowed under the standard license terms. Made by Google.

Typical workloads: a private general assistant on one mac; multilingual writing and translation; reading documents and screenshots.

Frequently asked questions

Gemma 4 31B or Gemma 4 26B A4B?

The 31B is dense and reads every weight for every token. The 26B A4B is a mixture of experts with about 4B active, so it generates much faster on the same Mac.

Related