初始化项目,由ModelHub XC社区提供模型

Model: kaushalkrishnax/auroic-router-0.6b
Source: Original Platform
This commit is contained in:
ModelHub XC
2026-05-28 22:44:23 +08:00
commit 1f86b0b64e
20 changed files with 16866 additions and 0 deletions

45
.gitattributes vendored Normal file
View File

@@ -0,0 +1,45 @@
*.7z filter=lfs diff=lfs merge=lfs -text
*.arrow filter=lfs diff=lfs merge=lfs -text
*.bin filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.ckpt filter=lfs diff=lfs merge=lfs -text
*.ftz filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.h5 filter=lfs diff=lfs merge=lfs -text
*.joblib filter=lfs diff=lfs merge=lfs -text
*.lfs.* filter=lfs diff=lfs merge=lfs -text
*.mlmodel filter=lfs diff=lfs merge=lfs -text
*.model filter=lfs diff=lfs merge=lfs -text
*.msgpack filter=lfs diff=lfs merge=lfs -text
*.npy filter=lfs diff=lfs merge=lfs -text
*.npz filter=lfs diff=lfs merge=lfs -text
*.onnx filter=lfs diff=lfs merge=lfs -text
*.ot filter=lfs diff=lfs merge=lfs -text
*.parquet filter=lfs diff=lfs merge=lfs -text
*.pb filter=lfs diff=lfs merge=lfs -text
*.pickle filter=lfs diff=lfs merge=lfs -text
*.pkl filter=lfs diff=lfs merge=lfs -text
*.pt filter=lfs diff=lfs merge=lfs -text
*.pth filter=lfs diff=lfs merge=lfs -text
*.rar filter=lfs diff=lfs merge=lfs -text
*.safetensors filter=lfs diff=lfs merge=lfs -text
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
*.tar.* filter=lfs diff=lfs merge=lfs -text
*.tar filter=lfs diff=lfs merge=lfs -text
*.tflite filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.wasm filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text
*tfevents* filter=lfs diff=lfs merge=lfs -text
gguf/auroic-router-0.6b.q8_0.gguf filter=lfs diff=lfs merge=lfs -text
tokenizer.json filter=lfs diff=lfs merge=lfs -text
gguf/auroic-router-0.6b.f16.gguf filter=lfs diff=lfs merge=lfs -text
gguf/auroic-router-0.6b.q2_k.gguf filter=lfs diff=lfs merge=lfs -text
gguf/auroic-router-0.6b.q3_k_m.gguf filter=lfs diff=lfs merge=lfs -text
gguf/auroic-router-0.6b.q4_0.gguf filter=lfs diff=lfs merge=lfs -text
gguf/auroic-router-0.6b.q4_k_m.gguf filter=lfs diff=lfs merge=lfs -text
gguf/auroic-router-0.6b.q5_0.gguf filter=lfs diff=lfs merge=lfs -text
gguf/auroic-router-0.6b.q5_k_m.gguf filter=lfs diff=lfs merge=lfs -text
gguf/auroic-router-0.6b.q6_k.gguf filter=lfs diff=lfs merge=lfs -text

18
Modelfile Normal file
View File

@@ -0,0 +1,18 @@
FROM ./auroic-router-0.6b.q8_0.gguf
SYSTEM """You are the Auroic Router. Given 5 chat messages, output exactly one routing decision in this format: R: TYPE=<text|media|react|acknowledge|translate|ignore> | TARGET=<M1|M2|M3|M4|M5|null> | EFFORT=<low|medium|high|null> | TITLE=<canonical_title>"""
TEMPLATE """<|im_start|>system
{{ .System }}<|im_end|>
<|im_start|>user
{{ .Prompt }} /think<|im_end|>
<|im_start|>assistant
"""
PARAMETER temperature 0.6
PARAMETER top_p 0.95
PARAMETER top_k 20
PARAMETER repeat_penalty 1.1
PARAMETER num_predict 60
PARAMETER stop "<|im_end|>"
PARAMETER stop "<|im_start|>"

274
README.md Normal file
View File

