🇱🇰 Sinhala-NanoLlama-250M-Instruct (V2 — GGUF)
Sinhala-NanoLlama-250M-Instruct is an open-source, 243.4M-parameter Sinhala Llama-3 style chat model built, pre-trained, and instruction-tuned completely from scratch in PyTorch — exported directly to lossless F16 GGUF (488 MB) with an embedded ChatML template so it runs out of the box locally in LM Studio and llama.cpp.
🔗 Model Family (V2)
| Repository | Format | Purpose |
|---|---|---|
| rasikarsw/Sinhala-NanoLlama-250M-Base | PyTorch (.pt) | Pre-trained foundation weights for custom SFT / LoRA fine-tuning |
| rasikarsw/Sinhala-NanoLlama-250M-Base-GGUF | GGUF (F16, 488 MB) | Local base text completion in LM Studio / llama.cpp |
| rasikarsw/Sinhala-NanoLlama-250M-Instruct | PyTorch (.pt) | ChatML instruction-tuned PyTorch checkpoint |
| rasikarsw/Sinhala-NanoLlama-250M-Instruct-GGUF (this repo) | GGUF (F16, 488 MB) | Ready-to-chat local Sinhala assistant in LM Studio / llama.cpp |
📦 Available File
| File | Quantization | Size | Notes |
|---|---|---|---|
Sinhala-NanoLlama-250M-Instruct-F16.gguf | F16 (Lossless 16-bit) | 488 MB | Native llama.cpp LLM_ARCH_LLAMA, 2,048 context, embedded ChatML template |
📊 Model Specifications (V1 → V2 Upgrades)
| Specification | V1 (NanoGPT-98M) | V2 (NanoLlama-250M) |
|---|---|---|
| Architecture | GPT-2 (LayerNorm, GELU, MHA) | Llama-3 (RMSNorm, SwiGLU, GQA 14Q/7KV, Interleaved RoPE) |
| Parameters | 97.7M | 243.4M |
| Context Window | 512 tokens | 2,048 tokens (~1,500+ Sinhala words) |
| Tokenizer | 16K Sinhala BPE | 32K ChatML Sinhala BPE (~1.15 tokens/word, ZWJ preserved) |
| Pre-training | 655M tokens (val loss 3.568) | 1.57B tokens on ZWJ-repaired FineWeb-2 + 4× Wiki (val loss 3.496, ppl 33.0) |
| Fine-Tuning (SFT) | 18,149 pairs (val loss 3.199) | 2-Stage Full SFT: 56,017 general pairs (val loss 2.431) + 652 curated Sri Lankan domain pairs |
💬 Sample Outputs (Running Locally in LM Studio)
| Question (Sinhala) | Model Response |
|---|---|
ශ්රී ලංකාවේ දිගම ගඟ කුමක්ද? | ශ්රී ලංකාවේ දිගම ගඟ මහවැලි ගඟයි. එහි දිග කිලෝමීටර් 335 ක් පමණ වේ. |
ශ්රී ලංකාවේ උසම කන්ද කුමක්ද? | පිදුරුතලාගල කන්ද ශ්රී ලංකාවේ උසම කන්දයි. |
මිනිස් මොළය සහ මනස අතර වෙනස කුමක්ද? | මිනිස් මොළය යනු හිස් කබල තුළ පිහිටි ස්නායු සෛල (නියුරෝන) බිලියන ගණනකින් සමන්විත භෞතික අවයවයයි. මනස යනු එම මොළයේ ක්රියාකාරිත්වයයි. |
🚀 How to Run Locally
Option 1: LM Studio (Recommended)
- Search for
rasikarsw/Sinhala-NanoLlama-250M-Instruct-GGUFin LM Studio and downloadSinhala-NanoLlama-250M-Instruct-F16.gguf. - Load the model — the ChatML Jinja template and
<|im_end|>EOS token are embedded directly inside the GGUF file (zero manual template setup needed). - Recommended inference settings:
- Context Length:
2048 - Temperature:
0.3 – 0.5(lower temperature = more accurate Sinhala facts) - Repeat Penalty:
1.12 – 1.15
- Context Length:
- Start a New Chat and ask your question in Sinhala!
Option 2: llama.cpp CLI
llama-cli -m Sinhala-NanoLlama-250M-Instruct-F16.gguf \
-c 2048 --temp 0.4 --repeat-penalty 1.12 -cnv \
-sys "ඔබ ශ්රී ලංකාව පිළිබඳව සහ සාමාන්ය දැනුම පිළිබඳව නිවැරදි, පැහැදිලි සහ ප්රයෝජනවත් සිංහල පිළිතුරු ලබා දෙන කෘත්රිම බුද්ධි සහායකයෙකි."
⚠️ Limitations & Intended Use
- Experimental / Educational 250M Model: Designed for open-source Sinhala NLP research, edge experimentation, and demonstrating end-to-end LLM engineering from scratch.
- Hallucinations: At 243.4M parameters, the model can still make factual errors on obscure topics — do not use it as a sole source of truth for exams, medical, or legal advice.
- Topic Switches: Because most public Sinhala SFT data is single-turn, starting a fresh chat when switching to an unrelated topic produces cleaner answers.
- Language Scope: Trained primarily on Sinhala (
si).
📄 License
Released under the Apache 2.0 License.