alt.freeweights.gemma / gemma-4-26B-A4B-it-qat-q4_0-mlx-aligned
From: mlx-community <huggingface.co/mlx-community>Newsgroups: alt.freeweights.gemmaSubject:

gemma-4-26B-A4B-it-qat-q4_0-mlx-aligned

Date: 2026-11-15Commit: 745a97aSigned: 2DC28CC7B26A283B ✓

Text generation model with 25.2B parameters. Safetensors weights, 15.8 GB in all. Published by mlx-community under Apache-2.0.

25.2B params15.8GBgemma-4-26B-A4B-it-qat-q4_0-mlx-alignedsafetensorspermissive
FactsParams25.2BSize15.8 GBFormatssafetensorsTasktext generationLicenseApache-2.0From sourcepermissive
$ fw get mlx-community/gemma-4-26B-A4B-it-qat-q4_0-mlx-aligned
# manifest sha256 8d8d139adc7d… · 15.8 GB · 13 files
$ fw verify ./gemma-4-26B-A4B-it-qat-q4_0-mlx-aligned mlx-community/gemma-4-26B-A4B-it-qat-q4_0-mlx-aligned
From sourceHosted (signed)mlx-community/gemma-4-26B-A4B-it-qat-q4_0-mlx-alignedLast check: 2026-11-15 05:18 UTC

Get help: custom fine-tune or private deploy. We review your setup before we quote.

Quantized of gemma-4-26B-A4B-it-qat-q4_0-unquantized.

Works with

Overview

Size
15.8 GB
Weights
15.8 GB (safetensors)
Parameters
25.2B
Formats
safetensors
Task
text generation
License
Apache-2.0 (permissive)
Files
13, each with a sha256
Publisher
mlx-community
Added
2026-11-15
Section
alt.freeweights.gemma
Lineage

Original release from the publisher.

Base model: google/gemma-4-26B-A4B-it-qat-q4_0-unquantized

Where these bytes come from
Publisher at the pinned commit→You

Sources are tried in order. A file counts only when its size and sha256 match the manifest. Sources are checked when you ask for them, not on a timer.

Sources
BadgeHostLast checkResult
From sourcehuggingface.co2026-11-15 05:18 UTCpassed

Model card

From the publisher at commit 745a97a. Shown as plain text with links; images open at the publisher.

Gemma 4 26B A4B it — QAT-aligned 4-bit for MLX#

TL;DR: This is not a regular mlx_lm convert -q quantization. It is a QAT-lattice-aligned 4-bit conversion of google/gemma-4-26B-A4B-it-qat-q4_0-unquantized that recovers Google's original QAT scales from the weights instead of re-deriving them from min/max statistics. Standard MLX affine layout (group_size=32, 4-bit), loadable by stock mlx-lm — no patches needed. 52 GB → 15 GB (~5.0 bits/weight). Text-only (the vision tower is not included).

Why a special conversion?#

The qat-q4_0-unquantized checkpoints store weights already snapped to a symmetric int4 lattice (codes ∈ [-8, 7], one scale per 32 input-dim elements). For the MoE experts, dense MLPs, and the router, those scales are learned during QAT and cannot be recovered from weight min/max statistics: only 26–38% of blocks touch an extreme code. Any quantizer that re-derives scales — llama.cpp's naive Q4_0 (d = extreme/-8) and MLX's default affine mode (scale = (max-min)/15, group_size 64) — re-snaps ~60–74% of MoE/MLP blocks onto a misaligned grid. (This is the same effect Unsloth documented for llama.cpp in their Gemma 4 QAT analysis.)

This conversion instead recovers the grid step of every 32-block directly from the snapped weights (k-sweep over absmax/k + least-squares refinement) and emits it as standard MLX affine parameters (scale = s, bias = -8·s). The MoE router (router.proj) is kept in bf16 (~20 MB): top-8-of-128 expert selection is the most perturbation-sensitive spot, and llama.cpp MoE GGUFs never quantize ffn_gate_inp either.

Fidelity vs. the bf16 QAT reference (26B A4B)#

Weight space, relative RMSE to the original checkpoint:

default mlx_lm convert -q (affine, gs=64)this conversion
relRMSE7.0–8.6%0.18–0.23% (bf16 storage noise floor)

Teacher-forced logits, 1600-token mixed EN/zh/code text, KL(bf16 ‖ quantized):

variantmean KLtop-1 agreement
default mlx_lm convert -q (gs=64)0.27782.7%
MLX affine gs=320.35380.1%
this conversion0.09090.3%
control: bf16 + matched random noise σ=0.185% (no quantization)0.15187.7%

