ghanaopenai/twi-translation-tool-calling
Viewer • Updated • 16k • 88
GLOSS-MT (ghanaopenai/gloss-mt) is a 4-billion parameter state-of-the-art neural machine translation model for English to Asante Twi (Akan), fine-tuned on google/gemma-4-E4B-it. It pioneeringly combines autonomous dictionary tool-calling with explicit linguistic reasoning to solve lexical scarcity and hallucination in low-resource machine translation.
google/gemma-4-E4B-it (4B parameter compact multimodal/language foundation model)Evaluated across the comprehensive document-level nsanku-mt-benchmark suite (84 documents spanning 4 heterogeneous domains) against leading commercial and open-source translation models:
| Model | Track / Architecture | Parameters | chrF2 (Avg) | BLEU | Finance (3 Docs) | UDHR (Legal) | Watchtower (5 Docs) | Folktales (75 Docs) |
|---|---|---|---|---|---|---|---|---|
| Gemini 3.8 Flash | Commercial LLM | Cloud | 54.64 | 17.25 | 52.50 | 56.44 | 69.28 | 40.33 |
| Google Translate | Commercial API | Cloud | 51.26 | 15.67 | 48.06 | 52.30 | 67.15 | 37.54 |
| Khaya AI | Commercial API | Cloud | 49.91 | 12.79 | 47.74 | 49.92 | 65.78 | 36.22 |
| GLOSS-MT (Ours) | LLM + Offline Tool | 4B | 49.75 | 11.45 | 51.23 | 50.80 | 60.75 | 36.23 |
| NLLB-200 3.3B | Dedicated Open MT | 3.3B | 47.74 | 14.15 | 45.25 | 52.05 | 56.89 | 36.76 |
| NLLB-200 1.3B | Dedicated Open MT | 1.3B | 47.42 | 13.68 | 45.72 | 50.47 | 57.46 | 36.05 |
| NLLB-200 600M | Distilled Open MT | 600M | 46.71 | 12.74 | 44.10 | 50.17 | 57.06 | 35.50 |
| Gemma 4 31B Base | Foundation LLM | 31B | 45.55 | 11.93 | 45.97 | 41.97 | 57.57 | 36.71 |
| MADLAD-400 3B | Dedicated Open MT | 3B | 37.14 | 6.71 | 37.43 | 36.60 | 50.66 | 23.87 |
| Gemma 4 E4B Base | Foundation LLM | 4B | 12.21 | 0.94 | 8.18 | 3.84 | 21.86 | 14.96 |
49.75 vs 47.74), NLLB-200 1.3B (49.75 vs 47.42), MADLAD-400 3B (49.75 vs 37.14), and Google's Gemma 4 31B Base (49.75 vs 45.55).51.23 chrF2, outperforming Google Translate (48.06), Khaya AI (47.74), NLLB-200 3.3B (45.25), and Gemma 4 31B (45.97), placing second only to Gemini 3.8 Flash (52.50).50.80 chrF2, outperforming Khaya AI (49.92) and completely eliminating the severe hallucination and verbose repetition exhibited by base LLMs (41.97 on Gemma 31B Base; 3.84 on Gemma 4B Base).60.75 chrF2 and 18.92 BLEU, outperforming Gemma 4 31B Base (57.57) and all NLLB models by +3 to +4 chrF points.36.23 chrF2 across 75 historical narrative stories (Rattray 1930) with exact sentence-bounded length fidelity (length ratio 1.19), matching Khaya AI (36.22) and Gemma 4 31B Base (36.71).GLOSS-MT executes translation through an explicit multi-step reasoning trajectory:
Input English Text
│
▼
[1] Tool Call: <|tool_call>call:lookup_twi_translation{phrases: ["court", "decision"]}
│
▼
[2] Offline Dictionary Lookup: 545,633 bilingual entries (no network required)
│
▼
[3] Linguistic Reasoning: <channel|>thought Analysis of syntax, concord, and idioms...
│
▼
[4] Final Translation: Accurate Asante Twi synthesis
transformers)
Install the official package:
pip install git+https://github.com/GhanaOpenAI/gloss-mt.git
Run in Python:
from twi_translate import TwiTranslator, TransformersBackend
# Load model locally
translator = TwiTranslator(TransformersBackend("ghanaopenai/gloss-mt"))
result = translator.translate("The court announced the decision yesterday.")
print("Translation:", result["translation"])
print("Reasoning: ", result["reasoning"])
print("Lookups: ", result["lookups"])
vLLM)
# Start vLLM inference server
vllm serve ghanaopenai/gloss-mt \
--served-model-name twi-translator \
--enable-auto-tool-choice \
--tool-call-parser gemma4 \
--reasoning-parser gemma4 \
--max-model-len 8192 \
--port 8300
Translate via CLI or client:
twi-translate --base-url http://localhost:8300/v1 --model twi-translator -v "The queen-mother advised the youth to avoid illegal mining."