Text Generation
Transformers
Safetensors
qwen3
quata
quata2
qwen
reasoning
chain-of-thought
serbian
llm
mini-ai
4b
conversational
text-generation-inference
Instructions to use M1n1A1/MiniAI-Quata2-4b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use M1n1A1/MiniAI-Quata2-4b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="M1n1A1/MiniAI-Quata2-4b") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("M1n1A1/MiniAI-Quata2-4b") model = AutoModelForCausalLM.from_pretrained("M1n1A1/MiniAI-Quata2-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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use M1n1A1/MiniAI-Quata2-4b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "M1n1A1/MiniAI-Quata2-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": "M1n1A1/MiniAI-Quata2-4b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/M1n1A1/MiniAI-Quata2-4b
- SGLang
How to use M1n1A1/MiniAI-Quata2-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 "M1n1A1/MiniAI-Quata2-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": "M1n1A1/MiniAI-Quata2-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 "M1n1A1/MiniAI-Quata2-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": "M1n1A1/MiniAI-Quata2-4b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use M1n1A1/MiniAI-Quata2-4b with Docker Model Runner:
docker model run hf.co/M1n1A1/MiniAI-Quata2-4b
Release card: all benchmarks, Serbian eval, release video
Browse files- .gitattributes +2 -0
- README.md +105 -90
- assets/Quata2-4B-Release.mp4 +3 -0
- assets/serbian.png +3 -0
.gitattributes
CHANGED
|
@@ -45,3 +45,5 @@ assets/openbookqa.png filter=lfs diff=lfs merge=lfs -text
|
|
| 45 |
assets/piqa.png filter=lfs diff=lfs merge=lfs -text
|
| 46 |
assets/truthfulqa.png filter=lfs diff=lfs merge=lfs -text
|
| 47 |
assets/winogrande.png filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
| 45 |
assets/piqa.png filter=lfs diff=lfs merge=lfs -text
|
| 46 |
assets/truthfulqa.png filter=lfs diff=lfs merge=lfs -text
|
| 47 |
assets/winogrande.png filter=lfs diff=lfs merge=lfs -text
|
| 48 |
+
assets/Quata2-4B-Release.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 49 |
+
assets/serbian.png filter=lfs diff=lfs merge=lfs -text
|
README.md
CHANGED
|
@@ -1,74 +1,90 @@
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
| 3 |
base_model: Qwen/Qwen3-4B
|
|
|
|
|
|
|
| 4 |
language:
|
| 5 |
- en
|
| 6 |
- sr
|
| 7 |
- hr
|
| 8 |
- bs
|
| 9 |
-
pipeline_tag: text-generation
|
| 10 |
-
library_name: transformers
|
| 11 |
tags:
|
| 12 |
-
-
|
| 13 |
-
- miniai
|
| 14 |
- quata2
|
|
|
|
|
|
|
| 15 |
- reasoning
|
|
|
|
| 16 |
- serbian
|
|
|
|
|
|
|
|
|
|
| 17 |
---
|
| 18 |
|
| 19 |
-
# MiniAI Quata2
|
| 20 |
|
| 21 |
-
**
|
| 22 |
-
in Belgrade, Serbia. It is a fine-tune of [Qwen3-4B](https://huggingface.co/Qwen/Qwen3-4B)
|
| 23 |
-
and keeps Qwen3's switchable thinking mode, so it can answer directly or reason
|
| 24 |
-
step by step before answering.
|
| 25 |
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
|
| 30 |
## Benchmarks
|
| 31 |
|
| 32 |
-
|
| 33 |
-
500
|
| 34 |
-
multiple-choice tasks).
|
| 35 |
|
| 36 |
-
|
|
|
|
| 37 |
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
<img src="assets/gsm8k.png" width="32%" alt="GSM8K">
|
| 41 |
-
<img src="assets/mmlu.png" width="32%" alt="MMLU">
|
| 42 |
-
</p>
|
| 43 |
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
|
|
|
|
|
|
|
|
|
| 72 |
|---|---|---|---|
|
| 73 |
| ARC-Challenge | **54.8%** | 50.6% | 52.4% |
|
| 74 |
| ARC-Easy | **82.4%** | 78.4% | 78.2% |
|
|
@@ -78,45 +94,33 @@ questions per task, the same questions for every model.
|
|
| 78 |
| BoolQ | 84.4% | **85.4%** | 84.8% |
|
| 79 |
| OpenBookQA | **40.6%** | 40.4% | 40.2% |
|
| 80 |
| TruthfulQA (MC2) | **49.3%** | 47.4% | 46.0% |
|
| 81 |
-
|
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
|
|
|
| 89 |
|
| 90 |
-
###
|
| 91 |
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
them as directional rather than statistically precise:
|
| 95 |
|
| 96 |
-
| Check | Quata1.5 | Quata2
|
| 97 |
|---|---|---|
|
| 98 |
| Doesn't put every company in Belgrade | 45% | **100%** |
|
| 99 |
| Knows where companies are | 58% | **83%** |
|
| 100 |
| Facts about Serbia | 50% | **62%** |
|
| 101 |
-
|
|
| 102 |
-
| Knows who it is
|
| 103 |
| Thinking mode reaches the right answer | 80% | **90%** |
|
| 104 |
-
| Short replies to small talk | **100%** | 67% |
|
| 105 |
|
| 106 |
-
##
|
| 107 |
|
| 108 |
-
|
| 109 |
-
instruction-following personas (deduplicated, filtered for canned refusals
|
| 110 |
-
and foreign identity claims, decontaminated against the benchmarks above),
|
| 111 |
-
plus MiniAI identity data and reasoning traces distilled from Qwen3-4B
|
| 112 |
-
itself and verified for correct answers.
|
| 113 |
-
2. **DPO** on preference pairs built from the failures SFT could not fix
|
| 114 |
-
(identity questions, false premises, pushback).
|
| 115 |
-
3. **Weight blend** (WiSE-FT): the final weights are
|
| 116 |
-
`base + 0.8 Γ (fine-tuned β base)`, which recovered the instruction-following
|
| 117 |
-
that fine-tuning had cost while keeping the new behaviour.
|
| 118 |
-
|
| 119 |
-
## Usage
|
| 120 |
|
| 121 |
```python
|
| 122 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
|
@@ -127,22 +131,33 @@ model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype="auto", devic
|
|
| 127 |
|
| 128 |
messages = [{"role": "user", "content": "Ko te je napravio?"}]
|
| 129 |
prompt = tok.apply_chat_template(messages, tokenize=False, add_generation_prompt=True,
|
| 130 |
-
enable_thinking=False) # True =
|
| 131 |
-
|
| 132 |
-
|
|
|
|
| 133 |
```
|
| 134 |
|
| 135 |
-
Thinking mode
|
| 136 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 137 |
|
| 138 |
-
##
|
| 139 |
|
| 140 |
-
-
|
| 141 |
-
grammar and factual accuracy there are noticeably weaker than in English.
|
| 142 |
-
Better Balkan-language ability is the focus of our next models.
|
| 143 |
-
- Small-talk replies are sometimes longer than needed.
|
| 144 |
-
- Like any 4B model it can state wrong facts confidently; verify anything important.
|
| 145 |
|
| 146 |
-
##
|
| 147 |
|
| 148 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
| 3 |
base_model: Qwen/Qwen3-4B
|
| 4 |
+
pipeline_tag: text-generation
|
| 5 |
+
library_name: transformers
|
| 6 |
language:
|
| 7 |
- en
|
| 8 |
- sr
|
| 9 |
- hr
|
| 10 |
- bs
|
|
|
|
|
|
|
| 11 |
tags:
|
| 12 |
+
- quata
|
|
|
|
| 13 |
- quata2
|
| 14 |
+
- qwen3
|
| 15 |
+
- qwen
|
| 16 |
- reasoning
|
| 17 |
+
- chain-of-thought
|
| 18 |
- serbian
|
| 19 |
+
- llm
|
| 20 |
+
- mini-ai
|
| 21 |
+
- 4b
|
| 22 |
---
|
| 23 |
|
| 24 |
+
# MiniAI Quata2 (4B)
|
| 25 |
|
| 26 |
+
**Smarter, more honest, and it thinks before it speaks. 4 billion parameters.**
|
|
|
|
|
|
|
|
|
|
| 27 |
|
| 28 |
+
<video src="https://huggingface.co/M1n1A1/MiniAI-Quata2-4b/resolve/main/assets/Quata2-4B-Release.mp4" controls width="100%"></video>
|
| 29 |
+
|
| 30 |
+
Quata2 is the successor to Quata1.5: a compact 4B language model from MiniAI in
|
| 31 |
+
Belgrade, built on a Qwen3-4B foundation and rebuilt from the ground up to fix
|
| 32 |
+
everything Quata1.5 got wrong. It beats its own base model on 7 of 8 standard
|
| 33 |
+
benchmarks, thinks step by step with native Qwen3 reasoning, and stands its
|
| 34 |
+
ground when it's right β all in a package that fits on a single modest GPU or
|
| 35 |
+
runs entirely on your own hardware.
|
| 36 |
+
|
| 37 |
+
## Highlights
|
| 38 |
+
|
| 39 |
+
- **Beats Qwen3-4B** β wins 7 of 8 knowledge and common-sense benchmarks against its own base
|
| 40 |
+
- **Native thinking mode** β Qwen3 `<think>` reasoning, switch it on or off per message
|
| 41 |
+
- **Honest under pressure** β holds correct answers when pushed back on, owns real mistakes
|
| 42 |
+
- **Knows the Balkans** β better Serbian facts, no more putting every company in Belgrade
|
| 43 |
+
- **Speaks BCMS** β tops the Serbian LLM Eval among the 4B models we tested
|
| 44 |
+
- **100% on-device option** β nothing leaves your machine
|
| 45 |
|
| 46 |
## Benchmarks
|
| 47 |
|
| 48 |
+
Every number below was measured on the same harness, with the same questions,
|
| 49 |
+
for all three models: 500 questions per benchmark, zero-shot.
|
|
|
|
| 50 |
|
| 51 |
+
**ARC-Challenge** β hard grade-school science
|
| 52 |
+

|
| 53 |
|
| 54 |
+
**ARC-Easy** β grade-school science
|
| 55 |
+

|
|
|
|
|
|
|
|
|
|
| 56 |
|
| 57 |
+
**HellaSwag** β common-sense sentence completion
|
| 58 |
+

|
| 59 |
+
|
| 60 |
+
**Winogrande** β pronoun and common-sense reasoning
|
| 61 |
+

|
| 62 |
+
|
| 63 |
+
**PIQA** β physical common sense
|
| 64 |
+

|
| 65 |
+
|
| 66 |
+
**BoolQ** β yes/no reading comprehension
|
| 67 |
+

|
| 68 |
+
|
| 69 |
+
**OpenBookQA** β science facts plus reasoning
|
| 70 |
+

|
| 71 |
+
|
| 72 |
+
**TruthfulQA** β avoiding common misconceptions
|
| 73 |
+

|
| 74 |
+
|
| 75 |
+
**IFEval** β following precise instructions
|
| 76 |
+

|
| 77 |
+
|
| 78 |
+
**GSM8K** β grade-school maths
|
| 79 |
+

|
| 80 |
+
|
| 81 |
+
**MMLU** β knowledge across 57 subjects
|
| 82 |
+

|
| 83 |
+
|
| 84 |
+
**Serbian LLM Eval** β the same kind of tasks, in Serbian
|
| 85 |
+

|
| 86 |
+
|
| 87 |
+
| Benchmark | **MiniAI Quata2 (4B)** | Qwen3-4B (base) | MiniAI Quata1.5 (4B) |
|
| 88 |
|---|---|---|---|
|
| 89 |
| ARC-Challenge | **54.8%** | 50.6% | 52.4% |
|
| 90 |
| ARC-Easy | **82.4%** | 78.4% | 78.2% |
|
|
|
|
| 94 |
| BoolQ | 84.4% | **85.4%** | 84.8% |
|
| 95 |
| OpenBookQA | **40.6%** | 40.4% | 40.2% |
|
| 96 |
| TruthfulQA (MC2) | **49.3%** | 47.4% | 46.0% |
|
| 97 |
+
| IFEval (strict) | **71.4%** | 69.2% | 70.4% |
|
| 98 |
+
| GSM8K | 84.4% | **85.4%** | 76.2% |
|
| 99 |
+
| MMLU | **68.6%** | 66.8% | 67.8% |
|
| 100 |
+
| Serbian LLM Eval (avg of 7) | **50.7%** | 49.1% | 50.0% |
|
| 101 |
|
| 102 |
+
Quata2 leads on **10 of 12** benchmarks, beats its own Qwen3-4B base on the
|
| 103 |
+
knowledge and common-sense suite by **+2.4 points on average**, and jumps
|
| 104 |
+
**+8.2 points on GSM8K maths** over Quata1.5. That's the return you get from
|
| 105 |
+
fixing a model's flaws instead of papering over them.
|
| 106 |
|
| 107 |
+
### The fixes, measured
|
| 108 |
|
| 109 |
+
Quata2 was built specifically to fix Quata1.5's weak spots. Our own targeted
|
| 110 |
+
checks (small test sets, so read them as directional):
|
|
|
|
| 111 |
|
| 112 |
+
| Check | Quata1.5 | **Quata2** |
|
| 113 |
|---|---|---|
|
| 114 |
| Doesn't put every company in Belgrade | 45% | **100%** |
|
| 115 |
| Knows where companies are | 58% | **83%** |
|
| 116 |
| Facts about Serbia | 50% | **62%** |
|
| 117 |
+
| Holds correct answers under pushback, owns real mistakes | 67% | **100%** |
|
| 118 |
+
| Knows who it is, never claims to be ChatGPT | 90% | **100%** |
|
| 119 |
| Thinking mode reaches the right answer | 80% | **90%** |
|
|
|
|
| 120 |
|
| 121 |
+
## Get started
|
| 122 |
|
| 123 |
+
### Run it with Transformers
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 124 |
|
| 125 |
```python
|
| 126 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
|
|
|
| 131 |
|
| 132 |
messages = [{"role": "user", "content": "Ko te je napravio?"}]
|
| 133 |
prompt = tok.apply_chat_template(messages, tokenize=False, add_generation_prompt=True,
|
| 134 |
+
enable_thinking=False) # True = think step by step first
|
| 135 |
+
inputs = tok(prompt, return_tensors="pt").to(model.device)
|
| 136 |
+
out = model.generate(**inputs, max_new_tokens=512)
|
| 137 |
+
print(tok.decode(out[0][inputs.input_ids.shape[1]:], skip_special_tokens=True))
|
| 138 |
```
|
| 139 |
|
| 140 |
+
**Thinking mode:** `enable_thinking=True`, or put `/think` / `/no_think` in a
|
| 141 |
+
message. Give it room (2,000β4,000 new tokens) when it thinks.
|
| 142 |
+
|
| 143 |
+
### GGUF
|
| 144 |
+
|
| 145 |
+
- Soonβ’
|
| 146 |
|
| 147 |
+
## Hosted API
|
| 148 |
|
| 149 |
+
- Soonβ’
|
|
|
|
|
|
|
|
|
|
|
|
|
| 150 |
|
| 151 |
+
## Details
|
| 152 |
|
| 153 |
+
- **Architecture:** Qwen3-based, 4B parameters, 36 layers, hidden size 2560
|
| 154 |
+
- **Context length:** 40,960 tokens
|
| 155 |
+
- **Precision:** bfloat16 safetensors (~8 GB)
|
| 156 |
+
- **Training:** supervised fine-tune on ~108k curated conversations (OpenHermes-2.5,
|
| 157 |
+
Tulu-3 instruction following, MiniAI identity data, self-distilled verified
|
| 158 |
+
reasoning) β preference tuning (DPO) on Quata1.5's failure cases β weight blend
|
| 159 |
+
toward Qwen3-4B (WiSE-FT, Ξ» = 0.8) to keep the base model's strengths
|
| 160 |
+
- **Languages:** English first; Serbian, Croatian and Bosnian understood and spoken,
|
| 161 |
+
with grammar still behind English β better Balkan-language ability is the focus of
|
| 162 |
+
the next Quata models
|
| 163 |
+
- **License:** Apache 2.0 (base)
|
assets/Quata2-4B-Release.mp4
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b38dbc7363253654d2c62b124849b1f769589e29c233aea901b82d0f21c96936
|
| 3 |
+
size 26004338
|
assets/serbian.png
ADDED
|
Git LFS Details
|