Instructions to use google/gemma-4-26B-A4B-it-qat-q4_0-unquantized with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use google/gemma-4-26B-A4B-it-qat-q4_0-unquantized with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="google/gemma-4-26B-A4B-it-qat-q4_0-unquantized") 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("google/gemma-4-26B-A4B-it-qat-q4_0-unquantized") model = AutoModelForMultimodalLM.from_pretrained("google/gemma-4-26B-A4B-it-qat-q4_0-unquantized", 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]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use google/gemma-4-26B-A4B-it-qat-q4_0-unquantized with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "google/gemma-4-26B-A4B-it-qat-q4_0-unquantized" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "google/gemma-4-26B-A4B-it-qat-q4_0-unquantized", "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/google/gemma-4-26B-A4B-it-qat-q4_0-unquantized
- SGLang
How to use google/gemma-4-26B-A4B-it-qat-q4_0-unquantized 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 "google/gemma-4-26B-A4B-it-qat-q4_0-unquantized" \ --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": "google/gemma-4-26B-A4B-it-qat-q4_0-unquantized", "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 "google/gemma-4-26B-A4B-it-qat-q4_0-unquantized" \ --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": "google/gemma-4-26B-A4B-it-qat-q4_0-unquantized", "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 google/gemma-4-26B-A4B-it-qat-q4_0-unquantized with Docker Model Runner:
docker model run hf.co/google/gemma-4-26B-A4B-it-qat-q4_0-unquantized
Update README
Browse filesPart of a larger effort to standardize the model cards across Gemma 4 checkpoints (like adding 12B).
README.md
CHANGED
|
@@ -29,6 +29,7 @@ base_model:
|
|
| 29 |
> * **GGUF** (Q4_0): Ready-to-deploy formats for broad ecosystem compatibility. Available for Gemma 4 E2B, E4B, 12B, 26B A4B, and 31B.
|
| 30 |
> * **Mobile-optimized** (wNa8o8): A custom schema engineered explicitly for mobile hardware efficiency. It features targeted 2-bit decoding layers, optimized KV caches, and static activations to maximize VRAM savings. Available for Gemma 4 E2B and E4B.
|
| 31 |
> * **Compressed Tensors** (w4a16): QAT checkpoints serialized in the compressed-tensors format for native, optimized inference with vLLM. Available for Gemma 4 E2B, E4B, 12B, and 31B.
|
|
|
|
| 32 |
|
| 33 |
Gemma is a family of open models built by Google DeepMind. Gemma 4 models are multimodal, handling text and image input (with audio supported on E2B, E4B, and 12B) and generating text output. This release includes open-weights models in both pre-trained and instruction-tuned variants. Gemma 4 features a context window of up to 256K tokens and maintains multilingual support in over 140 languages.
|
| 34 |
|
|
@@ -144,7 +145,7 @@ Once you have everything installed, you can proceed to load the model with the c
|
|
| 144 |
```python
|
| 145 |
from transformers import AutoProcessor, AutoModelForMultimodalLM
|
| 146 |
|
| 147 |
-
MODEL_ID = "google/gemma-4-
|
| 148 |
|
| 149 |
# Load model
|
| 150 |
processor = AutoProcessor.from_pretrained(MODEL_ID)
|
|
@@ -199,7 +200,7 @@ You can then load the model with the code below:
|
|
| 199 |
```python
|
| 200 |
from transformers import AutoProcessor, AutoModelForMultimodalLM
|
| 201 |
|
| 202 |
-
MODEL_ID = "google/gemma-4-
|
| 203 |
|
| 204 |
# Load model
|
| 205 |
processor = AutoProcessor.from_pretrained(MODEL_ID)
|
|
@@ -258,7 +259,7 @@ You can then load the model with the code below:
|
|
| 258 |
```python
|
| 259 |
from transformers import AutoProcessor, AutoModelForMultimodalLM
|
| 260 |
|
| 261 |
-
MODEL_ID = "google/gemma-4-
|
| 262 |
|
| 263 |
# Load model
|
| 264 |
processor = AutoProcessor.from_pretrained(MODEL_ID)
|
|
@@ -316,7 +317,7 @@ You can then load the model with the code below:
|
|
| 316 |
```python
|
| 317 |
from transformers import AutoProcessor, AutoModelForMultimodalLM
|
| 318 |
|
| 319 |
-
MODEL_ID = "google/gemma-4-
|
| 320 |
|
| 321 |
# Load model
|
| 322 |
processor = AutoProcessor.from_pretrained(MODEL_ID)
|
|
@@ -391,7 +392,7 @@ Compared to Gemma 3, the models use standard `system`, `assistant`, and `user` r
|
|
| 391 |
|
| 392 |
### 3. Multi-Turn Conversations
|
| 393 |
|
| 394 |
-
* **No Thinking Content in History**: In multi-turn conversations, the historical model output should only include the final response. Thoughts from previous model turns must *not be added* before the next user turn begins.
|
| 395 |
|
| 396 |
### 4. Modality order
|
| 397 |
|
|
|
|
| 29 |
> * **GGUF** (Q4_0): Ready-to-deploy formats for broad ecosystem compatibility. Available for Gemma 4 E2B, E4B, 12B, 26B A4B, and 31B.
|
| 30 |
> * **Mobile-optimized** (wNa8o8): A custom schema engineered explicitly for mobile hardware efficiency. It features targeted 2-bit decoding layers, optimized KV caches, and static activations to maximize VRAM savings. Available for Gemma 4 E2B and E4B.
|
| 31 |
> * **Compressed Tensors** (w4a16): QAT checkpoints serialized in the compressed-tensors format for native, optimized inference with vLLM. Available for Gemma 4 E2B, E4B, 12B, and 31B.
|
| 32 |
+
> * **Assistant Compatibility**: When using multi-token prediction (speculative decoding) with an assistant model alongside a QAT target model, the assistant model must also be a QAT checkpoint with the same precision to ensure compatibility.
|
| 33 |
|
| 34 |
Gemma is a family of open models built by Google DeepMind. Gemma 4 models are multimodal, handling text and image input (with audio supported on E2B, E4B, and 12B) and generating text output. This release includes open-weights models in both pre-trained and instruction-tuned variants. Gemma 4 features a context window of up to 256K tokens and maintains multilingual support in over 140 languages.
|
| 35 |
|
|
|
|
| 145 |
```python
|
| 146 |
from transformers import AutoProcessor, AutoModelForMultimodalLM
|
| 147 |
|
| 148 |
+
MODEL_ID = "google/gemma-4-26B-A4B-it"
|
| 149 |
|
| 150 |
# Load model
|
| 151 |
processor = AutoProcessor.from_pretrained(MODEL_ID)
|
|
|
|
| 200 |
```python
|
| 201 |
from transformers import AutoProcessor, AutoModelForMultimodalLM
|
| 202 |
|
| 203 |
+
MODEL_ID = "google/gemma-4-26B-A4B-it"
|
| 204 |
|
| 205 |
# Load model
|
| 206 |
processor = AutoProcessor.from_pretrained(MODEL_ID)
|
|
|
|
| 259 |
```python
|
| 260 |
from transformers import AutoProcessor, AutoModelForMultimodalLM
|
| 261 |
|
| 262 |
+
MODEL_ID = "google/gemma-4-26B-A4B-it"
|
| 263 |
|
| 264 |
# Load model
|
| 265 |
processor = AutoProcessor.from_pretrained(MODEL_ID)
|
|
|
|
| 317 |
```python
|
| 318 |
from transformers import AutoProcessor, AutoModelForMultimodalLM
|
| 319 |
|
| 320 |
+
MODEL_ID = "google/gemma-4-26B-A4B-it"
|
| 321 |
|
| 322 |
# Load model
|
| 323 |
processor = AutoProcessor.from_pretrained(MODEL_ID)
|
|
|
|
| 392 |
|
| 393 |
### 3. Multi-Turn Conversations
|
| 394 |
|
| 395 |
+
* **No Thinking Content in History**: In multi-turn conversations, the historical model output should only include the final response. Thoughts from previous model turns must *not be added* before the next user turn begins, with the exception of tool call turns where thinking content should be preserved.
|
| 396 |
|
| 397 |
### 4. Modality order
|
| 398 |
|