Downloads · 30 days
6
16% of all-time downloads
zeromodels/gemma-4-e4b
gemma-4-e4b is a any-to-any model from zeromodels. Use it for the any-to-any task on the model card, and read the license before you ship it in a product. It is set up for zeromodels. The card lists the license as apache-2.0.
See our collection for all Gemma 4 sizes and variants.
Downloads · 30 days
6
16% of all-time downloads
All-time downloads
37
Public
Repo size
15.9 GB
Likes
0
Public
Click a slice to open those files.
.h515.9 GB · 100%
From the Hugging Face model README
See our collection for all Gemma 4 sizes and variants.
Pure-Keras 3 conversion of google/gemma-4-E4B for
zeromodels. One implementation runs unmodified on
TensorFlow / Torch / JAX. This is the 8B variant, served here as
image + audio + text -> text via Gemma4Processor; weights are stored in bfloat16.
For model details, license, and usage terms, see Google's model card.
| Property | E2B | E4B | 12B Unified | 31B Dense |
|---|---|---|---|---|
| Total Parameters | 2.3B effective (5.1B with embeddings) | 4.5B effective (8B with embeddings) | 11.95B | 30.7B |
| Layers | 35 | 42 | 48 | 60 |
| Sliding Window | 512 tokens | 512 tokens | 1024 tokens | 1024 tokens |
| Context Length | 128K tokens | 128K tokens | 256K tokens | 256K tokens |
| Vocabulary Size | 262K | 262K | 262K | 262K |
| Supported Modalities | Text, Image, Audio | Text, Image, Audio | Text, Image, Audio | Text, Image |
| Vision Encoder Parameters | ~150M | ~150M | - | ~550M |
| Audio Encoder Parameters | ~300M | ~300M | - | No Audio |
import os
os.environ["KERAS_BACKEND"] = "torch" # or "jax" / "tensorflow"
from zeromodels.models.gemma4 import Gemma4TextGenerate, Gemma4Tokenizer
model = Gemma4TextGenerate.from_weights("zeromodels/gemma-4-e4b")
tokenizer = Gemma4Tokenizer.from_weights("zeromodels/gemma-4-e4b")
inputs = tokenizer([{"role": "user", "content": "Hello, who are you?"}])
outputs = model.generate(**inputs, max_new_tokens=64)
print(tokenizer.decode(outputs[0]))
import os
os.environ["KERAS_BACKEND"] = "torch" # or "jax" / "tensorflow"
from PIL import Image
from zeromodels.models.gemma4 import Gemma4ConditionalGenerate, Gemma4Processor
model = Gemma4ConditionalGenerate.from_weights("zeromodels/gemma-4-e4b")
processor = Gemma4Processor.from_weights("zeromodels/gemma-4-e4b")
inputs = processor(conversation=[
{"role": "user", "content": [
{"type": "image", "image": Image.open("cat.jpg")},
{"type": "audio", "path": "clip.wav"},
{"type": "text", "text": "Describe the image and what you hear."},
]}
])
outputs = model.generate(**inputs, max_new_tokens=64)
print(processor.decode(outputs[0]))
Load any Gemma 4 variant the same way with from_weights("zeromodels/<variant>"):
| Variant | Hub |
|---|---|
gemma-4-12b | zeromodels/gemma-4-12b |
gemma-4-12b-it | zeromodels/gemma-4-12b-it |
gemma-4-26b-a4b | zeromodels/gemma-4-26b-a4b |
gemma-4-26b-a4b-it | zeromodels/gemma-4-26b-a4b-it |
gemma-4-31b | zeromodels/gemma-4-31b |
gemma-4-31b-it | zeromodels/gemma-4-31b-it |
gemma-4-e2b | zeromodels/gemma-4-e2b |
gemma-4-e2b-it | zeromodels/gemma-4-e2b-it |
gemma-4-e4b | zeromodels/gemma-4-e4b |
gemma-4-e4b-it | zeromodels/gemma-4-e4b-it |
KERAS_BACKEND before importing Keras / zeromodels.load_dtype="float32" for full precision,
or quantization="int8" to shrink further.hf: prefix:
Gemma4ConditionalGenerate.from_weights("hf:google/gemma-4-E4B").A huge thank you to the Google Gemma authors for creating and releasing these models.
License: Apache 2.0.