Text Generation
Transformers
Safetensors
Uzbek
English
Russian
neuron_lm
uzbek
o'zbek
chat
instruction-tuned
conversational
custom_code
Instructions to use NeuronUz/MustaqiLLM with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use NeuronUz/MustaqiLLM with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="NeuronUz/MustaqiLLM", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("NeuronUz/MustaqiLLM", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use NeuronUz/MustaqiLLM with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "NeuronUz/MustaqiLLM" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "NeuronUz/MustaqiLLM", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/NeuronUz/MustaqiLLM
- SGLang
How to use NeuronUz/MustaqiLLM 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 "NeuronUz/MustaqiLLM" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "NeuronUz/MustaqiLLM", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "NeuronUz/MustaqiLLM" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "NeuronUz/MustaqiLLM", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use NeuronUz/MustaqiLLM with Docker Model Runner:
docker model run hf.co/NeuronUz/MustaqiLLM
Rename to MustaqiLLM; correct dtype/EOS/memory facts; resolve news class names; fix broken table
Browse files
README.md
CHANGED
|
@@ -10,19 +10,15 @@ tags:
|
|
| 10 |
- o'zbek
|
| 11 |
- chat
|
| 12 |
- instruction-tuned
|
| 13 |
-
base_model: kmamaroziqov/NeuronAI-5B-Base
|
| 14 |
library_name: transformers
|
| 15 |
---
|
| 16 |
|
| 17 |
-
#
|
| 18 |
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
reliably, writes fluent Uzbek in both Latin and Cyrillic script, and is strong on
|
| 24 |
-
sentiment and news classification. It is **not** a knowledge model: on multiple-choice
|
| 25 |
-
knowledge benchmarks it performs at chance. Read the
|
| 26 |
[Evaluation](#evaluation) and [Limitations](#limitations) sections before using it —
|
| 27 |
they are specific about what works and what does not.
|
| 28 |
|
|
@@ -36,7 +32,7 @@ they are specific about what works and what does not.
|
|
| 36 |
| Context length | 4096 tokens |
|
| 37 |
| Vocabulary | 48,000 (BPE) |
|
| 38 |
| Embeddings | untied |
|
| 39 |
-
| Weights dtype | bfloat16 |
|
| 40 |
| Languages | Uzbek (Latin + Cyrillic), English, Russian |
|
| 41 |
|
| 42 |
---
|
|
@@ -50,7 +46,7 @@ code ships inside this repository.
|
|
| 50 |
import torch
|
| 51 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 52 |
|
| 53 |
-
model_id = "NeuronUz/
|
| 54 |
|
| 55 |
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
|
| 56 |
model = AutoModelForCausalLM.from_pretrained(
|
|
@@ -73,7 +69,7 @@ with torch.no_grad():
|
|
| 73 |
**inputs,
|
| 74 |
max_new_tokens=256,
|
| 75 |
do_sample=False, # greedy; see Generation settings below
|
| 76 |
-
eos_token_id=5, # <|im_end|>
|
| 77 |
pad_token_id=3, # <pad>
|
| 78 |
)
|
| 79 |
|
|
@@ -104,12 +100,16 @@ model was trained with.
|
|
| 104 |
|
| 105 |
| setting | value | why |
|
| 106 |
|---|---|---|
|
| 107 |
-
| `eos_token_id` | **5** (`<|im_end|>`) | The turn terminator
|
| 108 |
-
| `
|
| 109 |
-
| `do_sample` | `False` for classification/extraction; `True`, `temperature≈0.7`, `top_p≈0.9` for open chat | Every benchmark below was measured greedy. |
|
| 110 |
| `dtype` | `torch.bfloat16` | Trained in bf16. |
|
| 111 |
|
| 112 |
-
Memory:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 113 |
|
| 114 |
### Serving
|
| 115 |
|
|
@@ -125,7 +125,9 @@ serve).
|
|
| 125 |
|
| 126 |
## Training
|
| 127 |
|
| 128 |
-
|
|
|
|
|
|
|
| 129 |
|
| 130 |
| | |
|
| 131 |
|---|---|
|
|
@@ -154,7 +156,7 @@ The backbone mixes general Uzbek assistant data, benchmark-format task data
|
|
| 154 |
retention slice. Third-person rubric-grading text was filtered out of the backbone
|
| 155 |
before training.
|
| 156 |
|
| 157 |
-
The Cyrillic and Russian slices exist because the
|
| 158 |
Cyrillic *better* than Latin (bits-per-byte 0.2288 vs 0.3868) yet had almost no Cyrillic
|
| 159 |
chat behaviour attached to it, and because Russian-language instructions were nearly
|
| 160 |
absent. Checkpoint selection was done by running the full benchmark suite on all 12
|
|
@@ -175,7 +177,7 @@ test sets (no subsampling). Scores are accuracy unless noted.
|
|
| 175 |
| uzlib (Uzbek linguistic MCQ) | 1,861 | 0.2875 | 0.0000 |
|
| 176 |
| TUMLU-Uzbek (Uzbek MMLU) | 700 | 0.3286 | 0.0000 |
|
| 177 |
| MMLU-Uz (translated MMLU) | 14,042 | 0.2584 | 0.0000 |
|
| 178 |
-
| News topic classification (10-way) | 96,970 | **0.6531** | 0.0000 |
|
| 179 |
| Sentiment (binary) | 10,000 | **0.9259** | 0.0001 |
|
| 180 |
|
| 181 |
Random baselines: 0.25 for the 4-way MCQ tasks, 0.10 for news, 0.50 for sentiment.
|
|
@@ -207,36 +209,16 @@ Random baselines: 0.25 for the 4-way MCQ tasks, 0.10 for news, 0.50 for sentimen
|
|
| 207 |
| class | n | score |
|
| 208 |
|---|---:|---:|
|
| 209 |
| Sport | 16,113 | 0.8743 |
|
| 210 |
-
|
|
| 211 |
-
|
|
| 212 |
-
|
|
| 213 |
-
|
|
| 214 |
-
|
|
| 215 |
-
|
|
| 216 |
-
|
|
| 217 |
-
|
|
| 218 |
| Oila va Jamiyat (Family & Society) | 14,012 | 0.4273 |
|
| 219 |
|
| 220 |
-
### Comparison with prior SFTs of the same base
|
| 221 |
-
|
| 222 |
-
Same benchmark suite, same conditions.
|
| 223 |
-
|
| 224 |
-
| benchmark | **MilliyLM-5B** | NeuronAI-5B-v4 | NeuronAI-5B (v1) |
|
| 225 |
-
|---|---:|---:|---:|
|
| 226 |
-
| uzlib | **0.2875** | 0.2708 | 0.2638 |
|
| 227 |
-
| TUMLU-Uz | **0.3286** | 0.2100 | 0.1914 |
|
| 228 |
-
| MMLU-Uz | **0.2584** | 0.2136 | 0.2154 |
|
| 229 |
-
| MMLU (English) | **0.2619** | 0.2142 | 0.2196 |
|
| 230 |
-
| News | **0.6531** | 0.1834 | 0.1542 |
|
| 231 |
-
| Sentiment | **0.9259** | 0.1186 | 0.2647 |
|
| 232 |
-
| FLORES en→uz BLEU | 5.17 | **7.68** | 7.37 |
|
| 233 |
-
| FLORES uz→en BLEU | 1.83 | **4.21** | 5.15 |
|
| 234 |
-
|
| 235 |
-
Most of the classification gain comes from **format compliance** rather than raw
|
| 236 |
-
capability: the earlier models emitted unparseable answers on 63–78% of sentiment items
|
| 237 |
-
and 6–13% of TUMLU items, while MilliyLM-5B's invalid rate is ≤0.0001 across every task.
|
| 238 |
-
Translation is the one axis where the earlier models are better — see Limitations.
|
| 239 |
-
|
| 240 |
### Contamination check
|
| 241 |
|
| 242 |
44.1% of the sentiment evaluation set also appears in the training data, because the
|
|
@@ -260,14 +242,13 @@ with training data.
|
|
| 260 |
**Multiple-choice knowledge tasks perform at chance.** uzlib, MMLU-Uz and MMLU-English
|
| 261 |
all sit within noise of their 0.25 random baseline, across roughly 30,000 questions.
|
| 262 |
Invalid rates near zero mean the model answers in the correct format every time and is
|
| 263 |
-
still wrong — this is missing knowledge, not broken parsing. The
|
| 264 |
-
single pretraining epoch, and supervised fine-tuning cannot add facts
|
| 265 |
-
learned. **Do not use this model for factual question answering, exams,
|
| 266 |
-
knowledge tasks.** TUMLU-Uzbek at 0.3286 is the only MCQ result above
|
| 267 |
-
700-item sample gives it a ±3.5% confidence interval.
|
| 268 |
-
|
| 269 |
-
**Uzbek → English translation is weak
|
| 270 |
-
BLEU 1.83 with a 1.229 length ratio and 12.5% unigram precision means the model
|
| 271 |
over-generates English that mostly does not match the reference. English → Uzbek is
|
| 272 |
usable (COMET 0.7397) but not competitive with dedicated translation systems.
|
| 273 |
|
|
@@ -281,8 +262,8 @@ output.** Loanwords and brand names inside Cyrillic text can come out mangled
|
|
| 281 |
Latin words. Cyrillic *chat* is coherent and does not degenerate, but Cyrillic
|
| 282 |
*orthography* is less reliable than Latin.
|
| 283 |
|
| 284 |
-
**Self-identification.** The identity training data
|
| 285 |
-
|
| 286 |
|
| 287 |
**News classification is uneven.** The "Oila va Jamiyat" (Family & Society) class scores
|
| 288 |
0.4273 across 14,012 items — a semantically diffuse catch-all the model handles poorly,
|
|
@@ -309,16 +290,16 @@ advice).
|
|
| 309 |
|
| 310 |
## License
|
| 311 |
|
| 312 |
-
Apache 2.0
|
| 313 |
-
|
| 314 |
|
| 315 |
## Citation
|
| 316 |
|
| 317 |
```bibtex
|
| 318 |
-
@misc{
|
| 319 |
-
title = {
|
| 320 |
author = {NeuronUz},
|
| 321 |
year = {2026},
|
| 322 |
-
url = {https://huggingface.co/NeuronUz/
|
| 323 |
}
|
| 324 |
```
|
|
|
|
| 10 |
- o'zbek
|
| 11 |
- chat
|
| 12 |
- instruction-tuned
|
|
|
|
| 13 |
library_name: transformers
|
| 14 |
---
|
| 15 |
|
| 16 |
+
# MustaqiLLM
|
| 17 |
|
| 18 |
+
MustaqiLLM is a 5.17-billion-parameter Uzbek **chat and text-classification model**. It
|
| 19 |
+
follows Uzbek instructions reliably, writes fluent Uzbek in both Latin and Cyrillic
|
| 20 |
+
script, and is strong on sentiment and news classification. It is **not** a knowledge
|
| 21 |
+
model: on multiple-choice knowledge benchmarks it performs at chance. Read the
|
|
|
|
|
|
|
|
|
|
| 22 |
[Evaluation](#evaluation) and [Limitations](#limitations) sections before using it —
|
| 23 |
they are specific about what works and what does not.
|
| 24 |
|
|
|
|
| 32 |
| Context length | 4096 tokens |
|
| 33 |
| Vocabulary | 48,000 (BPE) |
|
| 34 |
| Embeddings | untied |
|
| 35 |
+
| Weights dtype | bfloat16 (embeddings and `lm_head` stored fp32) |
|
| 36 |
| Languages | Uzbek (Latin + Cyrillic), English, Russian |
|
| 37 |
|
| 38 |
---
|
|
|
|
| 46 |
import torch
|
| 47 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 48 |
|
| 49 |
+
model_id = "NeuronUz/MustaqiLLM"
|
| 50 |
|
| 51 |
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
|
| 52 |
model = AutoModelForCausalLM.from_pretrained(
|
|
|
|
| 69 |
**inputs,
|
| 70 |
max_new_tokens=256,
|
| 71 |
do_sample=False, # greedy; see Generation settings below
|
| 72 |
+
eos_token_id=5, # <|im_end|> -- also the repo default
|
| 73 |
pad_token_id=3, # <pad>
|
| 74 |
)
|
| 75 |
|
|
|
|
| 100 |
|
| 101 |
| setting | value | why |
|
| 102 |
|---|---|---|
|
| 103 |
+
| `eos_token_id` | **5** (`<\|im_end\|>`) | The turn terminator, and already the default in `config.json` / `generation_config.json` — you do not need to pass it. Do **not** override it with the pretraining EOS (`</s>`), which never appears in chat data: generation would then run to `max_new_tokens`. |
|
| 104 |
+
| `do_sample` | `False` for classification/extraction; `True`, `temperature≈0.7`, `top_p≈0.9` for open chat | `generation_config.json` ships `do_sample: true` with no temperature or top_p set, so pass these explicitly. Every benchmark below was measured greedy. |
|
|
|
|
| 105 |
| `dtype` | `torch.bfloat16` | Trained in bf16. |
|
| 106 |
|
| 107 |
+
Memory: the checkpoint is 11.0 GB on disk (embeddings and `lm_head` are stored fp32); loading with
|
| 108 |
+
`dtype=torch.bfloat16` as above casts them down to ~10.3 GB of weights, so a single 16 GB GPU is
|
| 109 |
+
enough for inference.
|
| 110 |
+
|
| 111 |
+
`config.json` sets `use_cache: false`, but `generation_config.json` sets `use_cache: true`, so
|
| 112 |
+
`generate()` uses the KV cache. Pass `use_cache=True` explicitly if you write your own decode loop.
|
| 113 |
|
| 114 |
### Serving
|
| 115 |
|
|
|
|
| 125 |
|
| 126 |
## Training
|
| 127 |
|
| 128 |
+
MustaqiLLM is the instruction-following stage on top of an in-house 5.17 B Uzbek
|
| 129 |
+
pretrained model. The pretrained checkpoint completed a single pass over its corpus;
|
| 130 |
+
this stage is supervised fine-tuning only — no continued pretraining was performed.
|
| 131 |
|
| 132 |
| | |
|
| 133 |
|---|---|
|
|
|
|
| 156 |
retention slice. Third-person rubric-grading text was filtered out of the backbone
|
| 157 |
before training.
|
| 158 |
|
| 159 |
+
The Cyrillic and Russian slices exist because the pretrained model reads and writes Uzbek
|
| 160 |
Cyrillic *better* than Latin (bits-per-byte 0.2288 vs 0.3868) yet had almost no Cyrillic
|
| 161 |
chat behaviour attached to it, and because Russian-language instructions were nearly
|
| 162 |
absent. Checkpoint selection was done by running the full benchmark suite on all 12
|
|
|
|
| 177 |
| uzlib (Uzbek linguistic MCQ) | 1,861 | 0.2875 | 0.0000 |
|
| 178 |
| TUMLU-Uzbek (Uzbek MMLU) | 700 | 0.3286 | 0.0000 |
|
| 179 |
| MMLU-Uz (translated MMLU) | 14,042 | 0.2584 | 0.0000 |
|
| 180 |
+
| News topic classification (10-way, `risqaliyevds/uzbek-zero-shot-classification`) | 96,970 | **0.6531** | 0.0000 |
|
| 181 |
| Sentiment (binary) | 10,000 | **0.9259** | 0.0001 |
|
| 182 |
|
| 183 |
Random baselines: 0.25 for the 4-way MCQ tasks, 0.10 for news, 0.50 for sentiment.
|
|
|
|
| 209 |
| class | n | score |
|
| 210 |
|---|---:|---:|
|
| 211 |
| Sport | 16,113 | 0.8743 |
|
| 212 |
+
| Texnologiya (Technology) | 5,177 | 0.7309 |
|
| 213 |
+
| Madaniyat (Culture) | 2,405 | 0.7081 |
|
| 214 |
+
| Siyosat (Politics) | 29,500 | 0.6794 |
|
| 215 |
+
| Iqtisodiyot (Economy) | 10,755 | 0.6596 |
|
| 216 |
+
| Salomatlik (Health) | 3,505 | 0.6579 |
|
| 217 |
+
| Ta'lim (Education) | 1,987 | 0.6548 |
|
| 218 |
+
| Ekologiya (Ecology) | 1,784 | 0.5667 |
|
| 219 |
+
| Xorijiy Yangiliklar (World news) | 11,732 | 0.5124 |
|
| 220 |
| Oila va Jamiyat (Family & Society) | 14,012 | 0.4273 |
|
| 221 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 222 |
### Contamination check
|
| 223 |
|
| 224 |
44.1% of the sentiment evaluation set also appears in the training data, because the
|
|
|
|
| 242 |
**Multiple-choice knowledge tasks perform at chance.** uzlib, MMLU-Uz and MMLU-English
|
| 243 |
all sit within noise of their 0.25 random baseline, across roughly 30,000 questions.
|
| 244 |
Invalid rates near zero mean the model answers in the correct format every time and is
|
| 245 |
+
still wrong — this is missing knowledge, not broken parsing. The underlying pretrained
|
| 246 |
+
model completed a single pretraining epoch, and supervised fine-tuning cannot add facts
|
| 247 |
+
that were never learned. **Do not use this model for factual question answering, exams,
|
| 248 |
+
or retrieval-free knowledge tasks.** TUMLU-Uzbek at 0.3286 is the only MCQ result above
|
| 249 |
+
chance, and its 700-item sample gives it a ±3.5% confidence interval.
|
| 250 |
+
|
| 251 |
+
**Uzbek → English translation is weak.** BLEU 1.83 with a 1.229 length ratio and 12.5% unigram precision means the model
|
|
|
|
| 252 |
over-generates English that mostly does not match the reference. English → Uzbek is
|
| 253 |
usable (COMET 0.7397) but not competitive with dedicated translation systems.
|
| 254 |
|
|
|
|
| 262 |
Latin words. Cyrillic *chat* is coherent and does not degenerate, but Cyrillic
|
| 263 |
*orthography* is less reliable than Latin.
|
| 264 |
|
| 265 |
+
**Self-identification.** The identity training data predates the current name, so asked
|
| 266 |
+
who it is, the model answers "NeuronAI 5B" rather than "MustaqiLLM".
|
| 267 |
|
| 268 |
**News classification is uneven.** The "Oila va Jamiyat" (Family & Society) class scores
|
| 269 |
0.4273 across 14,012 items — a semantically diffuse catch-all the model handles poorly,
|
|
|
|
| 290 |
|
| 291 |
## License
|
| 292 |
|
| 293 |
+
Apache 2.0. Training data licensing follows the sources of the underlying public
|
| 294 |
+
datasets.
|
| 295 |
|
| 296 |
## Citation
|
| 297 |
|
| 298 |
```bibtex
|
| 299 |
+
@misc{mustaqillm,
|
| 300 |
+
title = {MustaqiLLM: an instruction-tuned Uzbek language model},
|
| 301 |
author = {NeuronUz},
|
| 302 |
year = {2026},
|
| 303 |
+
url = {https://huggingface.co/NeuronUz/MustaqiLLM}
|
| 304 |
}
|
| 305 |
```
|