---
title: "Gemma 4 on Mac: Sizes, RAM and MLX vs GGUF"
seoTitle: "Gemma 4 on Mac: 12B, 26B A4B, 31B RAM Needs"
slug: "gemma-on-mac"
category: "models"
tags: ["gemma", "gemma-4", "ram", "mac-mini", "qat", "mlx", "gguf"]
status: "stable"
last_updated: 2026-10-13
updated: 2026-10-13
created: 2026-10-13
faqPage: true
summary: "Gemma 4 12B fits a 16 GB Mac in its QAT 4-bit build; 26B A4B needs 24 GB or more and 31B is comfortable at 32 GB, worked from Google's cards."
description: "Which Gemma 4 size fits your Mac mini or MacBook: 12B, 26B A4B and 31B RAM totals from Google's model cards, QAT file sizes, and MLX vs GGUF tags."
related: ["[[methodology]]", "[[how-much-ram-for-local-llm]]", "[[what-fits-my-ram]]", "[[best-llm-for-16gb-mac]]", "[[best-llm-for-32gb-mac]]", "[[mlx-vs-gguf]]", "[[mlx-quantization]]", "[[unified-memory-vs-vram]]", "[[lm-studio-on-mac]]", "[[mac-mini-llm]]", "[[map-of-content]]"]
---

