Image-Text-to-Text
Transformers
Safetensors
gemma3
conversational
Eval Results
text-generation-inference
Instructions to use google/gemma-3-27b-it with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use google/gemma-3-27b-it with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="google/gemma-3-27b-it") 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-3-27b-it") model = AutoModelForMultimodalLM.from_pretrained("google/gemma-3-27b-it", 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
- HuggingChat
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use google/gemma-3-27b-it with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "google/gemma-3-27b-it" # 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-3-27b-it", "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-3-27b-it
- SGLang
How to use google/gemma-3-27b-it 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-3-27b-it" \ --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-3-27b-it", "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-3-27b-it" \ --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-3-27b-it", "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-3-27b-it with Docker Model Runner:
docker model run hf.co/google/gemma-3-27b-it
I'm releasing the speech version of Gemma-3!
🚀 1
1
#46 opened over 1 year ago
by
junnei
Regarding the issue of errors in inference when converting to float16.
2
#45 opened over 1 year ago
by
LBJ6666
Please release the weights of Gemini 1.5 Flash
2
#43 opened over 1 year ago
by
ZeroWw
Template error: syntax error: Conversation roles must alternate user/assistant/user/assistant/
2
#42 opened over 1 year ago
by
stcat
Blank String in System Prompt causes Error - chat_prompt needs some fixes!
2
#41 opened over 1 year ago
by
calycekr
Specify maximum context length in config
➕ 1
1
#40 opened over 1 year ago
by
saattrupdan
Tokens generated per second
👍 1
3
#39 opened over 1 year ago
by
rameshch
Image tokenization
5
#38 opened over 1 year ago
by
Marbuel
TPU inference
2
#37 opened over 1 year ago
by
Arpit-Bansal
How to use the tokenizer of gemma-3
1
#36 opened over 1 year ago
by
rishav09
Is there a possiblity for Google to change the license type of Gemma3 or its next release?
🔥 4
3
#33 opened over 1 year ago
by
harisnaeem
/v1/chat/completions endpoint not working
🔥 2
5
#32 opened over 1 year ago
by
PremkumarChandak
please release AWQ version
🔥 3
2
#31 opened over 1 year ago
by
classdemo
evals (PT vs IT)
👍 2
1
#30 opened over 1 year ago
by
erichartford
Provide an access token
2
#29 opened over 1 year ago
by
Tirth09
CUDA error: CUBLAS_STATUS_NOT_SUPPORTED
1
#25 opened over 1 year ago
by
surak
Function calling with Gemma 3
6
#24 opened over 1 year ago
by
jasonisaac
can not run with vllm
7
#23 opened over 1 year ago
by
tankpigg
Simple questions too hard?
👍 2
8
#22 opened over 1 year ago
by
urtuuuu
ImportError: cannot import name 'Gemma3ForConditionalGeneration' from 'transformers'
1
#21 opened over 1 year ago
by
Sashv
awq version
❤️👍 11
3
#20 opened over 1 year ago
by
rastegar
Adds `vocab_size` to config.json
2
#18 opened over 1 year ago
by
clowman
ERROR:Gemma3Config' object has no attribute 'vocab_size'
🔥➕ 15
3
#17 opened over 1 year ago
by
nexyi
Languages list
➕👍 12
5
#16 opened over 1 year ago
by
averoo
problem with Quantization convertion. "SOLVED"
👍 3
4
#15 opened over 1 year ago
by
josef2600
Fail to Load Gemme3 27B
1
#14 opened over 1 year ago
by
crm-ai
License
👍 2
2
#13 opened over 1 year ago
by
mrfakename
Quantization
1
#12 opened over 1 year ago
by
Zelyanoth
Meet this error
👀➕ 7
6
#11 opened over 1 year ago
by
crm-ai
Anybody thinking what I'm thinking?
❤️ 2
2
#10 opened over 1 year ago
by
darkc0de
Benchmarks on model card and report don't add up
4
#9 opened over 1 year ago
by
patrickvonplaten
Tool usage?
👍 18
7
#8 opened over 1 year ago
by
Satya93
ImportError: cannot import name 'Gemma3ForConditionalGeneration' from 'transformers'
5
#7 opened over 1 year ago
by
devops724
Local Installation Video and Testing - Step by Step
1
#5 opened over 1 year ago
by
fahdmirzac