Instructions to use google/gemma-4-31B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use google/gemma-4-31B 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")# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("google/gemma-4-31B") model = AutoModelForMultimodalLM.from_pretrained("google/gemma-4-31B", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use google/gemma-4-31B 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" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "google/gemma-4-31B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/google/gemma-4-31B
- SGLang
How to use google/gemma-4-31B 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" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "google/gemma-4-31B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "google/gemma-4-31B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use google/gemma-4-31B with Docker Model Runner:
docker model run hf.co/google/gemma-4-31B
Add Technical Report
Browse files
README.md
CHANGED
|
@@ -14,7 +14,8 @@ pipeline_tag: image-text-to-text
|
|
| 14 |
<a href="https://huggingface.co/collections/google/gemma-4" target="_blank">Hugging Face</a> |
|
| 15 |
<a href="https://github.com/google-gemma" target="_blank">GitHub</a> |
|
| 16 |
<a href="https://blog.google/innovation-and-ai/technology/developers-tools/gemma-4/" target="_blank">Launch Blog</a> |
|
| 17 |
-
<a href="https://ai.google.dev/gemma/docs/core" target="_blank">Documentation</a>
|
|
|
|
| 18 |
<br>
|
| 19 |
<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>
|
| 20 |
</p>
|
|
@@ -514,3 +515,19 @@ The development of vision-language models (VLMs) raises several ethical concerns
|
|
| 514 |
### **Benefits**
|
| 515 |
|
| 516 |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
<a href="https://huggingface.co/collections/google/gemma-4" target="_blank">Hugging Face</a> |
|
| 15 |
<a href="https://github.com/google-gemma" target="_blank">GitHub</a> |
|
| 16 |
<a href="https://blog.google/innovation-and-ai/technology/developers-tools/gemma-4/" target="_blank">Launch Blog</a> |
|
| 17 |
+
<a href="https://ai.google.dev/gemma/docs/core" target="_blank">Documentation</a>|
|
| 18 |
+
<a href="https://arxiv.org/abs/2607.02770" target="_blank">Technical Report</a>
|
| 19 |
<br>
|
| 20 |
<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>
|
| 21 |
</p>
|
|
|
|
| 515 |
### **Benefits**
|
| 516 |
|
| 517 |
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.
|
| 518 |
+
|
| 519 |
+
## **Citation**
|
| 520 |
+
|
| 521 |
+
If you find our work helpful, please consider citing it:
|
| 522 |
+
|
| 523 |
+
```bibtex
|
| 524 |
+
@misc{gemmateam2026gemma4,
|
| 525 |
+
title={Gemma 4 Technical Report},
|
| 526 |
+
author={Gemma Team},
|
| 527 |
+
year={2026},
|
| 528 |
+
eprint={2607.02770},
|
| 529 |
+
archivePrefix={arXiv},
|
| 530 |
+
primaryClass={cs.CL},
|
| 531 |
+
url={https://arxiv.org/abs/2607.02770},
|
| 532 |
+
}
|
| 533 |
+
```
|