Downloads · 30 days
0
HornLM/hornlm-8b-instruct-v1
hornlm-8b-instruct-v1 is a text generation model from HornLM. Use it when you need the model to write or continue text. The card lists the license as apache-2.0.
HornLM is the first open-source language model fine-tuned specifically for Djibouti and the Horn of Africa.
Downloads · 30 days
0
Access
Public
Updated Jul 2, 2026
Repo size
—
Likes
1
Public
Click a slice to open those files.
.md5.9 KB · 79%
From the Hugging Face model README
HornLM is the first open-source language model fine-tuned specifically for Djibouti and the Horn of Africa.
Built on Qwen3-8B and adapted using QLoRA on a curated instruction dataset generated from more than 62,000 documents collected across government, legal, economic, educational, and institutional sources from Djibouti and East Africa.
HornLM aims to become the foundational AI infrastructure layer for the Horn of Africa, providing local knowledge retrieval, multilingual language models, and developer-friendly APIs.
| Property | Value |
|---|---|
| Model name | hornlm/hornlm-8b-instruct-v1 |
| Base model | Qwen/Qwen3-8B |
| Fine-tuning method | QLoRA (4-bit NF4 + LoRA adapters) |
| LoRA rank / alpha | r=16 / α=32 |
| Training epochs | 3 |
| Effective batch size | 16 |
| Learning rate | 2e-4 |
| Max sequence length | 4096 tokens |
| Training framework | Unsloth + Hugging Face TRL |
| Precision | FP16 |
| Languages | English, French |
| Future languages | Somali, Amharic, Swahili, Arabic |
| License | Apache 2.0 |
HornLM is part of a broader initiative to build open AI infrastructure for the Horn of Africa.
The project includes:
The SFT dataset was generated from the HornLM Knowledge Corpus, a curated collection of public documents from Djibouti and East Africa.
| Source Type | Coverage |
|---|---|
| Government portals | Laws, decrees, public services |
| National statistics | Economic and demographic data |
| Ministries | Education, health, finance, agriculture |
| International organizations | Development reports and indicators |
| Public institutions | Administrative procedures |
| Universities | Research and educational resources |
| Local news outlets | Regional news and analysis |
The corpus currently contains more than 5,000 indexed documents.
Instruction-response pairs were generated and validated before supervised fine-tuning.
from unsloth import FastLanguageModel
model, tokenizer = FastLanguageModel.from_pretrained(
model_name="hornlm/hornlm-8b-instruct-v1",
max_seq_length=4096,
load_in_4bit=True,
)
FastLanguageModel.for_inference(model)
prompt = """
Below is an instruction about Djibouti or the Horn of Africa.
Write a helpful and accurate response.
### Instruction:
What are the main economic sectors of Djibouti?
### Response:
"""
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
outputs = model.generate(
**inputs,
max_new_tokens=256,
do_sample=False
)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
base = AutoModelForCausalLM.from_pretrained(
"Qwen/Qwen3-8B",
load_in_4bit=True,
device_map="auto",
)
model = PeftModel.from_pretrained(
base,
"hornlm/hornlm-8b-instruct-v1"
)
tokenizer = AutoTokenizer.from_pretrained(
"hornlm/hornlm-8b-instruct-v1"
)
HornLM was fine-tuned using an instruction-following format.
Below is an instruction about Djibouti or the Horn of Africa.
Write a helpful and accurate response.
### Instruction:
{user question}
### Response:
Users should always verify critical information using official sources.
HornLM is the first open-source AI infrastructure layer for Djibouti and the Horn of Africa.
Our mission is to make regional knowledge accessible through open, multilingual, and sovereign AI systems.
Features:
@misc{hornlm2026,
author = {Margagui Team},
title = {HornLM: Open-Source AI Infrastructure for the Horn of Africa},
year = {2026},
publisher = {Hugging Face},
howpublished = {https://huggingface.co/hornlm/hornlm-8b-instruct-v1}
}