Instructions to use google/gemma-4-31B-it-qat-q4_0-unquantized-assistant with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use google/gemma-4-31B-it-qat-q4_0-unquantized-assistant with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="google/gemma-4-31B-it-qat-q4_0-unquantized-assistant") 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 AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("google/gemma-4-31B-it-qat-q4_0-unquantized-assistant") model = AutoModelForCausalLM.from_pretrained("google/gemma-4-31B-it-qat-q4_0-unquantized-assistant", 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 = tokenizer.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(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use google/gemma-4-31B-it-qat-q4_0-unquantized-assistant with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "google/gemma-4-31B-it-qat-q4_0-unquantized-assistant" # 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-31B-it-qat-q4_0-unquantized-assistant", "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-31B-it-qat-q4_0-unquantized-assistant
- SGLang
How to use google/gemma-4-31B-it-qat-q4_0-unquantized-assistant 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-31B-it-qat-q4_0-unquantized-assistant" \ --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-31B-it-qat-q4_0-unquantized-assistant", "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-31B-it-qat-q4_0-unquantized-assistant" \ --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-31B-it-qat-q4_0-unquantized-assistant", "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-31B-it-qat-q4_0-unquantized-assistant with Docker Model Runner:
docker model run hf.co/google/gemma-4-31B-it-qat-q4_0-unquantized-assistant
Add Technical Report
Browse files
README.md
CHANGED
|
@@ -13,10 +13,11 @@ base_model:
|
|
| 13 |
|
| 14 |
|
| 15 |
<p align="center">
|
| 16 |
-
<a href="https://huggingface.co/collections/google/gemma-4" target="_blank">Hugging Face</a> |
|
| 17 |
<a href="https://github.com/google-gemma" target="_blank">GitHub</a> |
|
| 18 |
-
<a href="https://blog.google/innovation-and-ai/technology/developers-tools/
|
| 19 |
-
<a href="https://ai.google.dev/gemma/docs/core" target="_blank">Documentation</a>
|
|
|
|
| 20 |
<br>
|
| 21 |
<b>License</b>: <a href="https://ai.google.dev/gemma/docs/gemma_4_license" target="_blank">Apache 2.0</a> | <b>Authors</b>: <a href="https://deepmind.google/models/gemma/" target="_blank">Google DeepMind</a>
|
| 22 |
</p>
|
|
@@ -529,4 +530,20 @@ The development of vision-language models (VLMs) raises several ethical concerns
|
|
| 529 |
|
| 530 |
### **Benefits**
|
| 531 |
|
| 532 |
-
At the time of release, this family of models provides high-performance open vision-language model implementations designed from the ground up for responsible AI development compared to similarly sized models.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
|
| 14 |
|
| 15 |
<p align="center">
|
| 16 |
+
<a href="https://huggingface.co/collections/google/gemma-4-qat-q4-0" target="_blank">Hugging Face</a> |
|
| 17 |
<a href="https://github.com/google-gemma" target="_blank">GitHub</a> |
|
| 18 |
+
<a href="https://blog.google/innovation-and-ai/technology/developers-tools/quantization-aware-training-gemma-4/" target="_blank">Launch Blog</a> |
|
| 19 |
+
<a href="https://ai.google.dev/gemma/docs/core" target="_blank">Documentation</a> |
|
| 20 |
+
<a href="https://arxiv.org/abs/2607.02770" target="_blank">Technical Report</a>
|
| 21 |
<br>
|
| 22 |
<b>License</b>: <a href="https://ai.google.dev/gemma/docs/gemma_4_license" target="_blank">Apache 2.0</a> | <b>Authors</b>: <a href="https://deepmind.google/models/gemma/" target="_blank">Google DeepMind</a>
|
| 23 |
</p>
|
|
|
|
| 530 |
|
| 531 |
### **Benefits**
|
| 532 |
|
| 533 |
+
At the time of release, this family of models provides high-performance open vision-language model implementations designed from the ground up for responsible AI development compared to similarly sized models.
|
| 534 |
+
|
| 535 |
+
## **Citation**
|
| 536 |
+
|
| 537 |
+
If you find our work helpful, please consider citing it:
|
| 538 |
+
|
| 539 |
+
```bibtex
|
| 540 |
+
@misc{gemmateam2026gemma4,
|
| 541 |
+
title={Gemma 4 Technical Report},
|
| 542 |
+
author={Gemma Team},
|
| 543 |
+
year={2026},
|
| 544 |
+
eprint={2607.02770},
|
| 545 |
+
archivePrefix={arXiv},
|
| 546 |
+
primaryClass={cs.CL},
|
| 547 |
+
url={https://arxiv.org/abs/2607.02770},
|
| 548 |
+
}
|
| 549 |
+
```
|