mlx-community/gemma-4-e4b-it-qat-OptiQ-4bit
mlx-community/gemma-4-e4b-it-qat-OptiQ-4bit
Built with [mlx-optiq](https://mlx-optiq.com), 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 +1.19 Capability Score points.
This is a quant of google/gemma-4-E4B-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.
Quantization details
Capability Score
Six-metric mean (MMLU, GSM8K, IFEval, BFCL, HumanEval, HashHop), scored against the published uniform 4-bit quant of the same QAT base (`mlx-community/gemma-4-E4B-it-qat-4bit`). That comparison isolates what the mixed-precision allocation adds, holding the base fixed.
The mixed-precision allocation adds +1.19 points over uniform 4-bit on the QAT base, with the largest gains on HumanEval and the long-context HashHop task. The mixed quant is 5.17 bits-per-weight (about 7.0 GB on disk) versus 4.0 bits-per-weight (about 6.3 GB) for uniform 4-bit: the gain comes from spending the extra budget on the layers that need it.
Usage
mlx-lm loads it directly for text:
from mlx_lm import load, generate
model, tokenizer = load("mlx-community/gemma-4-e4b-it-qat-OptiQ-4bit")
print(generate(model, tokenizer, "Explain mixed-precision quantization.", max_tokens=256))Image+text input and the speculative drafter run through mlx-optiq:
pip install mlx-optiq
optiq serve --model mlx-community/gemma-4-e4b-it-qat-OptiQ-4bit \
--drafter google/gemma-4-E4B-it-qat-q4_0-unquantized-assistantThe 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.
Quantize your own
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-tuneLicense
Gemma Terms of Use. Built on google/gemma-4-E4B-it-qat-q4_0-unquantized.
