Text Generation
Transformers
Safetensors
Uzbek
English
Russian
qwen3_5_text
qwen3.5
uzbek
conversational
translation
text-generation-inference
non-commercial
Instructions to use NeuronUz/NeuronAI-4B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use NeuronUz/NeuronAI-4B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="NeuronUz/NeuronAI-4B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("NeuronUz/NeuronAI-4B") model = AutoModelForCausalLM.from_pretrained("NeuronUz/NeuronAI-4B", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use NeuronUz/NeuronAI-4B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "NeuronUz/NeuronAI-4B" # 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/NeuronAI-4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/NeuronUz/NeuronAI-4B
- SGLang
How to use NeuronUz/NeuronAI-4B 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/NeuronAI-4B" \ --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/NeuronAI-4B", "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/NeuronAI-4B" \ --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/NeuronAI-4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use NeuronUz/NeuronAI-4B with Docker Model Runner:
docker model run hf.co/NeuronUz/NeuronAI-4B
Benchmarks: replace alloma-3B/1B with Llama-3.1-8B-Instruct-Uz and Mistral-7B-Instruct-Uz
Browse filesBoth behbudiy Uzbek instruct models evaluated on the same strict 8-task COMET-primary suite. Regenerated overall and per-task charts. Notes the 3% invalid-output gate failures (TUMLU 5.71% both; Mistral sentiment 4.59%).
- README.md +110 -16
- assets/overall_score.png +0 -0
- assets/tasks_comparison.png +0 -0
- benchmark_results.json +36 -36
README.md
CHANGED
|
@@ -130,6 +130,95 @@ curl http://localhost:8000/v1/chat/completions \
|
|
| 130 |
}'
|
| 131 |
```
|
| 132 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 133 |
## Benchmarks
|
| 134 |
|
| 135 |
All five model result sets below cover the same full eight-task suite.
|
|
@@ -140,23 +229,28 @@ invalid-output gate.
|
|
| 140 |
|
| 141 |

|
| 142 |
|
| 143 |
-
| Benchmark | Metric | Weight | **NeuronAI-4B** | Qwen3.5-4B | alloma-8B |
|
| 144 |
| --- | --- | ---: | ---: | ---: | ---: | ---: | ---: |
|
| 145 |
-
| UzLiB | accuracy | 0.20 | **61.20%** | 40.30% | 42.40% |
|
| 146 |
-
| TUMLU-Uzbek | accuracy | 0.20 | **45.00%** | 40.43% | 20.71% |
|
| 147 |
-
| FLORES+ en→uz | COMET | 0.15 | **0.8965** | 0.8555 | 0.8779 | 0.
|
| 148 |
-
| Uzbek news | accuracy | 0.10 | **79.15%** | 67.34% | 57.77% |
|
| 149 |
-
| MMLU English | accuracy | 0.10 | 64.06% | **72.66%** | 53.47% |
|
| 150 |
-
| MMLU Uzbek | accuracy | 0.10 | **57.01%** | 52.58% | 40.04% |
|
| 151 |
-
| FLORES+ uz→en | COMET | 0.05 | **0.8763** | 0.8618 | 0.8713 | 0.
|
| 152 |
-
| Uzbek sentiment | accuracy | 0.05 | **95.75%** | 84.82% | 79.94% |
|
| 153 |
-
| **Normalized weighted score** | | 1.00 | **0.6724** | 0.5978 | 0.5187 | 0.
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 160 |
|
| 161 |
### Run the benchmarks on your computer
|
| 162 |
|
|
|
|
| 130 |
}'
|
| 131 |
```
|
| 132 |
|
| 133 |
+
### Classification
|
| 134 |
+
|
| 135 |
+
For classification, the model works best as a constrained label picker: give the
|
| 136 |
+
label set in the prompt, ask for the label only, decode greedily, and cap
|
| 137 |
+
`max_new_tokens`. This is exactly the protocol used for the sentiment and news
|
| 138 |
+
benchmark scores below.
|
| 139 |
+
|
| 140 |
+
```python
|
| 141 |
+
import re
|
| 142 |
+
import torch
|
| 143 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 144 |
+
|
| 145 |
+
model_id = "NeuronUz/NeuronAI-4B"
|
| 146 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
| 147 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 148 |
+
model_id,
|
| 149 |
+
dtype=torch.bfloat16,
|
| 150 |
+
device_map={"": 0},
|
| 151 |
+
).eval()
|
| 152 |
+
|
| 153 |
+
LABELS = [
|
| 154 |
+
"Siyosat", "Iqtisodiyot", "Texnologiya", "Sport", "Madaniyat",
|
| 155 |
+
"Salomatlik", "Oila va Jamiyat", "Ta'lim", "Ekologiya", "Xorijiy Yangiliklar",
|
| 156 |
+
]
|
| 157 |
+
|
| 158 |
+
PROMPT = """Quyidagi o‘zbekcha yangilikni bitta toifaga ajrating. Faqat toifa raqamini yozing.
|
| 159 |
+
|
| 160 |
+
{labels}
|
| 161 |
+
|
| 162 |
+
Matn: {text}
|
| 163 |
+
|
| 164 |
+
Javob:"""
|
| 165 |
+
|
| 166 |
+
|
| 167 |
+
def classify(text: str) -> str:
|
| 168 |
+
prompt = PROMPT.format(
|
| 169 |
+
labels="\n".join(f"{i} - {name}" for i, name in enumerate(LABELS)),
|
| 170 |
+
text=text[:4000],
|
| 171 |
+
)
|
| 172 |
+
inputs = tokenizer.apply_chat_template(
|
| 173 |
+
[{"role": "user", "content": prompt}],
|
| 174 |
+
add_generation_prompt=True,
|
| 175 |
+
enable_thinking=False,
|
| 176 |
+
return_tensors="pt",
|
| 177 |
+
return_dict=True,
|
| 178 |
+
).to(model.device)
|
| 179 |
+
|
| 180 |
+
with torch.inference_mode():
|
| 181 |
+
output = model.generate(
|
| 182 |
+
**inputs,
|
| 183 |
+
max_new_tokens=8,
|
| 184 |
+
do_sample=False, # greedy: labels must be deterministic
|
| 185 |
+
)
|
| 186 |
+
|
| 187 |
+
raw = tokenizer.decode(
|
| 188 |
+
output[0, inputs["input_ids"].shape[1]:],
|
| 189 |
+
skip_special_tokens=True,
|
| 190 |
+
).strip()
|
| 191 |
+
match = re.search(r"\d+", raw)
|
| 192 |
+
return LABELS[int(match.group())] if match and int(match.group()) < len(LABELS) else raw
|
| 193 |
+
|
| 194 |
+
|
| 195 |
+
print(classify(
|
| 196 |
+
"O‘zbekiston Markaziy banki asosiy stavkani o‘zgarishsiz qoldirdi."
|
| 197 |
+
)) # -> Iqtisodiyot
|
| 198 |
+
```
|
| 199 |
+
|
| 200 |
+
Binary sentiment uses the same shape with a two-label set:
|
| 201 |
+
|
| 202 |
+
```python
|
| 203 |
+
SENTIMENT_PROMPT = (
|
| 204 |
+
"Quyidagi o‘zbekcha matnning kayfiyatini aniqlang: 'Ijobiy' yoki 'Salbiy'. "
|
| 205 |
+
"Faqat bitta yorliqni yozing.\n\nMatn: {text}\n\nYorliq:"
|
| 206 |
+
)
|
| 207 |
+
```
|
| 208 |
+
|
| 209 |
+
Notes that matter for accuracy:
|
| 210 |
+
|
| 211 |
+
- **Greedy decoding** (`do_sample=False`). The sampling preset in Quick start is
|
| 212 |
+
for open-ended chat; it adds label noise here.
|
| 213 |
+
- **`enable_thinking=False`** — a thinking block spends the token budget before
|
| 214 |
+
the label appears.
|
| 215 |
+
- **Small `max_new_tokens`** (8 is enough) plus a regex/prefix parser on the
|
| 216 |
+
output, so a stray word never becomes an invalid prediction.
|
| 217 |
+
- **Numbered labels** for many-class tasks: one digit is easier to emit and
|
| 218 |
+
parse than a multi-word category name.
|
| 219 |
+
- Keep prompt + text inside the 4,096-token serving limit; truncate long
|
| 220 |
+
articles (`text[:4000]` above).
|
| 221 |
+
|
| 222 |
## Benchmarks
|
| 223 |
|
| 224 |
All five model result sets below cover the same full eight-task suite.
|
|
|
|
| 229 |
|
| 230 |

