1# Download the recommended Q4_K_M quantization
2pip install huggingface_hub
3
4# Python download
5from huggingface_hub import snapshot_download
6snapshot_download(
7 repo_id="CraneAILabs/swahili-gemma-1b-GGUF",
8 local_dir="swahili-gemma-1b-GGUF",
9 allow_patterns=["Q4_K_M/*"] # Download only Q4_K_M version
10)
1# English to Swahili translation
2./llama-cli \
3 --model swahili-gemma-1b-GGUF/Q4_K_M/swahili-gemma-1b-q4_k_m.gguf \
4 --prompt "Translate to Swahili: Hello, how are you today?" \
5 --temp 0.3 \
6 --top-p 0.95 \
7 --top-k 64 \
8 --repeat-penalty 1.1 \
9 -n 128
1# Create model from GGUF
2ollama create swahili-gemma-1b -f Modelfile
3
4# Use for translation
5ollama run swahili-gemma-1b "Translate to Swahili: Good morning!"
6
7# Use for conversation
8ollama run swahili-gemma-1b "Hujambo! Je, unaweza kunisaidia?"
1FROM swahili-gemma-1b-GGUF/Q4_K_M/swahili-gemma-1b-q4_k_m.gguf
2
3TEMPLATE """{{ if .System }}<|start_header_id|>system<|end_header_id|>
4
5{{ .System }}<|eot_id|>{{ end }}{{ if .Prompt }}<|start_header_id|>user<|end_header_id|>
6
7{{ .Prompt }}<|eot_id|>{{ end }}<|start_header_id|>assistant<|end_header_id|>
8
9{{ .Response }}<|eot_id|>"""
10
11PARAMETER stop "<|start_header_id|>"
12PARAMETER stop "<|end_header_id|>"
13PARAMETER stop "<|eot_id|>"
1from llama_cpp import Llama
2
3# Initialize model
4llm = Llama(
5 model_path="swahili-gemma-1b-GGUF/Q4_K_M/swahili-gemma-1b-q4_k_m.gguf",
6 n_ctx=2048,
7 n_threads=8,
8 verbose=False
9)
10
11# Generate translation
12response = llm(
13 "Translate to Swahili: Hello, how are you today?",
14 max_tokens=128,
15 temperature=0.3,
16 top_p=0.95,
17 top_k=64,
18 repeat_penalty=1.1
19)
20
21print(response['choices'][0]['text'])
1# Optimal settings for translation tasks
2--temp 0.3
3--top-p 0.95
4--top-k 64
5--repeat-penalty 1.1
6--ctx-size 2048
This model is released under the
Gemma Terms of Use. Please review the terms before use.
If you use these GGUF quantizations in your research or applications, please cite:
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}