Instructions to use CalmState/gemma-3-4b-polyglot-r1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use CalmState/gemma-3-4b-polyglot-r1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="CalmState/gemma-3-4b-polyglot-r1") 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, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("CalmState/gemma-3-4b-polyglot-r1") model = AutoModelForImageTextToText.from_pretrained("CalmState/gemma-3-4b-polyglot-r1") 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
- vLLM
How to use CalmState/gemma-3-4b-polyglot-r1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "CalmState/gemma-3-4b-polyglot-r1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "CalmState/gemma-3-4b-polyglot-r1", "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/CalmState/gemma-3-4b-polyglot-r1
- SGLang
How to use CalmState/gemma-3-4b-polyglot-r1 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 "CalmState/gemma-3-4b-polyglot-r1" \ --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": "CalmState/gemma-3-4b-polyglot-r1", "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 "CalmState/gemma-3-4b-polyglot-r1" \ --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": "CalmState/gemma-3-4b-polyglot-r1", "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 Studio new
How to use CalmState/gemma-3-4b-polyglot-r1 with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for CalmState/gemma-3-4b-polyglot-r1 to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for CalmState/gemma-3-4b-polyglot-r1 to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for CalmState/gemma-3-4b-polyglot-r1 to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="CalmState/gemma-3-4b-polyglot-r1", max_seq_length=2048, ) - Docker Model Runner
How to use CalmState/gemma-3-4b-polyglot-r1 with Docker Model Runner:
docker model run hf.co/CalmState/gemma-3-4b-polyglot-r1
Polyglot Air - Specialized Gemma 3 Fine-Tune
This model is a specialized fine-tune of Google's Gemma 3 4B, optimized specifically for the Polyglot Air desktop application workflow.
It has been trained to strictly adhere to suffix-based commands, ensuring instant, clean, and direct responses without conversational filler, hallucinations, or "Here is the translation" preambles.
🎯 Purpose
The default chat models often struggle with context switching when presented with short strings followed by a command (e.g., text::en). They might explain the translation or chat with the user.
This model is fine-tuned to treat the ::suffix as a strict instruction code.
- Input:
O arquivo não pode ser salvo porque o disco está cheio::en - Output:
The file cannot be saved because the disk is full
⚡ Suffix Command Table
Use these suffixes at the end of your selected text to trigger specific transformations.
| Suffix | Action | Example Input | Model Output |
|---|---|---|---|
::en |
Translate to English | Bom dia::en |
Good morning |
::pt |
Translate to Portuguese (Portugal) | Good morning::pt |
Bom dia |
::ptbr |
Translate to Portuguese (Brazil) | The bus is coming::ptbr |
O ônibus está vindo |
::es |
Translate to Spanish | Hello friend::es |
Hola amigo |
::zh |
Translate to Chinese | Hello::zh |
你好 |
::fix |
Fix grammar & spelling | i goes to skool yesterday::fix |
I went to school yesterday |
::formal |
Rewrite in a professional tone | Hey, send me that file asap::formal |
Could you please send me that file as soon as possible? |
::casual |
Rewrite in a casual/friendly tone | I acknowledge receipt of your message::casual |
Got your message, thanks! |
::summary |
Summarize the text | [Long Text]::summary |
[Concise Summary] |
🚀 How to use with Polyglot Air
- Download this model (or the GGUF version if available).
- Add it to your Ollama library.
- Open Polyglot Air.
- Go to Settings > Model and select this model.
- Enjoy seamless, instruction-following translations.
Uploaded finetuned model
- Developed by: CalmState
- License: apache-2.0
- Finetuned from model : unsloth/gemma-3-4b-it-unsloth-bnb-4bit
This gemma3 model was trained 2x faster with Unsloth and Huggingface's TRL library.
- Downloads last month
- 5
Model tree for CalmState/gemma-3-4b-polyglot-r1
Base model
google/gemma-3-4b-pt