|
| 231 |
|
| 232 |
+
| Benchmark | Metric | Weight | **NeuronAI-4B** | Qwen3.5-4B | alloma-8B | Llama-3.1-8B-Instruct-Uz | Mistral-7B-Instruct-Uz |
|
| 233 |
| --- | --- | ---: | ---: | ---: | ---: | ---: | ---: |
|
| 234 |
+
| UzLiB | accuracy | 0.20 | **61.20%** | 40.30% | 42.40% | 31.65% | 32.78% |
|
| 235 |
+
| TUMLU-Uzbek | accuracy | 0.20 | **45.00%** | 40.43% | 20.71% | 32.00% | 33.71% |
|
| 236 |
+
| FLORES+ en→uz | COMET | 0.15 | **0.8965** | 0.8555 | 0.8779 | 0.8667 | 0.8859 |
|
| 237 |
+
| Uzbek news | accuracy | 0.10 | **79.15%** | 67.34% | 57.77% | 60.34% | 62.09% |
|
| 238 |
+
| MMLU English | accuracy | 0.10 | 64.06% | **72.66%** | 53.47% | 47.58% | 29.50% |
|
| 239 |
+
| MMLU Uzbek | accuracy | 0.10 | **57.01%** | 52.58% | 40.04% | 38.72% | 35.06% |
|
| 240 |
+
| FLORES+ uz→en | COMET | 0.05 | **0.8763** | 0.8618 | 0.8713 | 0.7765 | 0.7826 |
|
| 241 |
+
| Uzbek sentiment | accuracy | 0.05 | **95.75%** | 84.82% | 79.94% | 82.59% | 80.83% |
|
| 242 |
+
| **Normalized weighted score** | | 1.00 | **0.6724** | 0.5978 | 0.5187 | 0.5095 | 0.4969 |
|
| 243 |
+
|
| 244 |
+
The alloma-8B run used the `APST` apostrophe preprocessing required by its model
|
| 245 |
+
card, and its column combines the full model-card-protocol evaluation with
|
| 246 |
+
separately archived full UzLiB, TUMLU-Uzbek, and MMLU-Uzbek runs. NeuronAI-4B,
|
| 247 |
+
stock Qwen, and both `behbudiy` Uzbek instruct models were evaluated by the same
|
| 248 |
+
strict COMET-primary suite without APST preprocessing. On the two `behbudiy`
|
| 249 |
+
models the suite's 3% invalid-output gate was exceeded on TUMLU-Uzbek (5.71% for
|
| 250 |
+
both) and, for Mistral-7B-Instruct-Uz, on sentiment (4.59%); those are
|
| 251 |
+
answer-format parse failures, so the affected task scores are a floor rather
|
| 252 |
+
than a ceiling. Exact source files, scores, and run IDs are included in
|
| 253 |
+
[`benchmark_results.json`](benchmark_results.json).
|
| 254 |
|
| 255 |
### Run the benchmarks on your computer
|
| 256 |
|
assets/overall_score.png
CHANGED
|
|
assets/tasks_comparison.png
CHANGED
|
|
benchmark_results.json
CHANGED
|
@@ -103,55 +103,55 @@
|
|
| 103 |
},
|
| 104 |
"normalized_weighted_score": 0.5186512896503792
|
| 105 |
},
|
| 106 |
-
"
|
| 107 |
-
"run_id": "
|
| 108 |
-
"suite_id": "
|
| 109 |
"tasks": {
|
| 110 |
-
"uzlib_slice_full": 0.
|
| 111 |
-
"tumlu_uzbek_full": 0.
|
| 112 |
-
"flores_en_uz_full": 0.
|
| 113 |
-
"news_full": 0.
|
| 114 |
-
"mmlu_english_full": 0.
|
| 115 |
-
"mmlu_uz_full": 0.
|
| 116 |
-
"flores_uz_en_full": 0.
|
| 117 |
-
"sentiment_binary_full": 0.
|
| 118 |
},
|
| 119 |
"invalid_rate": {
|
| 120 |
-
"uzlib_slice_full": 0.
|
| 121 |
-
"tumlu_uzbek_full": 0.
|
| 122 |
"flores_en_uz_full": null,
|
| 123 |
-
"news_full":
|
| 124 |
-
"mmlu_english_full": 0.
|
| 125 |
-
"mmlu_uz_full": 0.
|
| 126 |
"flores_uz_en_full": null,
|
| 127 |
-
"sentiment_binary_full": 0.
|
| 128 |
},
|
| 129 |
-
"normalized_weighted_score": 0.
|
| 130 |
},
|
| 131 |
-
"
|
| 132 |
-
"run_id": "
|
| 133 |
-
"suite_id": "
|
| 134 |
"tasks": {
|
| 135 |
-
"uzlib_slice_full": 0.
|
| 136 |
-
"tumlu_uzbek_full": 0.
|
| 137 |
-
"flores_en_uz_full": 0.
|
| 138 |
-
"news_full": 0.
|
| 139 |
-
"mmlu_english_full": 0.
|
| 140 |
-
"mmlu_uz_full": 0.
|
| 141 |
-
"flores_uz_en_full": 0.
|
| 142 |
-
"sentiment_binary_full": 0.
|
| 143 |
},
|
| 144 |
"invalid_rate": {
|
| 145 |
-
"uzlib_slice_full": 0.
|
| 146 |
-
"tumlu_uzbek_full": 0.
|
| 147 |
"flores_en_uz_full": null,
|
| 148 |
-
"news_full": 0.
|
| 149 |
-
"mmlu_english_full": 0.
|
| 150 |
-
"mmlu_uz_full": 0.
|
| 151 |
"flores_uz_en_full": null,
|
| 152 |
-
"sentiment_binary_full": 0.
|
| 153 |
},
|
| 154 |
-
"normalized_weighted_score": 0.
|
| 155 |
}
|
| 156 |
},
|
| 157 |
"checkpoints": {
|
|
|
|
| 103 |
},
|
| 104 |
"normalized_weighted_score": 0.5186512896503792
|
| 105 |
},
|
| 106 |
+
"Llama-3.1-8B-Instruct-Uz": {
|
| 107 |
+
"run_id": "strict_full_llama31_8b_instruct_uz",
|
| 108 |
+
"suite_id": "public_uzbek_full_comet_vllm_v2",
|
| 109 |
"tasks": {
|
| 110 |
+
"uzlib_slice_full": 0.31649650725416445,
|
| 111 |
+
"tumlu_uzbek_full": 0.32,
|
| 112 |
+
"flores_en_uz_full": 0.8666636186669038,
|
| 113 |
+
"news_full": 0.603372176961947,
|
| 114 |
+
"mmlu_english_full": 0.47578692493946734,
|
| 115 |
+
"mmlu_uz_full": 0.38719555618857715,
|
| 116 |
+
"flores_uz_en_full": 0.7764609643717557,
|
| 117 |
+
"sentiment_binary_full": 0.8259
|
| 118 |
},
|
| 119 |
"invalid_rate": {
|
| 120 |
+
"uzlib_slice_full": 0.0,
|
| 121 |
+
"tumlu_uzbek_full": 0.05714285714285714,
|
| 122 |
"flores_en_uz_full": null,
|
| 123 |
+
"news_full": 2.0624935547076414e-05,
|
| 124 |
+
"mmlu_english_full": 0.0037031761857285288,
|
| 125 |
+
"mmlu_uz_full": 0.009471585244267198,
|
| 126 |
"flores_uz_en_full": null,
|
| 127 |
+
"sentiment_binary_full": 0.0045
|
| 128 |
},
|
| 129 |
+
"normalized_weighted_score": 0.5095287981878477
|
| 130 |
},
|
| 131 |
+
"Mistral-7B-Instruct-Uz": {
|
| 132 |
+
"run_id": "strict_full_mistral7b_instruct_uz",
|
| 133 |
+
"suite_id": "public_uzbek_full_comet_vllm_v2",
|
| 134 |
"tasks": {
|
| 135 |
+
"uzlib_slice_full": 0.3277807630306287,
|
| 136 |
+
"tumlu_uzbek_full": 0.33714285714285713,
|
| 137 |
+
"flores_en_uz_full": 0.8859170079972982,
|
| 138 |
+
"news_full": 0.6209343095802825,
|
| 139 |
+
"mmlu_english_full": 0.294972226178607,
|
| 140 |
+
"mmlu_uz_full": 0.3505910838911836,
|
| 141 |
+
"flores_uz_en_full": 0.7826120569790223,
|
| 142 |
+
"sentiment_binary_full": 0.8083
|
| 143 |
},
|
| 144 |
"invalid_rate": {
|
| 145 |
+
"uzlib_slice_full": 0.011284255776464266,
|
| 146 |
+
"tumlu_uzbek_full": 0.05714285714285714,
|
| 147 |
"flores_en_uz_full": null,
|
| 148 |
+
"news_full": 0.0,
|
| 149 |
+
"mmlu_english_full": 0.025708588520153824,
|
| 150 |
+
"mmlu_uz_full": 0.01167924797037459,
|
| 151 |
"flores_uz_en_full": null,
|
| 152 |
+
"sentiment_binary_full": 0.0459
|
| 153 |
},
|
| 154 |
+
"normalized_weighted_score": 0.4969133053139477
|
| 155 |
}
|
| 156 |
},
|
| 157 |
"checkpoints": {
|