LiteRT (formerly TensorFlow Lite) optimized version of Swahili Gemma 1B - a fine-tuned Gemma 3 1B instruction model specialized for English-to-Swahili translation and Swahili conversational AI.
This repository contains MediaPipe task bundles optimized for mobile deployment on Android and iOS devices.
📊 Translation Performance
Translation Performance Comparison
FLORES-200 Evaluation Results
Our Swahili Gemma 1B model demonstrates strong performance in English-to-Swahili translation:
Metric
Score
Ranking
BLEU
27.6
4th out of 5 models
chrF++
56.8
4th out of 5 models
Model Comparison
Model
Parameters
BLEU
chrF++
Efficiency*
Gemma 3 4B
4B
10.9
44.1
2.7
Swahili Gemma 1B
1B
27.6
56.8
27.6
Gemma 3 27B
27B
29.4
60.0
1.1
GPT-5 Mini
~8B
31.8
62.4
4.0
Gemini 2.0 Flash
Large
35.6
64.6
N/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
Metrics: BLEU (bilingual evaluation understudy) and chrF++ (character F-score)
Evaluation: Zero-shot translation performance
Model: swahili-gemma-1b-it-33000 checkpoint
📱 Available Models
File
Size
Quantization
Use Case
swahili-gemma-1b-fp16-instruct.task
~1.0GB
FP16
Recommended - Instruction following format with MediaPipe bundling
swahili-gemma-1b-fp16-raw.tflite
~1.0GB
FP16
Raw TFLite model - requires custom tokenizer integration
🚀 Quick Start
Android (MediaPipe)
kotlin
1import com.google.mediapipe.tasks.genai.llminference.LlmInference
23// Load the model4val options = LlmInference.LlmInferenceOptions.builder()5.setModelPath("/path/to/swahili-gemma-1b-fp16-instruct.task")6.build()78val llmInference = LlmInference.createFromOptions(context, options)910// Generate response11val response = llmInference.generateResponse("Translate to Swahili: Good morning")12println(response)
iOS (MediaPipe)
swift
1importMediaPipeTasksGenAI23// Load the model4let options =LlmInference.Options()5options.modelPath ="/path/to/swahili-gemma-1b-fp16-instruct.task"67let llmInference =tryLlmInference(options: options)89// Generate response10let response =try llmInference.generateResponse(inputText:"Translate to Swahili: Good morning")11print(response)
Web (MediaPipe)
javascript
1import{LlmInference}from'@mediapipe/tasks-genai';23const llm =awaitLlmInference.createFromModelPath(4'/path/to/swahili-gemma-1b-fp16-instruct.task'5);67const response =await llm.generateResponse('Translate to Swahili: Good morning');8console.log(response);
🌍 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)
Model
BLEU Score
chrF++
🥇 Swahili Gemma 1B
23.64
52.26
🥈 ChatGPT-4o-latest
[TBD]
[TBD]
🥉 Other Models
[TBD]
[TBD]
Evaluated on 1,012 English-to-Swahili translation samples.
1// Add to Package.swift2.package(url:"https://github.com/google/mediapipe", from:"0.10.0")
Web
npm install @mediapipe/tasks-genai
📄 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 LiteRT models in your research or mobile applications, please cite:
bibtex
1@misc{crane_ai_labs_2025,
2 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},
3 title = {Swahili Gemma: A Fine-tuned Gemma 3 1B Model for Swahili conversational AI},
4 year = {2025},
5 url = {https://huggingface.co/CraneAILabs/swahili-gemma-1b},
6 organization = {Crane AI Labs}
7}
Built with ❤️ by Crane AI Labs
Swahili Gemma - Your helpful Swahili AI companion, now on mobile!