Instructions to use qvac/TranslatePsy-AfriSLM-4B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use qvac/TranslatePsy-AfriSLM-4B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="qvac/TranslatePsy-AfriSLM-4B") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("qvac/TranslatePsy-AfriSLM-4B") model = AutoModelForMultimodalLM.from_pretrained("qvac/TranslatePsy-AfriSLM-4B", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use qvac/TranslatePsy-AfriSLM-4B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "qvac/TranslatePsy-AfriSLM-4B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "qvac/TranslatePsy-AfriSLM-4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/qvac/TranslatePsy-AfriSLM-4B
- SGLang
How to use qvac/TranslatePsy-AfriSLM-4B with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "qvac/TranslatePsy-AfriSLM-4B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "qvac/TranslatePsy-AfriSLM-4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "qvac/TranslatePsy-AfriSLM-4B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "qvac/TranslatePsy-AfriSLM-4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use qvac/TranslatePsy-AfriSLM-4B with Docker Model Runner:
docker model run hf.co/qvac/TranslatePsy-AfriSLM-4B
TranslatePsy-AfriSLM-4B
TranslatePsy-AfriSLM-4B is a compact, conversational machine-translation model specialized for English and 19 Sub-Saharan African languages. It is a full-parameter supervised fine-tune of Qwen/Qwen3.5-4B trained on quality-filtered parallel data and multilingual instruction data.
The model accompanies the EMNLP 2026 paper TranslatePsy-AfriSLM: High-Quality Data Scaling For Low-Resource Machine Translation. The TranslatePsy-AfriSLM family outperforms substantially larger systems, including TranslateGemma-27B and Qwen3.5-122B-A10B, on the African machine-translation benchmarks reported in the paper.
Model Details
- Developed by: Milan Gritta, Patrik Lambert, Jihye Back, and Amril Nazir
- Organization: Tether AI Research
- Shared by: QVAC
- Model type: Qwen3.5 decoder-only conversational language model, full-parameter SFT
- Parameters: approximately 4B
- Languages: English, Afrikaans, Amharic, Hausa, Igbo, Kinyarwanda, Lingala, Luganda, Malagasy, Nyanja, Oromo, Shona, Somali, Southern Sotho, Swahili, Tswana, Wolof, Xhosa, Yoruba, and Zulu
- License: Apache 2.0
- Base model:
Qwen/Qwen3.5-4B - Paper: arXiv:2608.18655
- Code: tether-ai-research/qvac-translatepsy-afri-slm
- Dataset:
qvac/TranslatePsy-AfriSLM-Synthetic-Mix - Models and resources: TranslatePsy-AfriSLM collection
Model Family
The paper evaluates three model sizes:
| Model | Base model | Flores-200 | BOUQuET | Smol |
|---|---|---|---|---|
| TranslatePsy-AfriSLM-0.8B | Qwen3.5-0.8B | 0.5944 | 0.6223 | 0.4973 |
| TranslatePsy-AfriSLM-2B | Qwen3.5-2B | 0.6070 | 0.6322 | 0.5074 |
| TranslatePsy-AfriSLM-4B | Qwen3.5-4B | 0.6143 | 0.6391 | 0.5136 |
Scores are macro-averaged SSA-COMET results over the paper's 19 in-distribution African languages. See the paper for all metrics, translation directions, per-language results, and statistical tests.
Quantized GGUF Results
Q4_K_M and Q8_0 GGUF quantizations are available for the 0.8B, 2B, and 4B variants:
| Model | Quantization | Flores-200 | BOUQuET | Smol |
|---|---|---|---|---|
| TranslatePsy-AfriSLM-0.8B | Q8_0 | 0.5944 | 0.6207 | 0.4955 |
| TranslatePsy-AfriSLM-0.8B | Q4_K_M | 0.5886 | 0.6157 | 0.4905 |
| TranslatePsy-AfriSLM-2B | Q8_0 | 0.6071 | 0.6310 | 0.5063 |
| TranslatePsy-AfriSLM-2B | Q4_K_M | 0.6054 | 0.6299 | 0.5048 |
| TranslatePsy-AfriSLM-4B | Q8_0 | 0.6142 | 0.6384 | 0.5129 |
| TranslatePsy-AfriSLM-4B | Q4_K_M | 0.6138 | 0.6377 | 0.5121 |
These are macro-averaged SSA-COMET scores over the same 19 in-distribution African languages and both translation directions used in the full-precision table. The GGUF evaluations used a 2,048-token context. Quantized results may differ slightly from the full-precision results.
Uses
Direct Use
The model is intended for:
- translation between English and the supported African/European languages;
- conversational and multi-turn translation;
- research on low-resource and African machine translation;
- local or resource-constrained inference, especially with the GGUF variants.
Out-of-Scope Use
The model was not designed or validated for autonomous use in medical, legal, emergency, immigration, financial, or other high-stakes contexts. It should not be used to infer sensitive characteristics, generate deceptive translations, or replace qualified human translators where errors could cause harm.
Translation quality is not guaranteed for unsupported languages, dialects, specialized domains, code-switching, very long documents, or text requiring extensive cultural context. The model's multimodal capabilities were not evaluated after fine-tuning.
How to Get Started
Qwen3.5 requires Transformers 5. Use a recent version of transformers:
python -m pip install --upgrade "transformers>=5" torch
Strict translation
For a single translation, use the same prompt format as the paper:
from transformers import pipeline
model_id = "qvac/TranslatePsy-AfriSLM-4B"
generator = pipeline(
"text-generation",
model=model_id,
dtype="auto",
device=0,
)
source_lang = "English"
target_lang = "Swahili"
source_text = "How are you today?"
messages = [
{
"role": "system",
"content": (
f"You are a professional {source_lang} to {target_lang} translator. "
f"Your goal is to accurately convey the meaning and nuances of the "
f"original {source_lang} text while adhering to {target_lang} grammar, "
f"vocabulary, and cultural sensitivities. Produce only the "
f"{target_lang} translation, without any additional explanations "
"or commentary. "
),
},
{
"role": "user",
"content": (
f"Please translate the following {source_lang} text into "
f"{target_lang}: {source_text}.\n\nTranslation:"
),
},
]
result = generator(
messages,
max_new_tokens=256,
do_sample=False,
clean_up_tokenization_spaces=False,
)
print(result[0]["generated_text"][-1]["content"])
Language names should be written out in the prompt, for example English, Swahili, Yoruba, or Amharic.
Project CLI
The accompanying repository provides both strict single-turn translation and conversational modes:
git clone https://github.com/tether-ai-research/qvac-translatepsy-afri-slm
cd qvac-translatepsy-afri-slm
python -m pip install -r requirements-chat.txt
Conversational mode
Start a multi-turn conversation on one CUDA GPU:
CUDA_VISIBLE_DEVICES=0 python chat.py --model qvac/TranslatePsy-AfriSLM-4B
Enter /reset to clear the conversation or /exit to quit.
Strict translation mode
Provide all three translation arguments for a single translation:
CUDA_VISIBLE_DEVICES=0 python chat.py \
--model qvac/TranslatePsy-AfriSLM-4B \
--source_lang English \
--target_lang Swahili \
--source_text "How are you today?"
Training Details
Training Data
The final training mixture combines:
- TranslatePsy-AfriSLM Synthetic Mix: quality-filtered synthetic parallel data for the 19 target African languages;
- Instruct Mix: multilingual instruction-following data, approximately half of which is African-language content, used to preserve conversational capabilities;
- Asia-Europe Mix: English-parallel data covering 38 Asian and European languages, used to reduce catastrophic forgetting outside the target African distribution.
The publicly released synthetic component contains 215,653,192 bidirectional examples, representing approximately 32.37B training tokens before combination with the auxiliary mixes. See the dataset card for its construction and limitations.
Training Procedure
Models were full-parameter fine-tuned for one epoch. Training examples used the model chat template, and loss was computed only on assistant tokens. Sequences longer than 2,048 tokens were filtered; the remaining examples were packed with best-fit decreasing.
Hyperparameters
- peak learning rate:
1.25e-5 - optimizer: fused AdamW
- learning-rate schedule: linear
- warmup: 1%
- global batch size: 256
- gradient clipping: 1.0
- precision: bfloat16
- gradient checkpointing: enabled
- distributed training: DeepSpeed ZeRO-2
Infrastructure
Experiments were run with PyTorch, Hugging Face Transformers, TRL, and DeepSpeed on 32 NVIDIA H100 GPUs.
Evaluation
The models were evaluated in both English-to-African and African-to-English directions on:
- FLORES-200,
devtestsplit; - BOUQuET,
testsplit; - SMOL,
smolsentsplit.
Evaluation covered all 19 target African languages. The reported metrics were COMET-22, SSA-COMET, MetricX-24, and ChrF++. TranslatePsy-AfriSLM-4B obtained SSA-COMET scores of 0.6143 on FLORES-200, 0.6391 on BOUQuET, and 0.5136 on SMOL.
Paired bootstrap tests in the paper show that the TranslatePsy-AfriSLM family significantly outperforms much larger general-purpose and translation-specialized baselines on most reported settings. Results are nevertheless based on automatic metrics; expert human evaluation remains necessary.
Bias, Risks, and Limitations
- Training translations are primarily synthetic and may reproduce errors or biases from NLLB-3.3B and the filtering metrics.
- Automatic MT metrics may not reliably measure absolute quality for every supported language.
- Dialect provenance is unavailable, so standardized written forms may be overrepresented relative to regional dialects and oral traditions.
- Performance varies by language and translation direction; aggregate scores can hide weaker cases.
- Web-derived training data may contain harmful content, factual errors, demographic biases, or personal information.
- The paper does not include expert human evaluation, and the model may hallucinate, omit, or mistranslate content.
- Fine-tuning excluded reasoning data, so the model does not retain the base model's thinking capability.
Users should conduct native-speaker evaluation for the intended language, dialect, domain, and risk level. High-impact translations should always receive qualified human review.
Licensing Information
This model which was fine-tuned as described in the blog post is licensed by Tether Data, S.A. de C.V. under the Apache 2.0 license. As described in the blog post, this model is a version of the Qwen3.5-4B model, which is made available under the Apache 2.0 license. As described in the blog post, the NLLB-200-3.3B model which is made available under the CC-BY-NC 4.0 license was used as a teacher model. The TranslatePsy-AfriSLM synthetic mix is made available under the CC-BY-NC 4.0 license. The SmolTalk2 dataset is made available under the Apache 2.0 license. The Dolci-Instruct dataset is made available under the Open Data Commons Attribution License (ODC-By) v1.0 license. The OPUS-100 dataset is available on Hugging Face. As described in the blog post, the TranslatePsy-AfriSLM, SmolTalk2, Dolci-Instruct and OPUS-100 datasets were used as a part of fine-tuning the model.
Citation
@misc{gritta2026translatepsyafrislmhighqualitydatascaling,
title={TranslatePsy-AfriSLM: High-Quality Data Scaling For Low-Resource Machine Translation},
author={Milan Gritta and Patrik Lambert and Jihye Back and Amril Nazir},
institution={Tether Data, S.A. de C.V. d.b.a. Tether AI Research},
year={2026},
eprint={2608.18655},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2608.18655},
}
APA: Gritta, M., Lambert, P., Back, J., & Nazir, A. (2026). TranslatePsy-AfriSLM: High-Quality Data Scaling For Low-Resource Machine Translation. arXiv preprint arXiv:2608.18655. https://arxiv.org/abs/2608.18655
Model Card Contact
Questions and feedback can be submitted through the project repository.
- Downloads last month
- 6
