CoolFace
Modelpublic

CraneAILabs/swahili-gemma-1b-GGUF

sourceHugging Facegemmaupdated 1y agoView on Hugging Face
0likes416downloads
Model Card

Swahili Gemma 1B - GGUF

Quantized GGUF versions of Swahili Gemma 1B, a fine-tuned Gemma 3 1B instruction model specialized for English-to-Swahili translation and Swahili conversational AI. The model accepts input in both English and Swahili but outputs responses exclusively in Swahili.

πŸ“Š Translation Performance

[image]

Model Comparison

ModelParametersBLEUchrF++Efficiency*
Gemma 3 4B4B10.944.12.7
Swahili Gemma 1B1B27.656.827.6
Gemma 3 27B27B29.460.01.1
GPT-5 Mini~8B31.862.44.0
Gemini 2.0 FlashLarge35.664.6N/A

*Efficiency = BLEU Score / Parameters (in billions)

Key Performance Insights

🎯 Efficiency Leader: Achieves the highest BLEU-to-parameter ratio (27.6 BLEU per billion parameters) πŸš€ Size Advantage: Outperforms Gemma 3 4B (4x larger) by 153% on BLEU score πŸ’Ž Competitive Quality: Achieves 94% of Gemma 3 27B performance with 27x fewer parameters ⚑ Practical Deployment: Runs efficiently on consumer hardware while maintaining quality

Evaluation Details

  • β€”Dataset: FLORES-200 Englishβ†’Swahili (1,012 translation pairs)
  • β€”Metrics: BLEU (bilingual evaluation understudy) and chrF++ (character F-score)
  • β€”Evaluation: Zero-shot translation performance

πŸš€ Quick Start

bash
# Download the recommended Q4_K_M quantization
pip install huggingface_hub

# Python download
from huggingface_hub import snapshot_download
snapshot_download(
    repo_id="CraneAILabs/swahili-gemma-1b-GGUF",
    local_dir="swahili-gemma-1b-GGUF",
    allow_patterns=["Q4_K_M/*"]  # Download only Q4_K_M version
)

πŸ“Š Available Quantizations

QuantizationFolderFile SizeQualityUse Case
F32F32/~3.8GBHighestResearch & benchmarking
F16F16/~1.9GBHighestMaximum quality inference
Q8_0Q8_0/~1.0GBVery HighProduction with ample resources
Q5_K_MQ5KM/~812MBHighBalanced quality/size
Q4_K_MQ4KM/~769MBGoodRecommended for most users
Q4_K_SQ4KS/~745MBGoodResource-constrained environments
Q3_K_MQ3KM/~689MBFairMobile/edge deployment
Q2_KQ2_K/~658MBLowerMinimal resource usage

πŸ’» Usage with llama.cpp

Basic Translation

bash
# English to Swahili translation
./llama-cli \
  --model swahili-gemma-1b-GGUF/Q4_K_M/swahili-gemma-1b-q4_k_m.gguf \
  --prompt "Translate to Swahili: Hello, how are you today?" \
  --temp 0.3 \
  --top-p 0.95 \
  --top-k 64 \
  --repeat-penalty 1.1 \
  -n 128

πŸ”§ Usage with Ollama

bash
# Create model from GGUF
ollama create swahili-gemma-1b -f Modelfile

# Use for translation
ollama run swahili-gemma-1b "Translate to Swahili: Good morning!"

# Use for conversation  
ollama run swahili-gemma-1b "Hujambo! Je, unaweza kunisaidia?"

Modelfile Example

dockerfile
FROM swahili-gemma-1b-GGUF/Q4_K_M/swahili-gemma-1b-q4_k_m.gguf

TEMPLATE """{{ if .System }}<|start_header_id|>system<|end_header_id|>

{{ .System }}<|eot_id|>{{ end }}{{ if .Prompt }}<|start_header_id|>user<|end_header_id|>

{{ .Prompt }}<|eot_id|>{{ end }}<|start_header_id|>assistant<|end_header_id|>

{{ .Response }}<|eot_id|>"""

