Gemma 3n
Collection
Google Gemma 3n models, all versions including Dynamic GGUF, 4-bit, 16-bit and formats! • 10 items • Updated • 28
How to use unsloth/gemma-3n-E2B with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("image-text-to-text", model="unsloth/gemma-3n-E2B") # Load model directly
from transformers import AutoProcessor, AutoModelForImageTextToText
processor = AutoProcessor.from_pretrained("unsloth/gemma-3n-E2B")
model = AutoModelForImageTextToText.from_pretrained("unsloth/gemma-3n-E2B")How to use unsloth/gemma-3n-E2B with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "unsloth/gemma-3n-E2B"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "unsloth/gemma-3n-E2B",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/unsloth/gemma-3n-E2B
How to use unsloth/gemma-3n-E2B with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "unsloth/gemma-3n-E2B" \
--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": "unsloth/gemma-3n-E2B",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'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-3n-E2B" \
--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": "unsloth/gemma-3n-E2B",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use unsloth/gemma-3n-E2B with Unsloth Studio:
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 unsloth/gemma-3n-E2B to start chatting
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 unsloth/gemma-3n-E2B to start chatting
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for unsloth/gemma-3n-E2B to start chatting
pip install unsloth
from unsloth import FastModel
model, tokenizer = FastModel.from_pretrained(
model_name="unsloth/gemma-3n-E2B",
max_seq_length=2048,
)How to use unsloth/gemma-3n-E2B with Docker Model Runner:
docker model run hf.co/unsloth/gemma-3n-E2B
Learn how to run & fine-tune Gemma 3n correctly - Read our Guide.
See our collection for all versions of Gemma 3n including GGUF, 4-bit & 16-bit formats.
Unsloth Dynamic 2.0 achieves SOTA accuracy & performance versus other quants.
ollama run hf.co/unsloth/gemma-3n-E4B-it:Q4_K_XL - auto-sets correct chat template and settings<bos><start_of_turn>user\nHello!<end_of_turn>\n<start_of_turn>model\nHey there!<end_of_turn>\n<start_of_turn>user\nWhat is 1+1?<end_of_turn>\n<start_of_turn>model\n
| Unsloth supports | Free Notebooks | Performance | Memory use |
|---|---|---|---|
| Gemma-3n-E4B | ▶️ Start on Colab | 2x faster | 80% less |
| GRPO with Gemma 3 (1B) | ▶️ Start on Colab | 2x faster | 80% less |
| Gemma 3 (4B) | ▶️ Start on Colab | 2x faster | 60% less |
| Qwen3 (14B) | ▶️ Start on Colab | 2x faster | 60% less |
| DeepSeek-R1-0528-Qwen3-8B (14B) | ▶️ Start on Colab | 2x faster | 80% less |
| Llama-3.2 (3B) | ▶️ Start on Colab | 2.4x faster | 58% less |