Instructions to use fidelizML/AmhariXLM-0.5B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use fidelizML/AmhariXLM-0.5B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="fidelizML/AmhariXLM-0.5B")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("fidelizML/AmhariXLM-0.5B") model = AutoModelForCausalLM.from_pretrained("fidelizML/AmhariXLM-0.5B", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use fidelizML/AmhariXLM-0.5B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "fidelizML/AmhariXLM-0.5B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "fidelizML/AmhariXLM-0.5B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/fidelizML/AmhariXLM-0.5B
- SGLang
How to use fidelizML/AmhariXLM-0.5B 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 "fidelizML/AmhariXLM-0.5B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "fidelizML/AmhariXLM-0.5B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "fidelizML/AmhariXLM-0.5B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "fidelizML/AmhariXLM-0.5B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use fidelizML/AmhariXLM-0.5B with Docker Model Runner:
docker model run hf.co/fidelizML/AmhariXLM-0.5B
AmhariXLM-0.5B
AmhariXLM-0.5B is a 565M-parameter Amharic/English language model, supervised fine-tuned for education-domain question answering. Trained from scratch on a curated Grade 1β10 curriculum plus Wikipedia and general reading material.
Developed by fidelizML β the Fideliz AI team.
Highlights
- π― Fully trained from scratch β no external base model. Only the LLaMA architecture (config layout) was reused; all weights are ours.
- π Education-focused β trained on textbooks, articles, and Wikipedia across primary and secondary subjects.
- π Bilingual β ~30% Amharic, ~70% English training mix.
- π¬ ChatML format β compatible with standard chat templates.
- π Apache 2.0 β free for commercial and non-commercial use.
Model details
| Property | Value |
|---|---|
| Architecture | LLaMA-style (trained from scratch) |
| Parameters | ~565 M (0.5 B rounded) |
| Layers | 8 |
| Hidden size | 3072 |
| Intermediate size | 4096 |
| Attention heads | 12 (3 KV heads) |
| Vocab size | 24,000 (SentencePiece, Unigram) |
| Context length | 250 tokens |
| Precision | float16 |
| Special tokens | bos=1, eos=2, pad=0 |
| Prompt format | ChatML (`<\ |
| Languages | Amharic (am), English (en) |
Intended users
- Researchers studying low-resource African-language LLMs.
- Developers building Amharic/English educational tools (tutoring apps, Q&A systems, quiz generators).
- Educators exploring AI-assisted learning in Amharic.
Not intended for: medical, legal, financial, or safety-critical decisions. Not a calculator (see Limitations below).
Training
- Base: Trained from scratch β no external model weights.
- Data: Curated SFT corpus:
- Primary-school textbooks (Grades 1β10)
- Wikipedia articles (Amharic + English)
- General reading material and articles
- Curriculum-focused Q&A pairs
- Language split: ~30% Amharic, ~70% English.
- Method: Supervised fine-tuning with ChatML prompt format.
Evaluation
Reported results from our internal test suites. Ranges reflect different decoding strategies (greedy / sampling / best-of-N).
| Benchmark | Score | Notes |
|---|---|---|
| Science definition Q&A (Bio/Phys/Chem) | 90β95% | On curated definition set |
| Single-step arithmetic | 45β80% | Range depends on decoding; small numbers work best |
| GSM8K (multi-step math) | 37β55% | With inference adjustments (best-of-N / self-consistency) |
What works well:
- Simple factual definitions (e.g., "What is a cell?", "What does CPU stand for?")
- Symbol lookup (Fe, Au β chemical symbols)
- Basic English grammar (plurals, opposites)
- Well-represented Amharic grammar facts
What fails:
- Some Amharic factual recall (e.g., "capital of Ethiopia" occasionally hallucinated)
- Multi-digit arithmetic (tokenizer treats whole numbers as single tokens)
- Physics formulas requiring derivation (Ohm's Law occasionally gibberish)
Usage
Install
pip install transformers torch sentencepiece huggingface_hub
Load the model
import torch
import sentencepiece as spm
from transformers import LlamaForCausalLM
from huggingface_hub import hf_hub_download
REPO_ID = "fidelizML/AmhariXLM-0.5B"
model = LlamaForCausalLM.from_pretrained(
REPO_ID,
torch_dtype=torch.float16,
device_map="auto",
)
# Tokenizer is a raw SentencePiece model
tok_path = hf_hub_download(REPO_ID, "tokenizer.model")
sp = spm.SentencePieceProcessor(model_file=tok_path)
Chat with the model
The model uses ChatML prompt format:
import torch
IM_END_ID = sp.piece_to_id("<|im_end|>")
def chat(question, max_new_tokens=200, temperature=0.0):
prompt = (
f"<|im_start|>user\\n{question}\\n<|im_end|>\\n"
f"<|im_start|>assistant\\n"
)
input_ids = [model.config.bos_token_id] + sp.encode_as_ids(prompt)
input_ids = input_ids[:250 - max_new_tokens - 1]
with torch.inference_mode():
out = model.generate(
input_ids=torch.tensor([input_ids], device=model.device),
max_new_tokens=max_new_tokens,
do_sample=(temperature > 0),
temperature=max(temperature, 1e-5),
eos_token_id=[model.config.eos_token_id, IM_END_ID],
pad_token_id=model.config.pad_token_id,
repetition_penalty=1.05,
)
return sp.decode(out[0][len(input_ids):])
print(chat("What is the basic unit of all living things?"))
Important: add IM_END_ID to eos_token_id β the model emits <|im_end|>
as its natural stopping token during SFT. Without this, generation runs until
max_new_tokens and appends the literal <|im_end|> string.
Gradio demo (HF Spaces)
import gradio as gr
with gr.Blocks() as demo:
gr.Markdown("# AmhariXLM-0.5B")
inp = gr.Textbox(label="Ask in Amharic or English")
out = gr.Textbox(label="Answer", lines=6)
btn = gr.Button("Ask")
btn.click(lambda q: chat(q), inputs=inp, outputs=out)
demo.launch()
Limitations
Arithmetic
The tokenizer uses split_digits=False β whole numbers are single tokens.
The model can answer arithmetic it has seen many times during training, but
cannot reliably compute new multi-digit problems. Use a calculator if
precision matters.
Amharic factual accuracy
Some Amharic-specific facts produce hallucinated answers. Verify Amharic responses externally before relying on them for high-stakes work.
Context length
Only 250 tokens. Longer inputs are truncated β chunk long inputs first.
Small-model limits
At 565M parameters this model is not competitive with frontier models on complex reasoning. It is optimized for simple educational Q&A in Amharic and English.
Not for high-stakes use
Do not use for medical, legal, financial, or safety-critical decisions without external verification.
Tokenizer details
- Type: SentencePiece, Unigram, 24,000 tokens
- Normalization:
nmt_nfkc - Byte fallback: enabled (handles unknown characters gracefully)
- Split digits: disabled β whole numbers are single tokens
- User-defined symbols: ChatML control tokens, Geez numerals (α©βαΌ), math emojis (β β βοΈ β π°), and frequent English reasoning words (Identify, Given, Calculate, Conclude, Formula, Understand)
Citation
@misc{amharixlm_05b_2026,
title = {AmhariXLM-0.5B: An Amharic/English Educational Language Model},
author = {Fideliz AI Team and Yisberh},
year = {2025},
url = {https://huggingface.co/fidelizML/AmhariXLM-0.5B}
}
Contact
- Org: fidelizML
- Maintainer: Yisberh
- Issues: open an issue on the model repo's Community tab
License
Apache License 2.0 β free for commercial and non-commercial use. """
- Downloads last month
- 507
Model tree for fidelizML/AmhariXLM-0.5B
Evaluation results
- Accuracyself-reported90-95
- Accuracyself-reported45-80
- Accuracyself-reported37-55