PARAMETER stop "<|start_header_id|>"
PARAMETER stop "<|end_header_id|>"
PARAMETER stop "<|eot_id|>"

🐍 Usage with Python (llama-cpp-python)

python
from llama_cpp import Llama

# Initialize model
llm = Llama(
    model_path="swahili-gemma-1b-GGUF/Q4_K_M/swahili-gemma-1b-q4_k_m.gguf",
    n_ctx=2048,
    n_threads=8,
    verbose=False
)

# Generate translation
response = llm(
    "Translate to Swahili: Hello, how are you today?",
    max_tokens=128,
    temperature=0.3,
    top_p=0.95,
    top_k=64,
    repeat_penalty=1.1
)

print(response['choices'][0]['text'])

🌍 Language Capabilities

  • β€”Input Languages: English + Swahili
  • β€”Output Language: Swahili only
  • β€”Primary Focus: English-to-Swahili translation and Swahili conversation

πŸ“Š Performance Metrics

Translation Quality (BLEU Scores)

ModelBLEU ScorechrF++
πŸ₯‡ Swahili Gemma 1B23.6452.26
πŸ₯ˆ ChatGPT-4o-latest[TBD][TBD]
πŸ₯‰ Other Models[TBD][TBD]

Evaluated on 1,012 English-to-Swahili translation samples.

🎯 Capabilities

  • β€”Translation: English-to-Swahili translation
  • β€”Conversational AI: Natural dialogue in Swahili
  • β€”Summarization: Text summarization in Swahili
  • β€”Writing: Creative and informational writing in Swahili
  • β€”Question Answering: General knowledge responses in Swahili

πŸ’‘ Recommended Parameters

bash
# Optimal settings for translation tasks
--temp 0.3
--top-p 0.95
--top-k 64
--repeat-penalty 1.1
--ctx-size 2048

πŸ”— Related Models

πŸ› οΈ Technical Details

  • β€”Base Model: google/gemma-3-1b-it
  • β€”Architecture: Gemma 3
  • β€”Context Length: 4,096 tokens
  • β€”Quantization: GGML format with multiple precision levels
  • β€”Compatible: llama.cpp, Ollama, Jan, LM Studio, and other GGUF engines

🎨 Use Cases

  • β€”Offline Translation: Run Swahili translation without internet
  • β€”Local AI Assistant: Swahili conversational AI on your machine
  • β€”Educational Tools: Language learning applications
  • β€”Content Creation: Generate Swahili content locally
  • β€”Research: Swahili language model experiments

⚠️ Limitations

  • β€”Language Output: Responds only in Swahili
  • β€”Quantization Trade-offs: Lower bit quantizations may reduce quality
  • β€”Context Limit: 4K tokens for optimal performance
  • β€”Specialized Tasks: May need fine-tuning for specific domains

πŸ“„ License

This model is released under the Gemma Terms of Use. Please review the terms before use.

πŸ™ Acknowledgments

  • β€”Google: For the Gemma 3 base model, support and guidance.
  • β€”Community: For Swahili language resources and datasets
  • β€”Gilbert Korir (Msingi AI, Nairobi, Kenya)
  • β€”Alfred Malengo Kondoro (Hanyang University, Seoul, South Korea)

Citation

If you use these GGUF quantizations in your research or applications, please cite:

bibtex
@misc{crane_ai_labs_2025,
    author    = {Bakunga Bronson and Kato Steven Mubiru and Lwanga Caleb and Gimei Alex and Kavuma Lameck and Roland Ganafa and Sibomana Glorry and Atuhaire Collins and JohnRoy Nangeso and Tukamushaba Catherine},
    title     = {Swahili Gemma: A Fine-tuned Gemma 3 1B Model for Swahili conversational AI},
    year      = {2025},
    url       = {https://huggingface.co/CraneAILabs/swahili-gemma-1b},
    organization = {Crane AI Labs}
}

Built with ❀️ by Crane AI Labs

Swahili Gemma - Your helpful Swahili AI companion, optimized for local deployment