Downloads · 30 days
28
7% of all-time downloads
andrzejmontano/gemma-4-12B-it-Mixed-8bit
gemma-4-12B-it-Mixed-8bit is a image-text-to-text model from andrzejmontano. Use it for the image-text-to-text task on the model card, and read the license before you ship it in a product. It is set up for mlx. The card lists the license as apache-2.0.
Mixed-precision 8-bit quantization of Gemma 4 12B IT — Google's unified multimodal model (text + vision + audio + video), optimized for efficient local inference with minimal quality loss.
Downloads · 30 days
28
7% of all-time downloads
All-time downloads
381
Public
Repo size
16 GB
Likes
0
Public
Click a slice to open those files.
.safetensors16 GB · 100%
From the Hugging Face model README
Mixed-precision 8-bit quantization of Gemma 4 12B IT — Google's unified multimodal model (text + vision + audio + video), optimized for efficient local inference with minimal quality loss.
| Metric | Value |
|---|---|
| Base model | google/gemma-4-12b-it |
| Architecture | Gemma4Unified (48-layer dense, hybrid attention) |
| Quantization | MLP-only 8-bit, group-size=64 |
| BF16 size | ~24 GB |
| Mixed 8-bit size | ~15 GB (≈38% reduction) |
| Modalities | Text, Vision, Audio, Video |
| License | Gemma License (inherits from base model) |
This model uses surgical mixed-precision quantization: only the SwiGLU MLP projection matrices (gate_proj, up_proj, down_proj) in the language model are quantized to 8-bit. All other components remain in BF16:
Rationale: MLP layers are "knowledge lookup" / feature transformation layers that are extremely quantization-tolerant. Attention mechanisms carry reasoning and context-window recall. Vision, audio, and multimodal projection layers are kept in BF16 to preserve modality fidelity.
[sliding_attention × 5, full_attention × 1] × 8Gemma4UnifiedProcessor handling text, images, audio, and video<|image|>, <|audio|>, <|video|> with BOI/EOI, BOA/EOA delimitersThis model supports Multi-Token Prediction (MTP) speculative decoding via the companion assistant/drafter model. This model achieves 20-30% faster token generation with gemma-4-12B-it-assistant in BF16 format.
Loads natively with MTP and vision support.
from mlx_vlm.utils import load
model, processor = load("your-username/gemma-4-12B-it-Mixed-8bit", lazy=True)
# Model loads in ~15 GB vs ~24 GB for BF16
| File | Description |
|---|---|
model-00001.safetensors – model-00003.safetensors | Sharded model weights (~5 GB each) |
config.json | Model configuration with quantization metadata |
tokenizer.json / tokenizer_config.json | Tokenizer (262K vocab) |
chat_template.jinja | Chat template with thinking/tool support |
generation_config.json | Generation parameters |
processor_config.json | Unified processor config |
| Parameter | Value |
|---|---|
| Quantization mode | Affine (8-bit) |
| Group size | 64 |
| Layers quantized | 48 (all MLP: gate_proj, up_proj, down_proj) |
| Tensors quantized | ~144 |
| Layers protected | Attention (Q/K/V/O), Vision, Audio, Embeddings, Norms, Scalars |
| Script | quantization_scripts/mixed_quantize_gemma4_12b.py |
# Quantize from the BF16 base model
mlx-env/bin/python quantization_scripts/mixed_quantize_gemma4_12b.py \
--bits 8 --group-size 64
The script:
mlx_vlm.utils.load()class_predicate filter)transformers_version: 5.10.0.dev0 — some fields may not be recognized by stable transformers releases yetThis model inherits the Apache 2.0 license of the base google/gemma-4-12b-it.