Image-Text-to-Text
Transformers
Safetensors
English
gemma3
unsloth
gemma
google
conversational
text-generation-inference
4-bit precision
bitsandbytes
Instructions to use unsloth/gemma-3-12b-it-unsloth-bnb-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use unsloth/gemma-3-12b-it-unsloth-bnb-4bit with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="unsloth/gemma-3-12b-it-unsloth-bnb-4bit") 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("unsloth/gemma-3-12b-it-unsloth-bnb-4bit") model = AutoModelForMultimodalLM.from_pretrained("unsloth/gemma-3-12b-it-unsloth-bnb-4bit", 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 unsloth/gemma-3-12b-it-unsloth-bnb-4bit with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "unsloth/gemma-3-12b-it-unsloth-bnb-4bit" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "unsloth/gemma-3-12b-it-unsloth-bnb-4bit", "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/unsloth/gemma-3-12b-it-unsloth-bnb-4bit
- SGLang
How to use unsloth/gemma-3-12b-it-unsloth-bnb-4bit 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 "unsloth/gemma-3-12b-it-unsloth-bnb-4bit" \ --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": "unsloth/gemma-3-12b-it-unsloth-bnb-4bit", "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 "unsloth/gemma-3-12b-it-unsloth-bnb-4bit" \ --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": "unsloth/gemma-3-12b-it-unsloth-bnb-4bit", "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" } } ] } ] }' - Unsloth Desktop
- Docker Model Runner
How to use unsloth/gemma-3-12b-it-unsloth-bnb-4bit with Docker Model Runner:
docker model run hf.co/unsloth/gemma-3-12b-it-unsloth-bnb-4bit
Update README.md
#2
by AnthropicallyHuggingFaces - opened
README.md
CHANGED
|
@@ -1,15 +1,38 @@
|
|
| 1 |
---
|
| 2 |
-
base_model:
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
language:
|
| 4 |
- en
|
| 5 |
library_name: transformers
|
| 6 |
-
license: gemma
|
| 7 |
tags:
|
| 8 |
- unsloth
|
| 9 |
- transformers
|
| 10 |
- gemma3
|
| 11 |
- gemma
|
| 12 |
- google
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
---
|
| 14 |
<div>
|
| 15 |
<p style="margin-bottom: 0; margin-top: 0;">
|
|
|
|
| 1 |
---
|
| 2 |
+
base_model:
|
| 3 |
+
- google/gemma-3-12b-it
|
| 4 |
+
- transhumanist-already-exists/C2S-Scale-Gemma-2-27B-age-prediction-fullft
|
| 5 |
+
- baidu/ERNIE-4.5-VL-28B-A3B-Thinking
|
| 6 |
+
- baidu/ERNIE-4.5-VL-424B-A47B-Base-PT
|
| 7 |
language:
|
| 8 |
- en
|
| 9 |
library_name: transformers
|
|
|
|
| 10 |
tags:
|
| 11 |
- unsloth
|
| 12 |
- transformers
|
| 13 |
- gemma3
|
| 14 |
- gemma
|
| 15 |
- google
|
| 16 |
+
- agent
|
| 17 |
+
- code
|
| 18 |
+
datasets:
|
| 19 |
+
- malhajar/OpenOrca-tr
|
| 20 |
+
- thomaswmitch/kalshi-prediction-markets-betting
|
| 21 |
+
- nick007x/github-code-2025
|
| 22 |
+
- jason23322/high-accuracy-email-classifier
|
| 23 |
+
- TeichAI/claude-sonnet-4.5-high-reasoning-250x
|
| 24 |
+
- neulab/agent-data-collection
|
| 25 |
+
- builddotai/Egocentric-10K
|
| 26 |
+
- facebook/omnilingual-asr-corpus
|
| 27 |
+
metrics:
|
| 28 |
+
- accuracy
|
| 29 |
+
- super_glue
|
| 30 |
+
- code_eval
|
| 31 |
+
- perplexity
|
| 32 |
+
- SpfIo/wer_checker
|
| 33 |
+
- berkatil/map
|
| 34 |
+
new_version: facebook/MobileLLM-Pro
|
| 35 |
+
pipeline_tag: fill-mask
|
| 36 |
---
|
| 37 |
<div>
|
| 38 |
<p style="margin-bottom: 0; margin-top: 0;">
|