CoolFace
Modelpublic

WhiskyAKM/Gemma-4-E4B-it-qat-GGUF

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes774downloads
Model Card

Gemma 4 E4B IT QAT — GGUF

GGUF quantizations of google/gemma-4-E4B-it-qat-q4_0-unquantized, created from the Quantization-Aware Training (QAT) checkpoint of Gemma 4 E4B IT.

Model Overview

Gemma 4 E4B IT is a multimodal model built by Google DeepMind that handles text, image, and audio inputs and generates text output. It is designed for efficient on-device deployment on laptops and mobile devices.

The "E" in E4B stands for "effective" parameters — the model uses Per-Layer Embeddings (PLE) to maximize parameter efficiency, giving each decoder layer its own small embedding for every token. This keeps the effective parameter count much smaller than the total.

This repository contains GGUF conversions of the QAT-optimized checkpoint, making it usable with llama.cpp and other GGUF-compatible inference engines.

Model Architecture

PropertyValue
ArchitectureGemma4ForConditionalGeneration
Effective Parameters4.3B (7.5B with embeddings)
Layers42
Embedding Length2560
Sliding Window512 tokens
Context Length128K tokens
Vocabulary Size262K
Supported ModalitiesText, Image, Audio
Vision EncoderSigLIP-based, 16 layers, 768-dim, ~478M params
Audio Encoder12 layers, 1024-dim
AttentionHybrid (sliding window + global, every 6th layer)
RoPEProportional RoPE (p-RoPE) on global layers

GGUF Files

FileFormatSizeDescription
gemma-4-E4B-it-qat-Q4_0.ggufQ4_05.2GQAT Q4_0 — native QAT quantization
gemma-4-E4B-it-qat-Q4_K_M.ggufQ4KM5.3GK-quant, medium
gemma-4-E4B-it-qat-Q4_K_S.ggufQ4KS5.2GK-quant, small
gemma-4-E4B-it-qat-Q5_K_M.ggufQ5KM5.7GK-quant, medium
gemma-4-E4B-it-qat-Q5_K_S.ggufQ5KS5.6GK-quant, small
gemma-4-E4B-it-qat-Q6_K.ggufQ6_K6.2GK-quant, higher precision
gemma-4-E4B-it-qat-Q8_0.ggufQ8_08.0G8-bit, highest GGUF precision
gemma-4-E4B-it-qat-bf16.ggufbf1614.9GFull bfloat16 (unquantized)
mmproj.gguff32992MMultimodal projector (vision + audio)

A chat_template.jinja file is also provided for use with chat-based inference.

Note on QAT: The Q40 file is the native QAT quantization. The K-quant and Q80 variants are additional GGUF quantizations produced from the QAT checkpoint. The QAT optimization preserves quality close to bfloat16 while dramatically reducing memory requirements.
Note on `mmproj.gguf`: This file contains the vision and audio encoders/projection layers required for multimodal inference. It is not needed for text-only use.

Usage

llama.cpp (CLI)

bash
# Run text inference
./llama-cli \
  -m gemma-4-E4B-it-qat-Q4_0.gguf \
  -p "Explain quantum computing in simple terms." \
  --temp 1.0 --top-k 64 --top-p 0.95

llama-server (OpenAI-compatible API)

bash
# Text-only
./llama-server \
  -m gemma-4-E4B-it-qat-Q4_0.gguf \
  --host 0.0.0.0 --port 8080

# With multimodal (image + audio) support
./llama-server \
  -m gemma-4-E4B-it-qat-Q4_0.gguf \
  --mmproj mmproj.gguf \
  --host 0.0.0.0 --port 8080

Multimodal (Image / Audio)

For image and audio inputs, pass the --mmproj mmproj.gguf flag to load the multimodal projector. Refer to your inference engine's documentation for passing image/audio data alongside text prompts.

Modality order tip: For best results, place image content before text and audio content after text in your prompt.

Generation Parameters

Recommended parameters from the model's generation_config.json:

ParameterValue
Temperature1.0
Top-K64
Top-P0.95
BOS Token ID2
EOS Token IDs1, 106, 50
Pad Token ID0

Thinking Mode

Gemma 4 supports configurable thinking (reasoning) mode:

  • —Enable: Include the <|think|> token at the start of the system prompt.
  • —Output format: When thinking is enabled, the model outputs internal reasoning followed by the final answer:
  <|channel>thought
  [Internal reasoning]
  <channel|>
  [Final answer]
  • —Disable: Omit the <|think|> token. For the E4B variant, thinking is fully off when disabled (no empty thought block is generated).
Many libraries like Transformers and llama.cpp handle the chat template complexities automatically.

Key Features

  • —Multimodal: Text, image, and audio understanding
  • —Long Context: 128K token context window
  • —Function Calling: Native support for structured tool use (agentic workflows)
  • —Multilingual: Support for 140+ languages
  • —On-Device Optimized: Designed for efficient local execution on laptops and mobile devices
  • —Native System Prompt: Supports the system role for structured conversations

Acknowledgements

Citation

bibtex
@misc{gemmateam2026gemma4,
      title={Gemma 4 Technical Report},
      author={Gemma Team},
      year={2026},
      eprint={2607.02770},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2607.02770},
}

License

Apache License 2.0