Gemma 4-E4B-it — Ternary Quantized

Ternary-quantized version of google/gemma-4-E4B-it, produced with ternary-quant.

Gemma 4-E4B is Google's multimodal model that processes both images and text. This ternary-quantized version retains multimodal capabilities while reducing model size through a HuggingFace-native, component-aware PTQ workflow.

Quantization details

Metric Value
Scheme tritplane3 (3-plane progressive ternary)
Components quantized text_backbone, multimodal_connector (342 linear layers)
Vision encoder Kept in FP16 (preserving image understanding quality)
Group size 32
Calibration iterations 10
Stored size 4234 MB (~4.2 GB)
FP16 size ~16 GB
Compression ratio ~3.8x

Usage

from ternary_quant.inference import load_ternary_model

# Load model (auto-detects best device: CUDA > MPS > CPU)
model, processor = load_ternary_model(
    "AsadIsmail/gemma-4-E4B-it-ternary",
    runtime_mode="metal"  # Use "cached" for NVIDIA GPU or CPU
)

# Image understanding
from PIL import Image
image = Image.open("photo.jpg")
inputs = processor(text="Describe this image", images=image, return_tensors="pt")
inputs = {k: v.to(model.device) for k, v in inputs.items()}
outputs = model.generate(**inputs, max_new_tokens=256)
print(processor.decode(outputs[0], skip_special_tokens=True))

Hardware requirements

Runtime Min RAM Speed Notes
metal (Apple Silicon) ~8 GB Good Native Metal kernels
cached (any device) ~12 GB Fastest Dequantizes once at load
triton_memory (NVIDIA) ~6 GB Moderate Packed ternary in VRAM

Reproduce

pip install ternary-quant
ternary-quant quantize-broad google/gemma-4-E4B-it \
    --output ./gemma-4-E4B-it-ternary \
    --components text_backbone multimodal_connector \
    --scheme tritplane3 \
    --dtype float16 \
    --eval

Part of the ternary-models collection

See github.com/Asad-Ismail/ternary-models for the full collection of ternary-quantized multimodal models.

Citation

@software{ternary_quant,
  author = {Ismail, Asad},
  title = {ternary-quant: Post-training ternary quantization for HuggingFace generative models},
  url = {https://github.com/Asad-Ismail/ternary-quant},
  year = {2026}
}
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for AsadIsmail/gemma-4-E4B-it-ternary

Finetuned
(191)
this model

Space using AsadIsmail/gemma-4-E4B-it-ternary 1

Collection including AsadIsmail/gemma-4-E4B-it-ternary