AfriqueGemma-12B
is part of the
AfriqueLLM
suite—a collection of open language models adapted to
20 African languages
through continued pre-training (CPT) on
25.2B tokens
. This model is based on
google/gemma-3-12b-pt
and has been specifically adapted for improved performance on African languages while maintaining strong capabilities in high-resource languages.
Key Features
Type
: Causal Language Model (Base/Pre-trained)
Base Model
: Gemma 3 12B PT
Parameters
: 12B
Context Length
: 8,192 tokens (native)
Training Tokens
: 25.2B tokens of carefully curated multilingual data
Supported Languages
AfriqueGemma-12B has been adapted for the following 20 African languages plus 4 high-resource languages:
Language
Code
Family
Script
Afrikaans
afr_Latn
Germanic
Latin
Swahili
swh_Latn
Bantu
Latin
Moroccan Arabic
ary_Arab
Semitic
Arabic
Somali
som_Latn
Cushitic
Latin
Amharic
amh_Ethi
Semitic
Ethiopic
Egyptian Arabic
arz_Arab
Semitic
Arabic
Hausa
hau_Latn
Chadic
Latin
Kinyarwanda
kin_Latn
Bantu
Latin
Zulu
zul_Latn
Bantu
Latin
Igbo
ibo_Latn
Volta-Niger
Latin
Plateau Malagasy
plt_Latn
Austronesian
Latin
Xhosa
xho_Latn
Bantu
Latin
Shona
sna_Latn
Bantu
Latin
Yoruba
yor_Latn
Volta-Niger
Latin
Nyanja
nya_Latn
Bantu
Latin
Southern Sotho
sot_Latn
Bantu
Latin
Tigrinya
tir_Ethi
Semitic
Ethiopic
Tunisian Arabic
aeb_Arab
Semitic
Arabic
Oromo
gaz_Latn
Cushitic
Latin
Tswana
tsn_Latn
Bantu
Latin
High-resource languages (for catastrophic forgetting mitigation):
English, French, Portuguese, Arabic
Training Data
Our training corpus combines multiple high-quality sources:
African Monolingual Data
(~22.8B tokens): FineWeb2, WURA, and MADLAD-400
Code
(~1B tokens): CornStack-Python for reasoning capabilities
Mathematics
(~1B tokens): FineMath-4+ for mathematical understanding
Synthetic Data
(~324M tokens): GPT-4.1 translated domain-specific content across 10 domains
We use
UniMax sampling
to create a balanced distribution, capping high-resource languages at approximately 1B tokens and upsampling lower-resource languages for up to five epochs.
Quickstart
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "McGill-NLP/AfriqueGemma-12B"# Load the tokenizer and the model
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype="auto",
device_map="auto"
)
# Prepare the model input
prompt = "Bawo ni o ṣe n ṣe?"# Yoruba: "How are you doing?"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
# Generate text
generated_ids = model.generate(
**inputs,
max_new_tokens=100,
do_sample=True,
temperature=0.7,
top_p=0.9
)
output = tokenizer.decode(generated_ids[0], skip_special_tokens=True)
print(output)
Deployment
For deployment, you can use
vllm
or
sglang
to create an OpenAI-compatible API endpoint:
This model is released under the
CC BY 4.0 License
. Please review the license terms before use.
Acknowledgments
We thank the creators of the base models, datasets and compute resources that made this work possible, including Mila, Compute Canada, Microsoft, the FineWeb team, WURA, MADLAD-400 and etc..
Runs of McGill-NLP AfriqueGemma-12B on huggingface.co
463
Total runs
-2
24-hour runs
-2
3-day runs
6
7-day runs
-253
30-day runs
More Information About AfriqueGemma-12B huggingface.co Model
AfriqueGemma-12B huggingface.co is an AI model on huggingface.co that provides AfriqueGemma-12B's model effect (), which can be used instantly with this McGill-NLP AfriqueGemma-12B model. huggingface.co supports a free trial of the AfriqueGemma-12B model, and also provides paid use of the AfriqueGemma-12B. Support call AfriqueGemma-12B model through api, including Node.js, Python, http.
AfriqueGemma-12B huggingface.co is an online trial and call api platform, which integrates AfriqueGemma-12B's modeling effects, including api services, and provides a free online trial of AfriqueGemma-12B, you can try AfriqueGemma-12B online for free by clicking the link below.
McGill-NLP AfriqueGemma-12B online free url in huggingface.co:
AfriqueGemma-12B is an open source model from GitHub that offers a free installation service, and any user can find AfriqueGemma-12B on GitHub to install. At the same time, huggingface.co provides the effect of AfriqueGemma-12B install, users can directly use AfriqueGemma-12B installed effect in huggingface.co for debugging and trial. It also supports api for free installation.