Image-Text-to-Text
Transformers
Safetensors
gemma4
gptq
4-bit precision
vllm
auto-round
conversational
Instructions to use ciocan/gemma-4-E4B-it-W4A16 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ciocan/gemma-4-E4B-it-W4A16 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="ciocan/gemma-4-E4B-it-W4A16") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("ciocan/gemma-4-E4B-it-W4A16") model = AutoModelForMultimodalLM.from_pretrained("ciocan/gemma-4-E4B-it-W4A16", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ciocan/gemma-4-E4B-it-W4A16 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ciocan/gemma-4-E4B-it-W4A16" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ciocan/gemma-4-E4B-it-W4A16", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/ciocan/gemma-4-E4B-it-W4A16
- SGLang
How to use ciocan/gemma-4-E4B-it-W4A16 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "ciocan/gemma-4-E4B-it-W4A16" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ciocan/gemma-4-E4B-it-W4A16", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "ciocan/gemma-4-E4B-it-W4A16" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ciocan/gemma-4-E4B-it-W4A16", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use ciocan/gemma-4-E4B-it-W4A16 with Docker Model Runner:
docker model run hf.co/ciocan/gemma-4-E4B-it-W4A16
Gemma 4 E4B IT — GPTQ 4-bit (auto-round)
GPTQ 4-bit quantization of google/gemma-4-E4B-it.
Fits in 12GB VRAM (RTX 3080 Ti, RTX 4070, etc.) with vLLM.
Model details
| Base model | google/gemma-4-E4B-it |
| Parameters | 8B total, 4B effective (PLE architecture) |
| Modalities | Text, Image, Audio, Video |
| Context | 128K native, 8K recommended for 12GB GPUs |
| License | Apache 2.0 |
Quantization details
| Method | auto-round (RTN mode, GPTQ-compatible output) |
| Bits | 4 |
| Group size | 128 |
| Symmetric | Yes |
| Format | auto_gptq (vLLM-compatible) |
| Quantized layers | Language model only (vision/audio towers kept at full precision) |
| Model loading VRAM | ~9.65 GiB |
Serving with vLLM
vllm serve ./gemma-4-E4B-it-W4A16 \
--quantization gptq \
--max-model-len 8192 \
--enforce-eager \
--enable-auto-tool-choice \
--tool-call-parser gemma4 \
--port 8000
Using the service script
This model is supported as the e4b variant in the service script:
GEMMA_VARIANT=e4b ./service.sh up
GEMMA_VARIANT=e4b ./service.sh test
API usage
from openai import OpenAI
client = OpenAI(base_url="http://localhost:8000/v1", api_key="unused")
response = client.chat.completions.create(
model="gemma-4-E4B-it",
messages=[{"role": "user", "content": "What's the weather in Paris?"}],
tools=[{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get the current weather for a location",
"parameters": {
"type": "object",
"properties": {
"location": {"type": "string"}
},
"required": ["location"],
},
},
}],
tool_choice="auto",
)
Notes
- Vision/audio towers are kept at full precision (BF16) since vLLM's GPTQ loader only supports quantized Linear layers in the language model.
- softcap tensors from transformers 5.x have been removed from the safetensors files for vLLM 0.19.0 compatibility.
- For 12GB GPUs, use
--max-model-len 8192or lower. Reduce to4096if you hit OOM. - AutoAWQ and llm-compressor do not support the Gemma 4 architecture. auto-round RTN mode is the only working quantization path as of April 2026.
- Downloads last month
- 98,586