azaiats commited on
Commit
fa62872
·
verified ·
1 Parent(s): 4a3617a

Upload folder using huggingface_hub

Browse files
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ tokenizer.json filter=lfs diff=lfs merge=lfs -text
README.md CHANGED
@@ -1,3 +1,152 @@
1
  ---
2
  license: apache-2.0
 
 
 
 
 
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: apache-2.0
3
+ base_model: Qwen/Qwen2.5-Coder-1.5B-Instruct
4
+ language:
5
+ - en
6
+ pipeline_tag: text-generation
7
+ tags:
8
+ - router
9
+ - prompt-router
10
+ - structured-output
11
+ - json
12
+ - code
13
+ - qwen2.5-coder
14
+ - gguf
15
  ---
16
+
17
+ # DevRouter-1.5B
18
+
19
+ **A tiny, fast router that turns a raw developer prompt into a single structured JSON decision.**
20
+
21
+ DevRouter-1.5B reads a raw coding prompt and returns one JSON object that (1) rewrites the prompt
22
+ into a cleaner version, (2) classifies its **intent**, **complexity**, and a suggested **route**
23
+ (which model tier to send it to), and (3) flags **missing context** the developer should have
24
+ included. It is meant to sit *in front of* your expensive models and make a cheap, deterministic
25
+ triage call in ~1–3 seconds on a single consumer GPU.
26
+
27
+ It is a fine-tune of **Qwen2.5-Coder-1.5B-Instruct** (Apache 2.0), distilled on a dataset of
28
+ developer prompts labelled by a stronger teacher model.
29
+
30
+ ## Output schema
31
+
32
+ Every response is a single JSON object with exactly these five fields:
33
+
34
+ | field | type | values |
35
+ |---|---|---|
36
+ | `rewrite` | string | a clearer version of the prompt, preserving the original intent |
37
+ | `intent` | enum | `debug` · `refactor` · `feature` · `explain` · `documentation` · `boilerplate` · `architecture` · `review` · `optimize` · `other` |
38
+ | `complexity` | enum | `low` · `medium` · `high` |
39
+ | `route` | enum | `small_local` · `medium_api` · `large_api` |
40
+ | `missing` | array of strings | context the prompt should have included (empty if nothing) |
41
+
42
+ ### Example
43
+
44
+ **Input (user message):**
45
+ > My Flask app 500s on POST /upload with RequestEntityTooLarge, how do I fix it?
46
+
47
+ **Output:**
48
+ ```json
49
+ {
50
+ "rewrite": "I'm encountering a 500 Internal Server Error on my Flask app when handling POST /upload. The error is 'RequestEntityTooLarge'. How can I resolve this issue?",
51
+ "intent": "debug",
52
+ "complexity": "low",
53
+ "route": "small_local",
54
+ "missing": ["Flask version", "Python version"]
55
+ }
56
+ ```
57
+
58
+ ## Quick start
59
+
60
+ The router system prompt is **baked into the model's chat template**, so you do not need to supply a
61
+ system prompt — just send the raw developer prompt as the user message.
62
+
63
+ ### Ollama
64
+ ```bash
65
+ # from the -GGUF repo (Modelfile + DevRouter-1.5B-Q8_0.gguf)
66
+ ollama create devrouter -f Modelfile
67
+ ollama run devrouter "refactor this giant function into smaller ones"
68
+ ```
69
+
70
+ ### llama.cpp
71
+ ```bash
72
+ llama-server -m DevRouter-1.5B-Q8_0.gguf -c 8192 -ngl 99 --parallel 1
73
+ # then POST to /v1/chat/completions with just a user message, temperature 0
74
+ ```
75
+
76
+ ### Transformers
77
+ ```python
78
+ from transformers import AutoModelForCausalLM, AutoTokenizer
79
+ tok = AutoTokenizer.from_pretrained("aipster/DevRouter-1.5B")
80
+ model = AutoModelForCausalLM.from_pretrained("aipster/DevRouter-1.5B")
81
+ msgs = [{"role": "user", "content": "write a FastAPI POST /items endpoint with a Pydantic model"}]
82
+ inputs = tok.apply_chat_template(msgs, add_generation_prompt=True, return_tensors="pt")
83
+ out = model.generate(inputs, max_new_tokens=1408, do_sample=False)
84
+ print(tok.decode(out[0][inputs.shape[1]:], skip_special_tokens=True))
85
+ ```
86
+
87
+ Use **greedy decoding (`temperature=0`)** for stable, parseable JSON.
88
+
89
+ ## Evaluation
90
+
91
+ Evaluated on a held-out, intent-stratified validation split (`val`, in-distribution) and an
92
+ out-of-distribution split (`holdout`, no GitHub-issue sources). Metrics: rate of valid JSON
93
+ (strict schema parse) and accuracy of `intent` / `route` / `complexity` against the teacher labels.
94
+
95
+ | metric | fp16 (val / holdout) | Q8_0 GGUF (val / holdout) |
96
+ |---|---|---|
97
+ | JSON validity | 0.973 / 0.955 | 0.965 / 0.946 |
98
+ | intent accuracy | 0.708 / 0.613 | 0.665 / 0.586 |
99
+ | route accuracy | 0.739 / 0.604 | 0.719 / 0.631 |
100
+ | complexity accuracy | 0.719 / 0.685 | 0.708 / 0.676 |
101
+
102
+ Per-intent accuracy (Q8_0, val):
103
+
104
+ | intent | acc | intent | acc |
105
+ |---|---|---|---|
106
+ | debug | 0.82 | architecture | 0.72 |
107
+ | refactor | 0.72 | documentation | 0.56 |
108
+ | explain | 0.73 | boilerplate | 0.64 |
109
+ | feature | 0.58 | review | 0.43 |
110
+ | optimize | 0.50 | | |
111
+
112
+ ## Performance
113
+
114
+ Single RTX 3090, Q8_0 GGUF via llama.cpp (single stream):
115
+
116
+ - **Generation: ~280 tokens/s** (~3.6 ms/token, constant across output lengths)
117
+ - **Prompt eval (prefill): ~10,000–13,000 tokens/s**
118
+ - **Latency per routing call: ~1–3 s** (up to ~5 s for the longest outputs)
119
+
120
+ Throughput scales further with batching/concurrency.
121
+
122
+ ## Limitations
123
+
124
+ - **No PII detection.** An earlier schema included a PII flag; it was removed from v1.1 because the
125
+ training data had too few PII-positive examples (~2.4%) to learn it reliably. Do **not** use this
126
+ model for privacy/safety filtering. (Planned for a future data-focused release.)
127
+ - **Weaker on rare intents.** `review` and `documentation` are under-represented and noisier in the
128
+ training data, and accuracy on them is lower.
129
+ - **Source bias / OOD gap.** Training prompts skew heavily toward GitHub-issue-style text, so intent
130
+ accuracy drops ~10 points on out-of-distribution prompts. Treat `route`/`complexity` as advisory.
131
+ - **Quantization sensitivity.** This is a small model doing strict structured output. **Q6_K and
132
+ below break the JSON** (validity collapses); ship **Q8_0** or **F16** only. Always validate a
133
+ quant before relying on it.
134
+
135
+ ## Training
136
+
137
+ - **Base:** Qwen2.5-Coder-1.5B-Instruct (Apache 2.0)
138
+ - **Method:** QLoRA (4-bit), rank 16, 2 epochs, effective batch 16, `train_on_responses_only`
139
+ - **Data:** ~2.6k developer prompts, each labelled by a stronger teacher model into the 5-field
140
+ schema, filtered by a judge model and capped per intent. Distillation sources permit training and
141
+ open release of derived weights.
142
+
143
+ ## Intended use
144
+
145
+ Pre-routing / triage of developer prompts in an LLM application: rewriting, intent/complexity
146
+ classification, and model-tier selection. **Not** intended for safety filtering, PII detection, or
147
+ as a general assistant.
148
+
149
+ ## License
150
+
151
+ Apache 2.0, inherited from the base model. You are free to use, modify, and redistribute, including
152
+ commercially.
added_tokens.json ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "</tool_call>": 151658,
3
+ "<tool_call>": 151657,
4
+ "<|PAD_TOKEN|>": 151665,
5
+ "<|box_end|>": 151649,
6
+ "<|box_start|>": 151648,
7
+ "<|endoftext|>": 151643,
8
+ "<|file_sep|>": 151664,
9
+ "<|fim_middle|>": 151660,
10
+ "<|fim_pad|>": 151662,
11
+ "<|fim_prefix|>": 151659,
12
+ "<|fim_suffix|>": 151661,
13
+ "<|im_end|>": 151645,
14
+ "<|im_start|>": 151644,
15
+ "<|image_pad|>": 151655,
16
+ "<|object_ref_end|>": 151647,
17
+ "<|object_ref_start|>": 151646,
18
+ "<|quad_end|>": 151651,
19
+ "<|quad_start|>": 151650,
20
+ "<|repo_name|>": 151663,
21
+ "<|video_pad|>": 151656,
22
+ "<|vision_end|>": 151653,
23
+ "<|vision_pad|>": 151654,
24
+ "<|vision_start|>": 151652
25
+ }
chat_template.jinja ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {%- if tools %}
2
+ {{- '<|im_start|>system\n' }}
3
+ {%- if messages[0]['role'] == 'system' %}
4
+ {{- messages[0]['content'] }}
5
+ {%- else %}
6
+ {{- 'You are a coding prompt router. You receive raw developer prompts and return a single JSON object with these fields:\n\n- rewrite (string): Clearer version of the prompt, preserving original intent. Do not invent requirements not present in the source.\n- intent (enum): debug | refactor | feature | explain | documentation | boilerplate | architecture | review | optimize | other\n- complexity (enum): low | medium | high\n- route (enum): small_local | medium_api | large_api\n- missing (array of strings): Context the developer should have included but didn\'t. Empty array if nothing is missing.\n\nReturn ONLY valid JSON. No prose outside the JSON.' }}
7
+ {%- endif %}
8
+ {{- "\n\n# 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>" }}
9
+ {%- for tool in tools %}
10
+ {{- "\n" }}
11
+ {{- tool | tojson }}
12
+ {%- endfor %}
13
+ {{- "\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" }}
14
+ {%- else %}
15
+ {%- if messages[0]['role'] == 'system' %}
16
+ {{- '<|im_start|>system\n' + messages[0]['content'] + '<|im_end|>\n' }}
17
+ {%- else %}
18
+ {{- '<|im_start|>system\nYou are a coding prompt router. You receive raw developer prompts and return a single JSON object with these fields:\n\n- rewrite (string): Clearer version of the prompt, preserving original intent. Do not invent requirements not present in the source.\n- intent (enum): debug | refactor | feature | explain | documentation | boilerplate | architecture | review | optimize | other\n- complexity (enum): low | medium | high\n- route (enum): small_local | medium_api | large_api\n- missing (array of strings): Context the developer should have included but didn\'t. Empty array if nothing is missing.\n\nReturn ONLY valid JSON. No prose outside the JSON.<|im_end|>\n' }}
19
+ {%- endif %}
20
+ {%- endif %}
21
+ {%- for message in messages %}
22
+ {%- if (message.role == "user") or (message.role == "system" and not loop.first) or (message.role == "assistant" and not message.tool_calls) %}
23
+ {{- '<|im_start|>' + message.role + '\n' + message.content + '<|im_end|>' + '\n' }}
24
+ {%- elif message.role == "assistant" %}
25
+ {{- '<|im_start|>' + message.role }}
26
+ {%- if message.content %}
27
+ {{- '\n' + message.content }}
28
+ {%- endif %}
29
+ {%- for tool_call in message.tool_calls %}
30
+ {%- if tool_call.function is defined %}
31
+ {%- set tool_call = tool_call.function %}
32
+ {%- endif %}
33
+ {{- '\n<tool_call>\n{"name": "' }}
34
+ {{- tool_call.name }}
35
+ {{- '", "arguments": ' }}
36
+ {{- tool_call.arguments | tojson }}
37
+ {{- '}\n</tool_call>' }}
38
+ {%- endfor %}
39
+ {{- '<|im_end|>\n' }}
40
+ {%- elif message.role == "tool" %}
41
+ {%- if (loop.index0 == 0) or (messages[loop.index0 - 1].role != "tool") %}
42
+ {{- '<|im_start|>user' }}
43
+ {%- endif %}
44
+ {{- '\n<tool_response>\n' }}
45
+ {{- message.content }}
46
+ {{- '\n</tool_response>' }}
47
+ {%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}
48
+ {{- '<|im_end|>\n' }}
49
+ {%- endif %}
50
+ {%- endif %}
51
+ {%- endfor %}
52
+ {%- if add_generation_prompt %}
53
+ {{- '<|im_start|>assistant\n' }}
54
+ {%- endif %}
config.json ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "Qwen2ForCausalLM"
4
+ ],
5
+ "attention_dropout": 0.0,
6
+ "bos_token_id": 151643,
7
+ "torch_dtype": "bfloat16",
8
+ "eos_token_id": 151645,
9
+ "hidden_act": "silu",
10
+ "hidden_size": 1536,
11
+ "initializer_range": 0.02,
12
+ "intermediate_size": 8960,
13
+ "layer_types": [
14
+ "full_attention",
15
+ "full_attention",
16
+ "full_attention",
17
+ "full_attention",
18
+ "full_attention",
19
+ "full_attention",
20
+ "full_attention",
21
+ "full_attention",
22
+ "full_attention",
23
+ "full_attention",
24
+ "full_attention",
25
+ "full_attention",
26
+ "full_attention",
27
+ "full_attention",
28
+ "full_attention",
29
+ "full_attention",
30
+ "full_attention",
31
+ "full_attention",
32
+ "full_attention",
33
+ "full_attention",
34
+ "full_attention",
35
+ "full_attention",
36
+ "full_attention",
37
+ "full_attention",
38
+ "full_attention",
39
+ "full_attention",
40
+ "full_attention",
41
+ "full_attention"
42
+ ],
43
+ "max_position_embeddings": 32768,
44
+ "max_window_layers": 21,
45
+ "model_type": "qwen2",
46
+ "num_attention_heads": 12,
47
+ "num_hidden_layers": 28,
48
+ "num_key_value_heads": 2,
49
+ "pad_token_id": 151665,
50
+ "rms_norm_eps": 1e-06,
51
+ "rope_scaling": null,
52
+ "rope_theta": 1000000.0,
53
+ "sliding_window": null,
54
+ "tie_word_embeddings": true,
55
+ "unsloth_fixed": true,
56
+ "unsloth_version": "2026.5.9",
57
+ "use_cache": true,
58
+ "use_sliding_window": false,
59
+ "vocab_size": 151936
60
+ }
generation_config.json ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token_id": 151643,
3
+ "do_sample": true,
4
+ "eos_token_id": [
5
+ 151645,
6
+ 151643
7
+ ],
8
+ "max_length": 32768,
9
+ "pad_token_id": 151665,
10
+ "repetition_penalty": 1.1,
11
+ "temperature": 0.7,
12
+ "top_k": 20,
13
+ "top_p": 0.8,
14
+ "transformers_version": "4.57.6"
15
+ }
merges.txt ADDED
The diff for this file is too large to render. See raw diff
 
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:16917dea6b2a10c626f48d60853f7c3ef0d393876b558c618472e15a05122fe9
3
+ size 3087467144
special_tokens_map.json ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "additional_special_tokens": [
3
+ "<|im_start|>",
4
+ "<|im_end|>",
5
+ "<|object_ref_start|>",
6
+ "<|object_ref_end|>",
7
+ "<|box_start|>",
8
+ "<|box_end|>",
9
+ "<|quad_start|>",
10
+ "<|quad_end|>",
11
+ "<|vision_start|>",
12
+ "<|vision_end|>",
13
+ "<|vision_pad|>",
14
+ "<|image_pad|>",
15
+ "<|video_pad|>"
16
+ ],
17
+ "eos_token": {
18
+ "content": "<|im_end|>",
19
+ "lstrip": false,
20
+ "normalized": false,
21
+ "rstrip": false,
22
+ "single_word": false
23
+ },
24
+ "pad_token": {
25
+ "content": "<|PAD_TOKEN|>",
26
+ "lstrip": false,
27
+ "normalized": false,
28
+ "rstrip": false,
29
+ "single_word": false
30
+ }
31
+ }
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fab42efe8d17406525a9154b728cf9e957629a8ed7ce997770efdd71128c6a1a
3
+ size 11422086
tokenizer_config.json ADDED
@@ -0,0 +1,217 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_bos_token": false,
3
+ "add_prefix_space": false,
4
+ "added_tokens_decoder": {
5
+ "151643": {
6
+ "content": "<|endoftext|>",
7
+ "lstrip": false,
8
+ "normalized": false,
9
+ "rstrip": false,
10
+ "single_word": false,
11
+ "special": true
12
+ },
13
+ "151644": {
14
+ "content": "<|im_start|>",
15
+ "lstrip": false,
16
+ "normalized": false,
17
+ "rstrip": false,
18
+ "single_word": false,
19
+ "special": true
20
+ },
21
+ "151645": {
22
+ "content": "<|im_end|>",
23
+ "lstrip": false,
24
+ "normalized": false,
25
+ "rstrip": false,
26
+ "single_word": false,
27
+ "special": true
28
+ },
29
+ "151646": {
30
+ "content": "<|object_ref_start|>",
31
+ "lstrip": false,
32
+ "normalized": false,
33
+ "rstrip": false,
34
+ "single_word": false,
35
+ "special": true
36
+ },
37
+ "151647": {
38
+ "content": "<|object_ref_end|>",
39
+ "lstrip": false,
40
+ "normalized": false,
41
+ "rstrip": false,
42
+ "single_word": false,
43
+ "special": true
44
+ },
45
+ "151648": {
46
+ "content": "<|box_start|>",
47
+ "lstrip": false,
48
+ "normalized": false,
49
+ "rstrip": false,
50
+ "single_word": false,
51
+ "special": true
52
+ },
53
+ "151649": {
54
+ "content": "<|box_end|>",
55
+ "lstrip": false,
56
+ "normalized": false,
57
+ "rstrip": false,
58
+ "single_word": false,
59
+ "special": true
60
+ },
61
+ "151650": {
62
+ "content": "<|quad_start|>",
63
+ "lstrip": false,
64
+ "normalized": false,
65
+ "rstrip": false,
66
+ "single_word": false,
67
+ "special": true
68
+ },
69
+ "151651": {
70
+ "content": "<|quad_end|>",
71
+ "lstrip": false,
72
+ "normalized": false,
73
+ "rstrip": false,
74
+ "single_word": false,
75
+ "special": true
76
+ },
77
+ "151652": {
78
+ "content": "<|vision_start|>",
79
+ "lstrip": false,
80
+ "normalized": false,
81
+ "rstrip": false,
82
+ "single_word": false,
83
+ "special": true
84
+ },
85
+ "151653": {
86
+ "content": "<|vision_end|>",
87
+ "lstrip": false,
88
+ "normalized": false,
89
+ "rstrip": false,
90
+ "single_word": false,
91
+ "special": true
92
+ },
93
+ "151654": {
94
+ "content": "<|vision_pad|>",
95
+ "lstrip": false,
96
+ "normalized": false,
97
+ "rstrip": false,
98
+ "single_word": false,
99
+ "special": true
100
+ },
101
+ "151655": {
102
+ "content": "<|image_pad|>",
103
+ "lstrip": false,
104
+ "normalized": false,
105
+ "rstrip": false,
106
+ "single_word": false,
107
+ "special": true
108
+ },
109
+ "151656": {
110
+ "content": "<|video_pad|>",
111
+ "lstrip": false,
112
+ "normalized": false,
113
+ "rstrip": false,
114
+ "single_word": false,
115
+ "special": true
116
+ },
117
+ "151657": {
118
+ "content": "<tool_call>",
119
+ "lstrip": false,
120
+ "normalized": false,
121
+ "rstrip": false,
122
+ "single_word": false,
123
+ "special": false
124
+ },
125
+ "151658": {
126
+ "content": "</tool_call>",
127
+ "lstrip": false,
128
+ "normalized": false,
129
+ "rstrip": false,
130
+ "single_word": false,
131
+ "special": false
132
+ },
133
+ "151659": {
134
+ "content": "<|fim_prefix|>",
135
+ "lstrip": false,
136
+ "normalized": false,
137
+ "rstrip": false,
138
+ "single_word": false,
139
+ "special": false
140
+ },
141
+ "151660": {
142
+ "content": "<|fim_middle|>",
143
+ "lstrip": false,
144
+ "normalized": false,
145
+ "rstrip": false,
146
+ "single_word": false,
147
+ "special": false
148
+ },
149
+ "151661": {
150
+ "content": "<|fim_suffix|>",
151
+ "lstrip": false,
152
+ "normalized": false,
153
+ "rstrip": false,
154
+ "single_word": false,
155
+ "special": false
156
+ },
157
+ "151662": {
158
+ "content": "<|fim_pad|>",
159
+ "lstrip": false,
160
+ "normalized": false,
161
+ "rstrip": false,
162
+ "single_word": false,
163
+ "special": false
164
+ },
165
+ "151663": {
166
+ "content": "<|repo_name|>",
167
+ "lstrip": false,
168
+ "normalized": false,
169
+ "rstrip": false,
170
+ "single_word": false,
171
+ "special": false
172
+ },
173
+ "151664": {
174
+ "content": "<|file_sep|>",
175
+ "lstrip": false,
176
+ "normalized": false,
177
+ "rstrip": false,
178
+ "single_word": false,
179
+ "special": false
180
+ },
181
+ "151665": {
182
+ "content": "<|PAD_TOKEN|>",
183
+ "lstrip": false,
184
+ "normalized": false,
185
+ "rstrip": false,
186
+ "single_word": false,
187
+ "special": true
188
+ }
189
+ },
190
+ "additional_special_tokens": [
191
+ "<|im_start|>",
192
+ "<|im_end|>",
193
+ "<|object_ref_start|>",
194
+ "<|object_ref_end|>",
195
+ "<|box_start|>",
196
+ "<|box_end|>",
197
+ "<|quad_start|>",
198
+ "<|quad_end|>",
199
+ "<|vision_start|>",
200
+ "<|vision_end|>",
201
+ "<|vision_pad|>",
202
+ "<|image_pad|>",
203
+ "<|video_pad|>"
204
+ ],
205
+ "bos_token": null,
206
+ "clean_up_tokenization_spaces": false,
207
+ "eos_token": "<|im_end|>",
208
+ "errors": "replace",
209
+ "extra_special_tokens": {},
210
+ "model_max_length": 32768,
211
+ "pad_token": "<|PAD_TOKEN|>",
212
+ "padding_side": "right",
213
+ "split_special_tokens": false,
214
+ "tokenizer_class": "Qwen2Tokenizer",
215
+ "unk_token": null,
216
+ "chat_template": "{%- if tools %}\n {{- '<|im_start|>system\\n' }}\n {%- if messages[0]['role'] == 'system' %}\n {{- messages[0]['content'] }}\n {%- else %}\n {{- 'You are a coding prompt router. You receive raw developer prompts and return a single JSON object with these fields:\\n\\n- rewrite (string): Clearer version of the prompt, preserving original intent. Do not invent requirements not present in the source.\\n- intent (enum): debug | refactor | feature | explain | documentation | boilerplate | architecture | review | optimize | other\\n- complexity (enum): low | medium | high\\n- route (enum): small_local | medium_api | large_api\\n- missing (array of strings): Context the developer should have included but didn\\'t. Empty array if nothing is missing.\\n\\nReturn ONLY valid JSON. No prose outside the JSON.' }}\n {%- endif %}\n {{- \"\\n\\n# 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>\" }}\n {%- for tool in tools %}\n {{- \"\\n\" }}\n {{- tool | tojson }}\n {%- endfor %}\n {{- \"\\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\" }}\n{%- else %}\n {%- if messages[0]['role'] == 'system' %}\n {{- '<|im_start|>system\\n' + messages[0]['content'] + '<|im_end|>\\n' }}\n {%- else %}\n {{- '<|im_start|>system\\nYou are a coding prompt router. You receive raw developer prompts and return a single JSON object with these fields:\\n\\n- rewrite (string): Clearer version of the prompt, preserving original intent. Do not invent requirements not present in the source.\\n- intent (enum): debug | refactor | feature | explain | documentation | boilerplate | architecture | review | optimize | other\\n- complexity (enum): low | medium | high\\n- route (enum): small_local | medium_api | large_api\\n- missing (array of strings): Context the developer should have included but didn\\'t. Empty array if nothing is missing.\\n\\nReturn ONLY valid JSON. No prose outside the JSON.<|im_end|>\\n' }}\n {%- endif %}\n{%- endif %}\n{%- for message in messages %}\n {%- if (message.role == \"user\") or (message.role == \"system\" and not loop.first) or (message.role == \"assistant\" and not message.tool_calls) %}\n {{- '<|im_start|>' + message.role + '\\n' + message.content + '<|im_end|>' + '\\n' }}\n {%- elif message.role == \"assistant\" %}\n {{- '<|im_start|>' + message.role }}\n {%- if message.content %}\n {{- '\\n' + message.content }}\n {%- endif %}\n {%- for tool_call in message.tool_calls %}\n {%- if tool_call.function is defined %}\n {%- set tool_call = tool_call.function %}\n {%- endif %}\n {{- '\\n<tool_call>\\n{\"name\": \"' }}\n {{- tool_call.name }}\n {{- '\", \"arguments\": ' }}\n {{- tool_call.arguments | tojson }}\n {{- '}\\n</tool_call>' }}\n {%- endfor %}\n {{- '<|im_end|>\\n' }}\n {%- elif message.role == \"tool\" %}\n {%- if (loop.index0 == 0) or (messages[loop.index0 - 1].role != \"tool\") %}\n {{- '<|im_start|>user' }}\n {%- endif %}\n {{- '\\n<tool_response>\\n' }}\n {{- message.content }}\n {{- '\\n</tool_response>' }}\n {%- if loop.last or (messages[loop.index0 + 1].role != \"tool\") %}\n {{- '<|im_end|>\\n' }}\n {%- endif %}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt %}\n {{- '<|im_start|>assistant\\n' }}\n{%- endif %}\n"
217
+ }
vocab.json ADDED
The diff for this file is too large to render. See raw diff