Built with mlx-optiq, the MLX-native toolkit to quantize, fine-tune, and serve LLMs locally on Apple Silicon, no PyTorch and no cloud. Try the Lab · All OptiQ quants · Docs
A 4-bit mixed-precision MLX quant produced by mlx-optiq, built on Google's quantization-aware-trained (QAT) Gemma-4 base. OptiQ's sensitivity-guided per-layer bit allocation is applied on top of weights that were trained to survive low-bit quantization, and it still beats a uniform 4-bit quant of the same QAT base by +2.09 Capability Score points.
This is a quant of google/gemma-4-E2B-it-qat-q4_0-unquantized. Per-layer bit-widths come from a KL-divergence sensitivity pass on a six-domain calibration mix (prose, reasoning, code, agent, tool-call, constraint-bearing instructions). Sensitive layers go to 8-bit, robust ones stay at 4-bit.
Six-metric mean (MMLU, GSM8K, IFEval, BFCL, HumanEval, HashHop), scored against a uniform 4-bit quant of the same QAT base. That comparison isolates what the mixed-precision allocation adds, holding the base fixed.
Benchmark
This model (OptiQ, QAT base)
Uniform-4 (QAT base)
Delta
MMLU (5-shot, 1000)
48.5%
46.7%
+1.8
GSM8K (1000)
58.6%
56.2%
+2.4
IFEval (full, strict)
66.0%
67.7%
-1.7
BFCL-V3 simple (200)
89.5%
88.5%
+1.0
HumanEval (pass@1, 164)
62.8%
59.8%
+3.0
HashHop (long-context)
18.0%
12.0%
+6.0
Capability Score (mean)
57.23
55.14
+2.09
OptiQ adds +2.09 points over uniform 4-bit on this QAT base, close to the +2.12 it adds on the vanilla gemma-4-e2b-it base, so the per-layer allocation keeps paying off even after QAT has made the weights more quantization-robust. The mixed quant is 5.24 bits-per-weight (about 4.9 GB on disk) versus 4.0 bits-per-weight (about 2.4 GB) for uniform 4-bit: the gain comes from spending the extra budget on the layers that need it.
The same repo loads text-only under stock mlx-lm and image+text under optiq. The bf16 vision tower rides in optiq_vision.safetensors, which mlx-lm ignores (it globs model*.safetensors), so both paths work from one artifact.
This quant was produced by mlx-optiq. Point it at any Hugging Face model to get the same sensitivity-aware mixed precision:
pip install mlx-optiq
optiq convert <hf-model-id> --target-bpw 5.0 --candidate-bits 4,8
optiq lab # or open the full local workbench: chat, compare, quantize, fine-tune
import os
os.environ["HF_ENDPOINT"] = "https://freeweights.allternit.com"
from transformers import AutoModelForCausalLM, AutoTokenizer
tok = AutoTokenizer.from_pretrained("mlx-community/gemma-4-e2b-it-qat-OptiQ-4bit", revision="6bf302fd09388a30f56fa96789166a9349fd0f51")
model = AutoModelForCausalLM.from_pretrained("mlx-community/gemma-4-e2b-it-qat-OptiQ-4bit", revision="6bf302fd09388a30f56fa96789166a9349fd0f51", device_map="auto")