HornLM β€” Qwen3 8B Instruct v1

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.


Model Details

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

About HornLM

HornLM is part of a broader initiative to build open AI infrastructure for the Horn of Africa.

The project includes:

  • Regional knowledge corpus (5K+ documents)
  • Fine-tuned language models
  • RAG API for enterprise and public sector applications
  • Embedding models
  • Search and retrieval infrastructure
  • Open datasets for African AI research

Training Dataset

The SFT dataset was generated from the HornLM Knowledge Corpus, a curated collection of public documents from Djibouti and East Africa.

Current Sources

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.


Usage

Load with Unsloth (Recommended)

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))

Load with Transformers + PEFT

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"
)

Prompt Format

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:

Intended Use

  • Questions about Djibouti
  • Questions about the Horn of Africa
  • Public administration
  • Economic analysis
  • Educational applications
  • Research assistance
  • Government knowledge systems
  • Retrieval-Augmented Generation (RAG)
  • AI applications for startups and institutions

Out-of-Scope Use

  • Medical advice
  • Legal advice without verification
  • Financial decisions
  • High-risk government decision-making
  • General-purpose chat unrelated to the region

Users should always verify critical information using official sources.


Roadmap

HornLM v1

  • English
  • French
  • Djibouti-focused knowledge
  • RAG API
  • 5K+ documents

HornLM v2

  • Somali support
  • Amharic support
  • Swahili support
  • Expanded East African corpus

HornLM v3

  • Multimodal model
  • OCR for government documents
  • Speech support
  • Regional AI agents

Project

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:

  • 5K+ regional documents
  • RAG API
  • Fine-tuned LLMs
  • Open datasets
  • Developer platform

Citation

@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}
}
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for HornLM/hornlm-8b-instruct-v1

Finetuned
Qwen/Qwen3-8B
Finetuned
(2284)
this model