@@ -0,0 +1,274 @@
---
base_model: unsloth/Qwen3-0.6B
library_name: transformers
pipeline_tag: text-generation
tags:
- router
- intent-classification
- hinglish
- hindi
- qwen
- qwen3
- unsloth
- gguf
- ollama
- edge
- thinking
license: apache-2.0
language:
- en
- hi
---
# Auroic Router 0.6B
A compact, edge-deployable group chat routing model fine-tuned on Qwen3-0.6B. Given a 5-message history window and up to 3 unprocessed candidate messages, it outputs a single structured routing decision in under 4 seconds on CPU — no response generation, pure intent classification.
Part of the [Auroic](https://github.com/kaushalkrishnax/auroic) project — a personal AI assistant for Indian group and personal chats.
---
## What it does
The router sits at the front of a conversational AI pipeline. It reads the recent chat context and decides what action to take next — so downstream models only activate when actually needed.
```
H1: bhai sun
H2: kya hua bata
H3: okay
H4: arre
H5: haan bol
C1: ...
C2: ...
C3: bhai parents divorce ho raha hai adjust karna mushkil hai kya karoon
→ R: TYPE=text | TARGET=C3 | EFFORT=high
```
---
## Output Format
```
R: TYPE=text | TARGET=C2 | EFFORT=low|medium|high
R: TYPE=react | TARGET=C1 | TITLE=🔥
R: TYPE=media | TARGET=C3 | TITLE=rain cozy vibes
R: TYPE=ignore
```
| Type | When | Fields |
|------|------|--------|
| `text` | Help request, advice, emotional support, technical question | `EFFORT=low/medium/high` |
| `react` | Notable moment deserving an emoji reaction | `TITLE=<emoji>` |
| `media` | Situation implying a gif, meme, or sticker | `TITLE=<2-3 word search query>` |
| `ignore` | Pure noise, spam, keyboard smash, laughter chains | none |
---
## Input Format
```
H1: <message> ← oldest processed message
H2: <message>
H3: <message>
H4: <message>
H5: <message> ← most recent processed message
C1: <message> ← unprocessed candidate (use ... for filler)
C2: <message>
C3: <message> ← newest unprocessed candidate
```
Always provide exactly 5 history messages and 3 candidates. Use `...` for empty slots — never omit them.
---
## Quickstart — Ollama
```bash
ollama create auroic-router-0.6b -f Modelfile
ollama run auroic-router-0.6b
```
**Important — the router is stateless.** Every call must be a fresh context with no conversation history. In the Ollama CLI use `/clear` between calls. In production call the API directly:
```python
response = client.chat.completions.create(
model="auroic-router-0.6b",
messages=[
{"role": "system", "content": "You are the Auroic Router. Given history messages H1-H5 and candidate messages C1-C3, output exactly one routing decision."},
{"role": "user", "content": formatted_window} # fresh window every call
],
)
```
---
## Real Inference Examples
```
INPUT:
H1: lol H2: 😂😂 H3: haha H4: 💀 H5: ded
C1: hahaha C2: 😭😭 C3: ...
OUTPUT: R: TYPE=ignore
```
```
INPUT:
H1: sahi hai H2: haan bhai H3: okay H4: chal H5: theek hai
C1: ...
C2: bhai salary negotiate kaise karoon first time offer mein help
C3: ...
OUTPUT: R: TYPE=text | TARGET=C2 | EFFORT=medium
```
```
INPUT:
H1: bhai hungry hun H2: same yaar H3: kuch khate hain H4: haan H5: chal
C1: ... C2: ...
C3: bhai biryani ki yaad aa rahi hai mummy wali ghar ki bahut miss kar raha
OUTPUT: R: TYPE=media | TARGET=C3 | TITLE=biryani craving
```
```
INPUT:
H1: haha H2: bhai sach mein H3: lol H4: no way H5: 💀
C1: ...
C2: teacher ne galti se apna tiktok projector pe chala diya class mein
C3: ...
OUTPUT: R: TYPE=media | TARGET=C2 | TITLE=tiktok projector fail
```
```
INPUT:
H1: bhai sun H2: haan H3: bata H4: okay H5: hmm
C1: ...
C2: @BOT yaar dost ne 3 baje uthke help kiya exam ke liye true friendship hai
C3: ...
OUTPUT: R: TYPE=react | TARGET=C2 | TITLE=❤
```
---
## Thinking Mode
The model uses Qwen3's native thinking capability. For ambiguous inputs it reasons through the context before deciding:
```
<think>
H1-H5 are casual affirmations. C2 asks 'salary negotiate kaise karoon first time' —
clear, actionable life advice needed. Text with medium effort because it requires
step-by-step guidance, not just emojis or media.
</think>
R: TYPE=text | TARGET=C2 | EFFORT=medium
```
For obvious cases (clear ignore, clear media) it skips thinking entirely and outputs the decision directly — keeping latency low where reasoning isn't needed.
**Thinking enabled (default):** better accuracy on ambiguous cases, ~3-4s on CPU
**Thinking disabled:** faster, minor accuracy drop on edge cases
To disable thinking add this to your Modelfile template:
```
<|im_start|>assistant
<think>
</think>
```
---
## Recommended Inference Settings
```
temperature 0.3 (deterministic routing)
top_p 0.95
top_k 20
repeat_penalty 1.1
```
---
## Model Details
| Property | Value |
|----------|-------|
| Base model | unsloth/Qwen3-0.6B |
| Total parameters | 616M |
| Trainable parameters | 20.2M (3.28%) |
| Fine-tuning framework | Unsloth + TRL SFTTrainer |
| LoRA rank | r=32, alpha=32 |
| Target modules | q/k/v/o/gate/up/down proj |
| Epochs | 2 |
| Effective batch size | 16 (batch=2, grad_accum=8) |
| Learning rate | 2e-4 cosine |
| Max sequence length | 2048 |
| Training samples | 9,300 |
| Final training loss | 0.667 |
| Quantization | Q8_0 GGUF |
| Hardware trained on | NVIDIA T4 16GB (Google Colab) |
| Training time | ~44 minutes |
---
## Dataset — v4
9,300 samples of Indian group chat routing scenarios:
| Split | Count |
|-------|-------|
| Normal windows | 7,000 |
| @BOT mention windows | 1,500 |
| Filler/sparse windows | 800 |
| Type | Count | % |
|------|-------|---|
| text | 4,042 | 43.5% |
| ignore | 1,942 | 20.9% |
| react | 1,688 | 18.2% |
| media | 1,628 | 17.5% |
Language distribution: 58.8% Hinglish, 23% English, 18.2% mixed
Think blocks annotated by `qwen/qwen3-next-80b-a3b-instruct` on NVIDIA NIM — hard tier (39.3%) gets full reasoning, medium tier (32.8%) gets short reasoning, easy tier (27.8%) gets no think block.
Dataset and generation pipeline: [github.com/kaushalkrishnax/auroic-router](https://github.com/kaushalkrishnax/auroic-router)
---
## Performance
| Metric | Value |
|--------|-------|
| Warm inference (CPU) | ~2-3 seconds |
| Cold start | ~5 seconds |
| Hardware tested | Intel i3-6100U 2.3GHz, 12GB DDR4 |
| Format compliance | 100% on test set |
---
## Known Limitations
- Optimized for Hinglish and Indian English group chat patterns
- Stateless by design — do not pass conversation history between calls
- Not designed for factual QA, coding assistance, or long-form generation
---
## License
Apache-2.0 — inherits from Qwen3 base model.
---
## Author
**Kaushal Krishna**
- GitHub: [kaushalkrishnax](https://github.com/kaushalkrishnax)
- Project: [github.com/kaushalkrishnax/auroic](https://github.com/kaushalkrishnax/auroic)
- Router research: [github.com/kaushalkrishnax/auroic-router](https://github.com/kaushalkrishnax/auroic-router)

99
chat_template.jinja Normal file
View File

@@ -0,0 +1,99 @@
{%- if tools %}
{{- '<|im_start|>system\n' }}
{%- if messages[0].role == 'system' %}
{{- messages[0].content + '\n\n' }}
{%- endif %}
{{- "# Tools\n\nYou may call one or more functions to assist with the user query.\n\nYou are provided with function signatures within <tools></tools> XML tags:\n<tools>" }}
{%- for tool in tools %}
{{- "\n" }}
{{- tool | tojson }}
{%- endfor %}
{{- "\n</tools>\n\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\n<tool_call>\n{\"name\": <function-name>, \"arguments\": <args-json-object>}\n</tool_call><|im_end|>\n" }}
{%- else %}
{%- if messages[0].role == 'system' %}
{{- '<|im_start|>system\n' + messages[0].content + '<|im_end|>\n' }}
{%- endif %}
{%- endif %}
{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
{%- for forward_message in messages %}
{%- set index = (messages|length - 1) - loop.index0 %}
{%- set message = messages[index] %}
{%- set current_content = message.content if message.content is defined and message.content is not none else '' %}
{%- set tool_start = '<tool_response>' %}
{%- set tool_start_length = tool_start|length %}
{%- set start_of_message = current_content[:tool_start_length] %}
{%- set tool_end = '</tool_response>' %}
{%- set tool_end_length = tool_end|length %}
{%- set start_pos = (current_content|length) - tool_end_length %}
{%- if start_pos < 0 %}
{%- set start_pos = 0 %}
{%- endif %}
{%- set end_of_message = current_content[start_pos:] %}
{%- if ns.multi_step_tool and message.role == "user" and not(start_of_message == tool_start and end_of_message == tool_end) %}
{%- set ns.multi_step_tool = false %}
{%- set ns.last_query_index = index %}
{%- endif %}
{%- endfor %}
{%- for message in messages %}
{%- if (message.role == "user") or (message.role == "system" and not loop.first) %}
{{- '<|im_start|>' + message.role + '\n' + message.content + '<|im_end|>' + '\n' }}
{%- elif message.role == "assistant" %}
{%- set m_content = message.content if message.content is defined and message.content is not none else '' %}
{%- set content = m_content %}
{%- set reasoning_content = '' %}
{%- if message.reasoning_content is defined and message.reasoning_content is not none %}
{%- set reasoning_content = message.reasoning_content %}
{%- else %}
{%- if '</think>' in m_content %}
{%- set content = (m_content.split('</think>')|last).lstrip('\n') %}
{%- set reasoning_content = (m_content.split('</think>')|first).rstrip('\n') %}
{%- set reasoning_content = (reasoning_content.split('<think>')|last).lstrip('\n') %}
{%- endif %}
{%- endif %}
{%- if loop.index0 > ns.last_query_index %}
{%- if loop.last or (not loop.last and (not reasoning_content.strip() == '')) %}
{{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content.strip('\n') + '\n</think>\n\n' + content.lstrip('\n') }}
{%- else %}
{{- '<|im_start|>' + message.role + '\n' + content }}
{%- endif %}
{%- else %}
{{- '<|im_start|>' + message.role + '\n' + content }}
{%- endif %}
{%- if message.tool_calls %}
{%- for tool_call in message.tool_calls %}
{%- if (loop.first and content) or (not loop.first) %}
{{- '\n' }}
{%- endif %}
{%- if tool_call.function %}
{%- set tool_call = tool_call.function %}
{%- endif %}
{{- '<tool_call>\n{"name": "' }}
{{- tool_call.name }}
{{- '", "arguments": ' }}
{%- if tool_call.arguments is string %}
{{- tool_call.arguments }}
{%- else %}
{{- tool_call.arguments | tojson }}
{%- endif %}
{{- '}\n</tool_call>' }}
{%- endfor %}
{%- endif %}
{{- '<|im_end|>\n' }}
{%- elif message.role == "tool" %}
{%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}
{{- '<|im_start|>user' }}
{%- endif %}
{{- '\n<tool_response>\n' }}
{{- message.content }}
{{- '\n</tool_response>' }}
{%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}
{{- '<|im_end|>\n' }}
{%- endif %}
{%- endif %}
{%- endfor %}
{%- if add_generation_prompt %}
{{- '<|im_start|>assistant\n' }}
{%- if enable_thinking is defined and enable_thinking is false %}
{{- '<think>\n\n</think>\n\n' }}
{%- endif %}
{%- endif %}

64
config.json Normal file
View File

@@ -0,0 +1,64 @@
{
"architectures": [
"Qwen3ForCausalLM"
],
"attention_bias": false,
"attention_dropout": 0.0,
"bos_token_id": null,
"torch_dtype": "float16",
"eos_token_id": 151645,
"head_dim": 128,
"hidden_act": "silu",
"hidden_size": 1024,
"initializer_range": 0.02,
"intermediate_size": 3072,
"layer_types": [
"full_attention",
"full_attention",
"full_attention",
"full_attention",
"full_attention",
"full_attention",
"full_attention",
"full_attention",
"full_attention",
"full_attention",
"full_attention",
"full_attention",
"full_attention",
"full_attention",
"full_attention",
"full_attention",
"full_attention",
"full_attention",
"full_attention",
"full_attention",
"full_attention",
"full_attention",
"full_attention",
"full_attention",
"full_attention",
"full_attention",
"full_attention",
"full_attention"
],
"max_position_embeddings": 40960,
"max_window_layers": 28,
"model_type": "qwen3",
"num_attention_heads": 16,
"num_hidden_layers": 28,
"num_key_value_heads": 8,
"pad_token_id": 151669,
"rms_norm_eps": 1e-06,
"rope_parameters": {
"rope_theta": 1000000,
"rope_type": "default"
},
"sliding_window": null,
"tie_word_embeddings": true,
"unsloth_fixed": true,
"unsloth_version": "2026.3.4",
"use_cache": false,
"use_sliding_window": false,
"vocab_size": 151936
}

7000
dataset/dataset_v3.jsonl Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

17
gguf/Modelfile Normal file
View File

@@ -0,0 +1,17 @@
FROM ./auroic-router-0.6b.q8_0.gguf
SYSTEM """You are the Auroic Router. Given history messages H1-H5 and candidate messages C1-C3, output exactly one routing decision."""
TEMPLATE """<|im_start|>system
{{ .System }}<|im_end|>
<|im_start|>user
{{ .Prompt }}<|im_end|>
<|im_start|>assistant
"""
PARAMETER temperature 0.3
PARAMETER top_p 0.95
PARAMETER top_k 20
PARAMETER repeat_penalty 1.1
PARAMETER stop "<|im_end|>"
PARAMETER stop "<|im_start|>"

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e2f1642a67d842ce982e6c5c436f49e6462e3f127d2ff6bd54ef0a7ae0736f60
size 1198182656

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1cf18ac27f41cfd4d6642f15ee98da7b79152d11165d0ed856fcc8b1af2c0418
size 296238336

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9e9ee644201c3c7556562034091408bbca0883406967662a79091c82b09ed30a
size 347127040

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c4e4c1b05d47d8242122d5f6f5e1f8a1f417d97536150e7c0aaf6ff3673d2150
size 381566208

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8461176ecad96d92e4fb6144d4727d17017a8f28af16bba1aedcee9163ae16f8
size 396705024

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:856cb5f3b59fda46758e9bc5724e985cb8e83c29e0ad83334c28d2e4ff6b8c03
size 436616448

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f72ac0683c01a18e7c63f0a96392b584a7c8739652348f1d5208e53fe23d5378
size 444415232

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:aba808917fef95211a376e0cceb3e359eee71d4fc18d1cfd86f55cd4ff4a124a
size 495107328

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:09c13d89d116464cab3c91839e1c6ef3e9c5a243513017a3b288254daeb1962c
size 639447296

3
model.safetensors Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:14ff9998f06cbb33edb9f1c8f1c8ecec0442f47e080eb0aa406d9ec0dbe1924a
size 1192135096

3
tokenizer.json Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d7430e9138b76e93fb6f93462394d236b411111aef53cb421ba97d2691040cca
size 11423114

16
tokenizer_config.json Normal file

File diff suppressed because one or more lines are too long