Downloads · 30 days
37
9% of all-time downloads
YoozLabs/gemma-4-E4B-it-qat-lean-4bit-mlx
gemma-4-E4B-it-qat-lean-4bit-mlx is a text generation model from YoozLabs. Use it when you need the model to write or continue text. It is set up for mlx. The card lists the license as apache-2.0.
A lean MLX build of Google's Gemma4 quantization-aware-trained (QAT) checkpoint, converted directly from the QAT bf16 source weights with mlx-lm's own model-default quantization predicate -- not a third-party mixed-pr…
Downloads · 30 days
37
9% of all-time downloads
All-time downloads
426
Public
Parameters
7.5B
4.2 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors4.2 GB · 99%
How the weights are stored.
U327.5B · 100%
From the Hugging Face model README
A lean MLX build of Google's Gemma4 quantization-aware-trained (QAT)
checkpoint, converted directly from the QAT bf16 source weights with
mlx-lm's own model-default quantization predicate -- not a third-party
mixed-precision recipe. The MLP projections that most published MLX Gemma4
QAT builds silently upgrade to 8-bit stay at 4-bit / group-size-64 here (see
Quantization policy below for this model's exact predicate, including
whether it has an MoE router exception). The result is QAT quality at
post-training-quantization (PTQ) size: accuracy calibrated for 4-bit
weights, at the size a plain 4-bit build should actually be.
This is a LEAN build: the point is that the weights are exactly as small as
the declared quantization policy promises, verifiable from config.json
alone (see Validation below).
google/gemma-4-E4B-it-qat-q4_0-unquantized, revision 223168fd2a569bf89aba76a0840b7970fbc9b621mlx-lm 0.31.3 (mlx_lm.convert, programmatic API)scripts/convert_qat_lean.py (infinite repo,
Yooz Labs) -- QUANT_POLICY["e4b"]| Build | Source | bits/weight | Size (GB) |
|---|---|---|---|
| This build | QAT (uniform 4-bit) | 4.50 | 4.20 |
| Community MLX build | QAT (mixed-precision) | - | 7.48 (OptiQ-4bit, 5.17 bpw) |
All sizes are on-disk decimal GB (safetensors shard bytes on disk); bits/weight
is the effective average over all quantized tensors (packed weight bytes plus
scale/bias bytes, divided by total parameter count), computed by
scripts/convert_qat_lean.py verify.

| Metric | Community build | This build |
|---|---|---|
| Peak memory footprint, 8K context (GB) | 8.8 | 6.4 |
| Peak memory footprint, 32K context (GB) | 10.7 | 8.2 |
| Peak RSS, 32K context (GB) | 7.6 | 5.3 |
| Decode speed, 32K context (tokens/s) | 50.7 | 59.8 |
| Prefill speed, 32K context (tokens/s) | 1115 | 1117 |
Community build: mlx-community/gemma-4-e4b-it-qat-OptiQ-4bit. Measured by the benchmark harness during
real retrieval runs (peak of the serving process across all tasks per context
length) on Apple M4 Pro (64 GB unified memory), macOS 26.5, mlx-lm 0.31.3, KV cache f16. Weight quantization
pays off at runtime, not just on disk: every tensor a mixed-precision build
silently upgrades to 8-bit stays resident at 8-bit.

Long-context retrieval A/B against mlx-community/gemma-4-e4b-it-qat-OptiQ-4bit
on the same stack (Apple M4 Pro (64 GB unified memory), macOS 26.5, mlx-lm 0.31.3, KV cache f16): needle-in-a-haystack
(NIAH) and RULER-style tasks scored per-word, MRCR scored by sequence ratio.
| Task | 8K community | 8K this build | 32K community | 32K this build |
|---|---|---|---|---|
| NIAH single | 1.00 | 1.00 | 1.00 | 1.00 |
| NIAH multikey | 1.00 | 1.00 | 1.00 | 1.00 |
| Variable tracking (VT) | 0.35 | 0.35 | 0.25 | 0.25 |
| Frequent words (FWE) | 0.73 | 0.80 | 0.90 | 0.93 |
| MRCR 2-needle | 0.45 | 0.45 | 0.45 | 0.43 |
n=10 per cell. Parity or better on every task at both context lengths: the lean build gives up nothing measurable against the mixed-precision community build.
scripts/convert_qat_lean.py verify --path <this build> --model e4b
confirms the quantization block in config.json carries no per-tensor
overrides beyond uniform 4-bit group-64, zero per-tensor exceptions.
from mlx_lm import load, generate
model, tokenizer = load("YoozLabs/gemma-4-E4B-it-qat-lean-4bit-mlx")
prompt = tokenizer.apply_chat_template(
[{"role": "user", "content": "List the first five prime numbers."}],
add_generation_prompt=True,
)
print(generate(model, tokenizer, prompt=prompt, max_tokens=64, verbose=True))
Maintained by Yooz Labs -- sovereign, on-device AI for macOS. Everything we ship runs locally; nothing goes to a cloud. This build comes out of our long-context research line, where weight footprint is the budget that decides how much context fits on a real machine -- which is why the lean conversion exists.
Questions, issues, or corrections: [email protected]
Apache 2.0, inherited from the source checkpoint google/gemma-4-E4B-it-qat-q4_0-unquantized (Google's
Gemma4 QAT release; license verified apache-2.0 on the google/ repos). This is
an independent, unofficial conversion; it is not distributed, endorsed, or
certified by Google.