Updated yesterday
Quantized Gemma 3 1B optimized for edge devices. Fully offline, bilingual (Italian/English), privacy-first.
IMPORTANT: To enable bilingual behavior, you must create a Modelfile with the bilingual SYSTEM prompt.
# Pull Q4_0 (recommended - faster, smaller)
ollama pull antconsales/antonio-gemma3-smart-q4
# Or pull Q4_K_M variant (better quality for long conversations)
ollama pull antconsales/antonio-gemma3-smart-q4:q4_k_m
cat > Modelfile <<'EOF'
FROM antconsales/antonio-gemma3-smart-q4
PARAMETER temperature 0.7
PARAMETER top_p 0.9
PARAMETER num_ctx 1024
PARAMETER num_thread 4
PARAMETER num_batch 32
PARAMETER repeat_penalty 1.05
PARAMETER stop "<end_of_turn>"
PARAMETER stop "</s>"
SYSTEM """You are an offline AI assistant running on a Raspberry Pi. You MUST detect the user's language and respond in the SAME language:
- If the user writes in Italian, respond ONLY in Italian
- If the user writes in English, respond ONLY in English
Sei un assistente AI offline su Raspberry Pi. DEVI rilevare la lingua dell'utente e rispondere nella STESSA lingua:
- Se l'utente scrive in italiano, rispondi SOLO in italiano
- Se l'utente scrive in inglese, rispondi SOLO in inglese
Always match the user's language choice."""
EOF
ollama create gemma3-bilingual -f Modelfile
ollama run gemma3-bilingual
# Test in Italian
>>> ciao! come va?
# Test in English
>>> hello! how are you?
Why this is needed: The base model is instruction-tuned but doesn’t automatically switch languages. The SYSTEM prompt explicitly tells it to match the user’s language.
Model | Speed | Size | Use Case |
---|---|---|---|
Q4_0 ⭐ | 3.67 t/s | 720 MB | Default choice (faster, smaller) |
Q4_K_M | 3.56 t/s | 806 MB | Better coherence in long conversations |
Tested on: Raspberry Pi OS (Debian Bookworm), Ollama runtime
Once you’ve created the model with the Modelfile (see Quick Start above):
ollama run gemma3-bilingual "Ciao! Spiegami cos'è un sensore di prossimità."
ollama run gemma3-bilingual "What is a Raspberry Pi and what can I do with it?"
ollama run gemma3-bilingual "Explain GPIO in English, poi dimmi come usarlo in italiano"
The model automatically detects the language and responds appropriately when using the Modelfile configuration!
For optimal performance, use these parameters in your Modelfile:
FROM antconsales/antonio-gemma3-smart-q4
PARAMETER num_ctx 1024 # Context length (512 for faster response, 1024 for longer conversations)
PARAMETER num_thread 4 # Utilize all 4 cores on Raspberry Pi 4
PARAMETER num_batch 32 # Optimized for throughput on Pi
PARAMETER temperature 0.7 # Balanced creativity vs consistency
PARAMETER top_p 0.9 # Nucleus sampling for diverse responses
PARAMETER repeat_penalty 1.05 # Reduces repetitive outputs
PARAMETER stop "<end_of_turn>"
PARAMETER stop "</s>"
SYSTEM """
You are an offline AI assistant running on a Raspberry Pi. Automatically detect the user's language (Italian or English) and respond in the same language. Be concise, practical, and helpful.
Sei un assistente AI offline che opera su Raspberry Pi. Rileva automaticamente la lingua dell'utente (italiano o inglese) e rispondi nella stessa lingua. Sii conciso, pratico e utile.
"""
For voice assistants or real-time chat, reduce num_ctx
to 512
for faster responses.
Verify downloaded models using SHA256 checksums:
File | SHA256 Checksum |
---|---|
gemma3-1b-q4_0.gguf |
d1d037446a2836db7666aa6ced3ce460b0f7f2ba61c816494a098bb816f2ad55 |
gemma3-1b-q4_k_m.gguf |
c02d2e6f68fd34e9e66dff6a31d3f95fccb6db51f2be0b51f26136a85f7ec1f0 |
# Verify checksum (on Linux/Mac with Ollama)
# Models are stored in ~/.ollama/models/blobs/
sha256sum ~/.ollama/models/blobs/sha256-*
This model is a derivative work of Google’s Gemma 3 1B.
License: Gemma License Please review and comply with the Gemma License Terms before using this model.
Quantization, optimization, and bilingual configuration by Antonio (antconsales).
For licensing questions regarding the base model, refer to Google’s official Gemma documentation.
Built with ❤️ for privacy and edge computing Empowering offline AI, one Raspberry Pi at a time. 🇮🇹