This repository hosts GGUF weights and the associated vision/audio projection matrix for gemma-4-E2B-it-qat-q4_0-heretic, quantized from the source floating-point tensors provided by coder3101/gemma-4-E2B-it-qat-q4_0-unquantized-heretic.
This model was produced using Quantization Aware Training (QAT). Because the network parameters were exposed to 4-bit constraints natively during fine-tuning, standard post-training formats such as Q4_K_M or Q5_K_M are not compatible and would degrade output quality.
This repository instead provides a single Q4_0 build, produced with the llama.cpp --pure flag, which matches the numerical profile the model was trained on.
Gemma 4 E2B is a Google DeepMind model from the Gemma 4 family, a multimodal (text, image, audio) architecture featuring hybrid sliding-window/global attention, configurable thinking mode, native function calling, and system-role support. This is the Quantization-Aware Training (QAT) variant, whose weights were trained to retain near-bfloat16 quality once quantized to 4-bit — unlike a naively post-training-quantized model, QAT checkpoints are specifically calibrated during training for low-bit deployment. The "E" in E2B denotes "effective" parameters: the model uses Per-Layer Embeddings (PLE) so its effective footprint (2.3B) is much smaller than its total parameter count (5.1B with embeddings).
The heretic suffix denotes post-processing via Heretic v1.2.0 with the Arbitrary-Rank Ablation (ARA) method (row-norm preservation) performed by coder3101, which suppresses refusal behavior while preserving the model's reasoning and multimodal capabilities.
| Property | Value |
|---|---|
| Base Architecture | Gemma 4 E2B (hybrid sliding-window/global attention) |
| Developed by | Google DeepMind |
| Effective Parameters | 2.3B (5.1B total with embeddings) |
| Layers | 35 |
| Sliding Window | 512 tokens |
| Primary Use | Multimodal reasoning, on-device/edge deployment |
| Context Window | 131,072 tokens |
| Supported Modalities | Text, Image, Audio |
| Vision/Audio Projector | Integrated (see repository files below) |
| Quantization-Aware Training | Yes (Q4_0-calibrated) |
| Abliteration Tool | Heretic v1.2.0 |
| Abliteration Method | Arbitrary-Rank Ablation (ARA) with row-norm preservation |
| Prompt Format | Gemma chat template (system/user/assistant roles) |
| Property | Value |
|---|---|
| start_layer_index | 6 |
| end_layer_index | 24 |
| preserve_good_behavior_weight | 0.9543 |
| steer_bad_behavior_weight | 0.0001 |
| overcorrect_relative_weight | 1.1938 |
| neighbor_count | 12 |
[!NOTE] The metrics below are self-reported by the original model author (coder3101) and have not been independently reproduced.
| Metric | This model | Original (google/gemma-4-E2B-it-qat-q4_0-unquantized) |
|---|---|---|
| KL divergence | 0.0056 | 0 (by definition) |
| Refusals | 7/100 | 99/100 |
| Property | Value |
|---|---|
| Text Tensors | Q4_0 (--pure, uniform quantization across all tensor types) |
| Vision/Audio Tensors | Q8_0, BF16 |
[!NOTE] Unlike standard Q4_0 builds that mix in higher-precision tensors for embeddings and select layers, this quant was produced with the
--pureflag, forcing all eligible tensors to Q4_0. This most closely mirrors the QAT calibration target and is the recommended pairing for this checkpoint.
Main model weights
| Filename | Quantization | llama.cpp Build | Size | Download |
|---|---|---|---|---|
gemma-4-E2B-it-qat-q4_0-heretic-Q4_0_PURE.gguf |
Q4_0_PURE |
b9851 |
2.46 GB | 📥 Download |
mmproj — vision/audio projector files
| Filename | Quantization | Size | Download |
|---|---|---|---|
mmproj-gemma-4-E2B-it-qat-q4_0-heretic-Q8_0.gguf |
Q8_0 |
532 MB | 📥 Download |
mmproj-gemma-4-E2B-it-qat-q4_0-heretic-BF16.gguf |
BF16 |
941 MB | 📥 Download |
Q4_0_PURE: The only main-weights format provided; required to match the QAT training profile.mmproj files (optional): multimodal vision projectors. Pass one via the --mmproj flag in llama.cpp to enable image input.
BF16 (Recommended): Highest possible image processing accuracy. While older projectors were small, modern vision towers can hover around 1GB. If you are tight on VRAM, it is completely viable to run this on system RAM (CPU) with a minimal performance penalty, saving your precious GPU space for the main model layers.Q8_0: Cuts the projector file size and memory footprint in half (~500MB for larger 1GB files). Use this if you prefer to keep the vision tower hosted entirely on your GPU but need to claw back some VRAM to avoid Out-Of-Memory (OOM) crashes.[!IMPORTANT] The vision projector (
--mmproj) must be supplied at runtime whenever image inputs are used. Omitting it disables multimodal capability entirely.
[!NOTE] Google recommends the following sampling configuration for best results:
temperature=1.0,top_p=0.95,top_k=64.
[!NOTE] Thinking is enabled by including the
<|think|>token at the start of the system prompt; remove it to disable reasoning output. For E2B/E4B, disabling thinking suppresses the thought channel entirely rather than emitting an empty block.
./llama-cli \
-m gemma-4-E2B-it-qat-q4_0-heretic-Q4_0_PURE.gguf \
--mmproj mmproj-gemma-4-E2B-it-qat-q4_0-heretic-BF16.gguf \
-c 8192 \
-ngl 99 \
--temp 1.0 \
--top-p 0.95 \
--top-k 64 \
--image "path/to/image.jpg" \
-p "<start_of_turn>user\nDescribe what you see in this image.<end_of_turn>\n<start_of_turn>model\n"
./llama-server \
--host 0.0.0.0 \
--port 8080 \
-m gemma-4-E2B-it-qat-q4_0-heretic-Q4_0_PURE.gguf \
--mmproj mmproj-gemma-4-E2B-it-qat-q4_0-heretic-BF16.gguf \
-c 16384 \
-ngl 99 \
--flash-attn
<start_of_turn>system
You are a helpful assistant.<end_of_turn>
<start_of_turn>user
Your question, image, or audio payload here.<end_of_turn>
<start_of_turn>model
--pure Q4_0 quantization applies uniform 4-bit precision across all eligible tensors rather than mixing precisions, which most closely matches this checkpoint's QAT calibration target.coder3101/gemma-4-E2B-it-qat-q4_0-unquantized-heretic