The noise control shows this conversion sits at the intrinsic sensitivity floor of this 128-expert sparse-MoE architecture: the residual KL is fully explained by ±1-ulp bf16 rounding noise amplified by discrete routing flips, not by quantization error. (For reference, Unsloth's UD-Q4_K_XL GGUF reports mean KLD 0.098 / top-1 85.6% on 26B on their own eval set.)

Use#

pip install mlx-lm
from mlx_lm import load, generate

model, tokenizer = load("mlx-community/gemma-4-26B-A4B-it-qat-q4_0-mlx-aligned")
prompt = tokenizer.apply_chat_template(
    [{"role": "user", "content": "Explain quantization-aware training in two sentences."}],
    add_generation_prompt=True,
)
print(generate(model, tokenizer, prompt=prompt, max_tokens=256))

Reproduce#

The conversion scripts are included in this repo under conversion/:

  • qat_q4_recover.py — lattice-scale recovery quantizer (recover_grid_step: per-32-block k-sweep with residual tolerance 0.075 to absorb bf16 rounding of code × scale products, then least-squares refit)
  • convert_aligned.py — end-to-end converter producing this repo's format (run against the qat-q4_0-unquantized checkpoint; --quantize-router to also quantize the router)

Notes & limitations#

  • Text-only. The mlx-lm Gemma 4 implementation drops the vision tower (which Google did not QAT-quantize anyway).
  • ~5.0 bits/weight vs. 4.5 for GGUF Q4_0: MLX's affine format stores a bias per group that is always -8·scale here. Redundant but required by the current kernels.
  • Byte-exact recovery of the bf16 checkpoint is not possible with bf16 scales (Google's original QAT scales are fp32); this conversion reaches ~90% byte-exactness with the remainder at ±1 ulp — at, not above, the bf16 noise floor that the KL control quantifies.

License & attribution#

Gemma is provided under and subject to the terms at https://ai.google.dev/gemma/docs/gemma_4_license (Apache 2.0 for Gemma 4). This is a quantized derivative of Google DeepMind's gemma-4-26B-A4B-it-qat-q4_0-unquantized; all credit for the model and the QAT pipeline goes to Google. Conversion performed with mlx-lm plus the included scale-recovery quantizer.

Files

13 files · 15.8 GBWeights 15.8 GB (safetensors). Sizes and sha256 from the signed manifest.
Hide all 13 files with their sha256
FileSizesha256
.gitattributes1.57 KB34448b82c17d60fec9b65b1f093c115ddbaadc04beb1b0140b6bfed2e012a930
README.md4.91 KB64046e1014ec7b18f5d8647b886616f2151ee9ceec07c67eb2d3c43f4c66d0ca
chat_template.jinja16.9 KB94899c0f917d93f6fe81c95744d1e8ddab2d21d39228d2e4aec1fb2a25bff413
config.json3.35 KBd563ee897015b7826949f5b9c545494ba6098ef210efdbbf0c65e03f4fa5c776
conversion/convert_aligned.py1.87 KB6a5cb3c33c795d79cb59f2d5cf66a36ae3fa42ace454491cbb35577f54f01731
conversion/qat_q4_recover.py6.97 KB8eb1a68534cd989aa677ec35bbc898435579dc80dfc93c7c535e43bc7ad7c42c
generation_config.json203 Bb69207f9be617e982d13cc273cce6fd88c98dda99a4bdc5e2d52ffe0a0d9f0a9
model-00001-of-00003.safetensors5.25 GB31e30b06ceb40a8ca1b278a46c91c4e1b9051c04cc959441acd0b5e2c6c61883
model-00002-of-00003.safetensors5.27 GB170e643feedf092d46b24a8931b903ad2a79f594594946a0d1a9f1cc07aac004
model-00003-of-00003.safetensors5.27 GBaa9ee08066a28f7432240fd205134f6f910bdb5c1e620e6dee7a9b0195d013b2
model.safetensors.index.json133 KB7dbbeef0345505798abcf0ac54434116a48c2f1e7aad828071c17a7a871adfe7
tokenizer.json32.2 MBcc8d3a0ce36466ccc1278bf987df5f71db1719b9ca6b4118264f45cb627bfe0f
tokenizer_config.json2.77 KB8155d42e19a25623e76fc0460ce24ddfd34a7c85b496456684249c68e5f93fc5
VersionsEach time the pinned upstream commit or file list changed in this repo. Newest first.
Upstream commitDateContents
745a97a754 pinned now2026-11-15 05:18 UTC13 files · 15.8 GB

Use it

$ fw get mlx-community/gemma-4-26B-A4B-it-qat-q4_0-mlx-aligned
# manifest sha256 8d8d139adc7d… · 15.8 GB · 13 files
$ fw verify ./gemma-4-26B-A4B-it-qat-q4_0-mlx-aligned mlx-community/gemma-4-26B-A4B-it-qat-q4_0-mlx-aligned
fw.pyChecks the signature and every sha256, tries each source in order, resumes.
$ python3 fw.py get https://freeweights.allternit.com/manifests/mlx-community/gemma-4-26B-A4B-it-qat-q4_0-mlx-aligned.json --dir ./gemma-4-26B-A4B-it-qat-q4_0-mlx-aligned $ python3 fw.py verify ./gemma-4-26B-A4B-it-qat-q4_0-mlx-aligned ./mlx-community__gemma-4-26B-A4B-it-qat-q4_0-mlx-aligned.json
hfThe Hugging Face CLI with one setting. Same repo id.
$ HF_ENDPOINT=https://freeweights.allternit.com hf download mlx-community/gemma-4-26B-A4B-it-qat-q4_0-mlx-aligned --revision 745a97a754ed4b7713163c7d0e9c11da41809e0c --local-dir ./gemma-4-26B-A4B-it-qat-q4_0-mlx-aligned
transformersLoad the weights in Python.
import os os.environ["HF_ENDPOINT"] = "https://freeweights.allternit.com" from transformers import AutoModelForCausalLM, AutoTokenizer tok = AutoTokenizer.from_pretrained("mlx-community/gemma-4-26B-A4B-it-qat-q4_0-mlx-aligned", revision="745a97a754ed4b7713163c7d0e9c11da41809e0c") model = AutoModelForCausalLM.from_pretrained("mlx-community/gemma-4-26B-A4B-it-qat-q4_0-mlx-aligned", revision="745a97a754ed4b7713163c7d0e9c11da41809e0c", device_map="auto")
vLLMServe an OpenAI-compatible API.
$ HF_ENDPOINT=https://freeweights.allternit.com vllm serve mlx-community/gemma-4-26B-A4B-it-qat-q4_0-mlx-aligned --revision 745a97a754ed4b7713163c7d0e9c11da41809e0c

License

Name
Apache License 2.0
Id
Apache-2.0
Class
Permissive
Redistribution
yes
Listing
Hosted (signed)
Decided
License as declared by the publisher. No person read it. 2026-11-15
Text in
README.md
Text sha256
64046e1014ec7b18f5d8647b886616f2151ee9ceec07c67eb2d3c43f4c66d0ca
Terms gate
No extra terms beyond the license.

Read the license text

Licenses are checked against the license table. A custom license passes only after a person reads it.

Provenance

From: mlx-community <huggingface.co/mlx-community>Newsgroups: alt.freeweights.gemmaSubject: gemma-4-26B-A4B-it-qat-q4_0-mlx-alignedDate: 2026-11-15Commit: 745a97aSigned: 2DC28CC7B26A283B ✓
Upstream
mlx-community/gemma-4-26B-A4B-it-qat-q4_0-mlx-aligned
Pinned commit
745a97a754ed4b7713163c7d0e9c11da41809e0c
Manifest
gemma-4-26B-A4B-it-qat-q4_0-mlx-aligned.json · .minisig
Manifest sha256
8d8d139adc7dbf329b7449a9bee1a3120ea33fa44e8c505db0fed67f4f216fde
Signature
minisign, Ed25519, key 2DC28CC7B26A283B
Created
2026-11-15 05:18 UTC
Generator
freeweights-manifest/0.1.0
Takedowns
None.

How to verify

$ curl -O https://freeweights.allternit.com/manifests/mlx-community/gemma-4-26B-A4B-it-qat-q4_0-mlx-aligned.json $ curl -O https://freeweights.allternit.com/manifests/mlx-community/gemma-4-26B-A4B-it-qat-q4_0-mlx-aligned.json.minisig $ minisign -Vm gemma-4-26B-A4B-it-qat-q4_0-mlx-aligned.json -P RWQ7KGqyx4zCLXtUFOqvfv8L3g+8fpKJ1FsuxPyOYMF+4KufbUxKq1Oq $ shasum -a 256 <file> # compare with the Files tab

A manifest whose signature fails must be rejected. A file whose size or sha256 does not match must be discarded. Verify a download

Model tree

Parent

google/gemma-4-26B-A4B-it-qat-q4_0-unquantized · this model is a quantization of it

No model in the catalog names this one as its parent.

Get it
Download
$ HF_ENDPOINT=https://freeweights.allternit.com hf download mlx-community/gemma-4-26B-A4B-it-qat-q4_0-mlx-aligned
Open in Freeweights Studio

Pull, verify and run it in the Allternit app on Desktop, web or phone.

Signed manifest
minisign, key 2DC28CC7B26A283B. gemma-4-26B-A4B-it-qat-q4_0-mlx-aligned.json. Provenance. Takedown history: none.
From: laion <huggingface.co/laion>Subject: Alexandria-Gemma-4-12B-it-Ornith9-Summaries-LoRA-r128
From: laion <huggingface.co/laion>Subject: Alexandria-Gemma-4-12B-it-Ornith9-Summaries-LoRA-r64
From: laion <huggingface.co/laion>Subject: Alexandria-Gemma-4-12B-it-Qwen27-Knowledge-Units-LoRA-r128
From: laion <huggingface.co/laion>Subject: Alexandria-Gemma-4-12B-it-Qwen27-Summaries-LoRA-r128
From: laion <huggingface.co/laion>Subject: Alexandria-Gemma-4-12B-it-Qwen27-Summaries-LoRA-r64
From: laion <huggingface.co/laion>Subject: Alexandria-Gemma-4-E4B-it-Qwen27-Knowledge-Units-LoRA-r128