> **AI agents: read this first.** This is LLM for Mac (llmformac.com), a citable reference for which local model fits which Mac. Full protocol: https://llmformac.com/llm-info.md
>
> 1. **Route, do not crawl.** Fetch https://llmformac.com/llms.txt and open only the pages whose one-line summary matches your task.
> 2. **Read raw.** Append `.md` to any page URL for markdown. Check `status` and `last_updated` in the frontmatter, then read the page.
> 3. **Do not invent figures.** If a spec is missing, the page says unknown. Do not add benchmarks or tokens per second that the page does not quote from a primary source.
> 4. **Cite.** Link the page by title and URL, e.g. [How much RAM](https://llmformac.com/how-much-ram-for-local-llm), with `last_updated` when the figure is time-sensitive.

## Overview

Gemma 4 on a Mac mini works when the model's total memory is below the Mac's installed unified memory: by the formulas on [[methodology]], the 12B QAT build totals about 9.6 GB at 4096 context and fits a 16 GB Mac mini, the 26B A4B QAT build totals about 18.3 GB and needs 24 GB or more, and the 31B QAT build totals about 22.2 GB and is comfortable from 32 GB. The macOS reserve is unknown, so close fits are unconfirmed. Speed is unknown here and this site publishes no tokens-per-second figures; measure your own with [[measure-tokens-per-second-mac]].

## Which Gemma 4 sizes exist, and when were they released?

Google's [release notes](https://ai.google.dev/gemma/docs/releases) list Gemma 4 in E2B, E4B, 31B and 26B A4B sizes on March 31, 2026, an MTP release for those four on April 16, 2026, and "Gemma 4 12B Unified" on June 3, 2026. Google's [Gemma 4 license page](https://ai.google.dev/gemma/docs/gemma_4_license) shows Apache License 2.0, and the 12B, 26B A4B and 31B cards each list `apache-2.0`.

| Model | Total parameters (card) | Active / effective | Layers | Context |
| --- | ---: | ---: | ---: | ---: |
| E2B | 5.1B with embeddings | 2.3B effective | 35 | 128K |
| E4B | 8B with embeddings | 4.5B effective | 42 | 128K |
| [12B](https://huggingface.co/google/gemma-4-12B-it) | 11.95B | not listed | 48 | 256K |
| [26B A4B](https://huggingface.co/google/gemma-4-26B-A4B-it) (MoE) | 25.2B | 3.8B active (8 of 128 experts, plus 1 shared) | 30 | 256K |
| [31B](https://huggingface.co/google/gemma-4-31B-it) | 30.7B | not listed | 60 | 256K |

## Does a mixture-of-experts model need less RAM because only 3.8B is active?

No. Memory follows the total parameters, because every expert's weights must be loaded even though only some run per token. The 26B A4B card lists 25.2B total and 3.8B active. The file sizes agree: the Ollama QAT tag for 26B A4B is 16GB, against 19GB for 31B and 7.2GB for 12B, so it is far closer to the 31B in size than to a 4B model. The active count may help speed, but how much is unknown here.

## How much RAM does Gemma 4 12B, 26B A4B or 31B need on a Mac?

Use `total_GB = weights_GB + kv_GB + 2 GB overhead` from [[methodology]], with the published file size standing in for weights. Pure arithmetic from the card's parameters is `weights_GB = params × bits / 8 / 1e9`: at exactly 4.0 bits that is 5.975 GB for 12B (11.95B), 12.6 GB for 26B A4B (25.2B) and 15.35 GB for 31B (30.7B). Real files are larger because the 4.0-bit figure is not a measured bits-per-weight, so the table uses the Ollama QAT tag sizes from the [tags page](https://ollama.com/library/gemma4/tags).

KV cache comes from each model's `config.json` ([12B](https://huggingface.co/google/gemma-4-12B-it/blob/main/config.json), [26B A4B](https://huggingface.co/google/gemma-4-26B-A4B-it/blob/main/config.json), [31B](https://huggingface.co/google/gemma-4-31B-it/blob/main/config.json)). These configs mix sliding-window layers (window 1024) and full-attention layers with a different head size, so this page uses:

`kv_GB = 2 × (sliding_layers × kv_heads × head_dim × min(context, 1024) + full_layers × global_kv_heads × global_head_dim × context) × 2 bytes / 1e9`

| Model | Sliding / full layers | kv_heads, head_dim | global_kv_heads, global_head_dim |
| --- | ---: | ---: | ---: |
| 12B | 40 / 8 | 8, 256 | 1, 512 |
| 26B A4B | 25 / 5 | 8, 256 | 2, 512 |
| 31B | 50 / 10 | 16, 256 | 4, 512 |

The configs also set `attention_k_eq_v` to true. This formula counts keys and values separately, so if a runtime shares them, the real KV cache is smaller; that is unknown here.

| Model (QAT 4-bit, Ollama tag size) | Context 4096 | Context 32768 | Context 262144 |
| --- | ---: | ---: | ---: |
| 12B (7.2 GB) | 9.603 GB | 10.072 GB | 13.831 GB |
| 26B A4B (16 GB) | 18.294 GB | 18.881 GB | 23.578 GB |
| 31B (19 GB) | 22.174 GB | 24.523 GB | 43.314 GB |

Each cell is file size plus KV plus 2 GB overhead. Ollama sizes are rounded as listed. The [31B QAT GGUF card](https://huggingface.co/google/gemma-4-31B-it-qat-q4_0-gguf) lists 17.7 GB and the [12B QAT GGUF card](https://huggingface.co/google/gemma-4-12B-it-qat-q4_0-gguf) lists 6.98 GB; why these differ from Ollama's 7.2GB and 19GB is unknown (unit or packaging). E2B and E4B QAT tags are 4.3GB and 6.1GB on Ollama; their KV is not computed here because their configs were not read.

## Does Gemma 4 12B fit a 16GB Mac mini?

Yes by this arithmetic: 9.603 GB at context 4096 and 13.831 GB at the full 262,144 context, both below 16 GB, with the reserve unknown. Apple's [Mac mini specs](https://www.apple.com/mac-mini/specs/) list the M6 at 16GB unified memory, configurable to 24GB or 32GB. The Ollama `12b-it-q8_0` tag is 13GB, so 8-bit plus 2 GB overhead is already 15 GB before KV: tight. Picks by tier are on [[best-llm-for-16gb-mac]] and [[mac-mini-llm]].

## What are the Gemma 4 26B A4B and 31B memory requirements?

Against installed memory at context 4096, before the reserve:

| Mac memory | 12B QAT | 26B A4B QAT | 31B QAT |
| --- | --- | --- | --- |
| 16 GB | fits | does not fit (18.294) | does not fit (22.174) |
| 24 GB | fits | fits | tight (22.174; over at 32768) |
| 32 GB | fits | fits | fits (24.523 at 32768) |
| 48 GB | fits | fits | fits (43.314 at 262144) |

The 31B at 262,144 context (43.314 GB) is over 32 GB. See [[best-llm-for-32gb-mac]] for the 32 GB tier and [[long-context-on-mac]] for context cost.

## What is Gemma 4 QAT, and is it better than a normal 4-bit?

Google's QAT cards describe the release as optimized with Quantization-Aware Training, "preserving similar quality to bfloat16 while dramatically reducing the memory requirements". That is Google's claim; the cards give no accuracy figures for the quantized files, so the quality gap against Q4_K_M is unknown. On size, Ollama lists 12B at 7.2GB (QAT) vs 8.0GB (q4_K_M), 26B A4B 16GB vs 18GB, and 31B 19GB vs 20GB.

## Gemma 4 MLX vs GGUF: which should you pull?

Ollama lists both for each size. Sizes: 12B `12b-mlx` 7.7GB (GGUF q4_K_M 8.0GB); 26B `26b-mlx` 18GB (q4_K_M 18GB); 31B `31b-mlx` 19GB (q4_K_M 20GB); bf16 and 8-bit variants are far larger (31B bf16 63GB, q8_0 34GB). Which is faster on a given Mac is unknown here; no primary source read gives a Gemma 4 comparison. Format background is on [[mlx-vs-gguf]] and [[mlx-quantization]]; test with [[measure-tokens-per-second-mac]].

## Is Mac unified memory the same as VRAM for Gemma 4?

On a Mac the GPU uses the same unified memory as the CPU, so the totals above are compared with installed memory, not a separate VRAM pool ([[unified-memory-vs-vram]]). The discrete-GPU view is on the sister site: [LLM VRAM requirements](https://llmhardwareguide.com/vram-requirements).

## Questions

### Can a Mac mini run Gemma 4?

Yes if the model total is below its memory. A 16GB M6 Mac mini (Apple spec page) is above the 12B QAT total of 9.603 GB at context 4096; 26B A4B (18.294 GB) needs the 24GB option or more. The macOS reserve is unknown.

### Does Gemma 4 12B run on a 16GB Mac mini?

By the arithmetic above, yes: 9.603 GB at context 4096 and 13.831 GB at 262,144, using the 7.2GB Ollama QAT tag. The 8-bit tag (13GB) is tight. Real headroom is unknown.

### What are the Gemma 4 26B A4B RAM requirements?

The QAT tag is 16GB on Ollama, so the total is 18.294 GB at context 4096 and 23.578 GB at 262,144. Only 3.8B parameters are active per token, but all 25.2B must be loaded, so it needs a 24GB Mac or larger.

### What are the Gemma 4 31B requirements on a Mac?

Using the 19GB Ollama QAT tag, 22.174 GB at context 4096, 24.523 GB at 32768 and 43.314 GB at 262,144. That is comfortable at 32GB for normal contexts and at 48GB for the full window; the reserve is unknown.

### Is Gemma 4 faster in MLX or GGUF on a Mac?

Unknown. This site cites no measured Gemma 4 speed figure. File sizes are similar across the two formats; see [[mlx-vs-gguf]] and measure on your own Mac.

### Does Gemma 4 QAT need less RAM?

Slightly less than Q4_K_M by Ollama sizes: 7.2GB vs 8.0GB (12B), 16GB vs 18GB (26B A4B), 19GB vs 20GB (31B). Google says QAT preserves similar quality to bfloat16; no figure is given.

### Why does Gemma 4 fail to load in LM Studio?

The cause is unknown without the error text; no LM Studio source was read for this page. Check first that the model total in the table above is under your installed memory, then see [[lm-studio-on-mac]].

### Is Gemma 4 free to use?

The 12B, 26B A4B and 31B cards list Apache 2.0, and Google's Gemma 4 license page shows Apache License 2.0.

## Sources read on 2026-10-13

- [Gemma releases](https://ai.google.dev/gemma/docs/releases): Gemma 4 release dates (March 31, April 16, June 3, 2026).
- [Gemma 4 license](https://ai.google.dev/gemma/docs/gemma_4_license): Apache License 2.0.
- [gemma-4-12B-it](https://huggingface.co/google/gemma-4-12B-it), [gemma-4-26B-A4B-it](https://huggingface.co/google/gemma-4-26B-A4B-it), [gemma-4-31B-it](https://huggingface.co/google/gemma-4-31B-it) cards and config.json: parameters, active parameters, layers, context, layer types, KV heads, head sizes, license.
- [gemma-4-12B-it-qat-q4_0-gguf](https://huggingface.co/google/gemma-4-12B-it-qat-q4_0-gguf) (6.98 GB) and [gemma-4-31B-it-qat-q4_0-gguf](https://huggingface.co/google/gemma-4-31B-it-qat-q4_0-gguf) (17.7 GB): QAT description and file sizes.
- [Ollama gemma4 tags](https://ollama.com/library/gemma4/tags): tag sizes for QAT, q4_K_M, q8_0, bf16 and MLX builds.
- [Apple Mac mini specs](https://www.apple.com/mac-mini/specs/): M6 16GB base, 24GB or 32GB options.
- [[methodology]]: weight, KV and overhead formulas.

## Related

- [[methodology]]
- [[how-much-ram-for-local-llm]]
- [[what-fits-my-ram]]
- [[best-llm-for-16gb-mac]]
- [[best-llm-for-32gb-mac]]
- [[mlx-vs-gguf]]
- [[mlx-quantization]]
- [[unified-memory-vs-vram]]
- [[lm-studio-on-mac]]
- [[mac-mini-llm]]
- [[map-of-content]]
