Instructions to use MK4-Research/Debux with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use MK4-Research/Debux with MLX:
# Download the model from the Hub pip install huggingface_hub[hf_xet] hf download MK4-Research/Debux --local-dir Debux
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Atomic Chat
Debux v1 fused weights (4-bit MLX, adapter merged into base)
Browse files- .gitattributes +1 -0
- README.md +3 -130
- chat_template.jinja +170 -0
- config.json +154 -0
- generation_config.json +12 -0
- model-00001-of-00003.safetensors +3 -0
- model-00002-of-00003.safetensors +3 -0
- model-00003-of-00003.safetensors +3 -0
- model.safetensors.index.json +0 -0
- tokenizer.json +3 -0
- tokenizer_config.json +34 -0
.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,134 +1,7 @@
|
|
| 1 |
---
|
| 2 |
-
|
| 3 |
library_name: mlx
|
| 4 |
tags:
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
- sysadmin
|
| 8 |
-
- linux
|
| 9 |
-
- lora
|
| 10 |
-
language:
|
| 11 |
-
- en
|
| 12 |
-
license: apache-2.0
|
| 13 |
---
|
| 14 |
-
|
| 15 |
-
# Debux v1
|
| 16 |
-
|
| 17 |
-
A debugging assistant for Linux and DevOps problems. You have a broken server, you talk to Debux,
|
| 18 |
-
and it asks you what to run, reads what you paste back, and works out what that output rules in and
|
| 19 |
-
out until it can name a cause or tell you honestly that it cannot.
|
| 20 |
-
|
| 21 |
-
Debux does not touch your machine. It never executes anything, never holds credentials, and never
|
| 22 |
-
needs SSH on the box that is already on fire. You run the commands, it reads the output. The cost is
|
| 23 |
-
round trips; the benefit is that a debugging tool with no execution path has no blast radius, and
|
| 24 |
-
you see every command before it runs.
|
| 25 |
-
|
| 26 |
-
v1 is a LoRA over `qwen3.8-27b-4bit`, trained for roughly 80 iterations on 198 hand-authored
|
| 27 |
-
multi-turn rows.
|
| 28 |
-
|
| 29 |
-
## What it fixes, and what it breaks
|
| 30 |
-
|
| 31 |
-
The stock base model is, almost exactly, the degenerate strategy of never committing to anything:
|
| 32 |
-
it answers "run one more command" to nearly every input, including when the evidence it is asking
|
| 33 |
-
for was never recorded and cannot be produced. On a 73-item held-out benchmark it scores 25.3
|
| 34 |
-
percent balanced accuracy against a 25 percent floor.
|
| 35 |
-
|
| 36 |
-
v1 substantially fixes that, and introduces a new problem in the process. Both are reported here
|
| 37 |
-
because the second one matters if you are going to rely on this.
|
| 38 |
-
|
| 39 |
-
| | base | **v1** |
|
| 40 |
-
|---|---|---|
|
| 41 |
-
| balanced accuracy | 25.3% | **32.0%** |
|
| 42 |
-
| DIAGNOSIS recall | 3/21 = 14.3% | **10/21 = 47.6%** |
|
| 43 |
-
| reply with no parseable directive | 14/73 = 19.2% | **1/73 = 1.4%** |
|
| 44 |
-
| NEED recall | 40/46 = 87.0% | 37/46 = 80.4% |
|
| 45 |
-
| INSUFFICIENT recall | 0/4 | 0/4 |
|
| 46 |
-
| SEARCH recall | 0/2 | 0/2 |
|
| 47 |
-
| overclaim rate | 0/4 | **1/4** |
|
| 48 |
-
|
| 49 |
-
**The gain is real.** DIAGNOSIS recall more than tripled, and the Wilson intervals barely overlap
|
| 50 |
-
([5-35%] against [28-68%]), so on 21 items this is not noise. Format compliance went from 14 missing
|
| 51 |
-
directives to 1.
|
| 52 |
-
|
| 53 |
-
**The regression is also real, and it is the one to watch.** Eight NEED items are now answered
|
| 54 |
-
DIAGNOSIS - cases where the model should have asked for more evidence and instead named a cause.
|
| 55 |
-
The base did this zero times. We traded some under-commitment for some over-commitment and came out
|
| 56 |
-
ahead on balance, but a debugging assistant that names causes early sends someone to restart the
|
| 57 |
-
wrong service at 3am, so this is a genuine cost and not a rounding error.
|
| 58 |
-
|
| 59 |
-
**INSUFFICIENT and SEARCH did not move at all** (0/4 and 0/2). Those are the two hardest classes and
|
| 60 |
-
the two smallest, so "not learned in 80 iterations" and "not measurable at n=4" cannot be told apart
|
| 61 |
-
from this data. Do not read the zeros as evidence either way.
|
| 62 |
-
|
| 63 |
-
## The format is a contract
|
| 64 |
-
|
| 65 |
-
Every reply is reasoning followed by exactly one directive. The client parses the directive and acts
|
| 66 |
-
on it, so this is an interface rather than a writing style.
|
| 67 |
-
|
| 68 |
-
```
|
| 69 |
-
REASONING:
|
| 70 |
-
- errno 111 is connection refused: the address is reachable, nothing is accepting on it
|
| 71 |
-
- ss confirms it, only nginx and sshd are listening
|
| 72 |
-
- nginx config is not implicated; the application behind it is not running
|
| 73 |
-
NEED:
|
| 74 |
-
systemctl list-units --type=service --state=failed
|
| 75 |
-
journalctl -u <your-app> -n 40 --no-pager
|
| 76 |
-
```
|
| 77 |
-
|
| 78 |
-
| directive | when | client behaviour |
|
| 79 |
-
|---|---|---|
|
| 80 |
-
| `NEED` | more evidence is needed and a command here will produce it | shows the commands, waits for pasted output |
|
| 81 |
-
| `DIAGNOSIS` | the evidence identifies the cause | prints the cause and a `FIX:` block |
|
| 82 |
-
| `SEARCH` | the gap is a version- or vendor-specific fact | runs the query, feeds results back |
|
| 83 |
-
| `INSUFFICIENT` | you want a cause and the evidence cannot support one | prints what is missing and what would settle it |
|
| 84 |
-
|
| 85 |
-
`NEED` versus `INSUFFICIENT` is the distinction the model exists for. `NEED` means the answer is on
|
| 86 |
-
the machine and a command will fetch it. `INSUFFICIENT` means it is not: the record was never
|
| 87 |
-
written, it was rotated away, it lives with a vendor or a hypervisor, or it needs measurement over
|
| 88 |
-
time that nobody started. Telling someone to keep looking at a machine that does not hold the answer
|
| 89 |
-
wastes an outage.
|
| 90 |
-
|
| 91 |
-
## Using it
|
| 92 |
-
|
| 93 |
-
Two things are required, or the directive contract is not reliable:
|
| 94 |
-
|
| 95 |
-
1. **Use the shipped system prompt** (`system_prompt.txt`). It is short by necessity and the model
|
| 96 |
-
was trained against it exactly.
|
| 97 |
-
2. **Window the history.** The model was trained on the system prompt, the original symptom, and the
|
| 98 |
-
last message only - never a full transcript. Feeding it the whole conversation is a context shape
|
| 99 |
-
it has never seen. The reference client does this in one function.
|
| 100 |
-
3. **Turn thinking off.** This base has a thinking mode, and with it enabled the model emits a
|
| 101 |
-
planning monologue before the format and frequently runs out of tokens mid-answer. Pass
|
| 102 |
-
`enable_thinking=False` to `apply_chat_template`, or the equivalent for your server. The training
|
| 103 |
-
corpus contains no think blocks, so the reasoning belongs in the visible answer.
|
| 104 |
-
|
| 105 |
-
Reasoning is visible rather than hidden in `<think>` blocks. That was settled by measurement earlier
|
| 106 |
-
in this line of work: a sibling model trained on a corpus with no think blocks got *worse* with
|
| 107 |
-
thinking enabled, recall falling from 86.5 to 68.3 percent, and the base with thinking on did not
|
| 108 |
-
converge at all. For a debugging tool it is also the better product, since someone staring at a
|
| 109 |
-
broken server needs to see why they are being asked to run something.
|
| 110 |
-
|
| 111 |
-
## Training
|
| 112 |
-
|
| 113 |
-
LoRA, rank 32, 16 layers, learning rate 1e-5, gradient checkpointing, loss masked to the assistant
|
| 114 |
-
message only.
|
| 115 |
-
|
| 116 |
-
That last point matters: the pasted command output in the corpus is synthetic, and without masking
|
| 117 |
-
the model would spend capacity learning to generate convincing `df` and `journalctl` output, which
|
| 118 |
-
is a direct route to inventing evidence in a tool whose only job is reading real evidence.
|
| 119 |
-
|
| 120 |
-
Rows are multi-turn. A sibling model trained on a single-turn corpus loops when placed in an actual
|
| 121 |
-
conversation.
|
| 122 |
-
|
| 123 |
-
## Honest limits
|
| 124 |
-
|
| 125 |
-
- **80 iterations.** This is an early checkpoint, stopped deliberately rather than trained to
|
| 126 |
-
convergence. A longer run is the obvious next step and may or may not help the overclaiming.
|
| 127 |
-
- **Never tested against a real machine.** Every command output in the training corpus was written,
|
| 128 |
-
not captured. A harness that runs the model against deliberately broken Docker containers exists
|
| 129 |
-
for exactly this reason, and it has not been run yet. Until it has, treat the benchmark numbers as
|
| 130 |
-
measuring behaviour on one house style of terminal output.
|
| 131 |
-
- **Small benchmark.** 73 items over 25 held-out scenarios. INSUFFICIENT is 4 items and SEARCH is 2.
|
| 132 |
-
- **Linux server work only.** No Windows, no macOS, no embedded.
|
| 133 |
-
- **It can be wrong.** It is a way to be systematic about evidence under pressure, not a replacement
|
| 134 |
-
for someone who knows the system.
|
|
|
|
| 1 |
---
|
| 2 |
+
language: en
|
| 3 |
library_name: mlx
|
| 4 |
tags:
|
| 5 |
+
- mlx
|
| 6 |
+
pipeline_tag: text-generation
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
chat_template.jinja
ADDED
|
@@ -0,0 +1,170 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{%- set image_count = namespace(value=0) %}
|
| 2 |
+
{%- set video_count = namespace(value=0) %}
|
| 3 |
+
{%- macro render_content(content, do_vision_count, is_system_content=false) %}
|
| 4 |
+
{%- if content is string %}
|
| 5 |
+
{{- content }}
|
| 6 |
+
{%- elif content is iterable and content is not mapping %}
|
| 7 |
+
{%- for item in content %}
|
| 8 |
+
{%- if 'image' in item or 'image_url' in item or item.type == 'image' %}
|
| 9 |
+
{%- if is_system_content %}
|
| 10 |
+
{{- raise_exception('System message cannot contain images.') }}
|
| 11 |
+
{%- endif %}
|
| 12 |
+
{%- if do_vision_count %}
|
| 13 |
+
{%- set image_count.value = image_count.value + 1 %}
|
| 14 |
+
{%- endif %}
|
| 15 |
+
{%- if add_vision_id %}
|
| 16 |
+
{{- 'Picture ' ~ image_count.value ~ ': ' }}
|
| 17 |
+
{%- endif %}
|
| 18 |
+
{{- '<|vision_start|><|image_pad|><|vision_end|>' }}
|
| 19 |
+
{%- elif 'video' in item or item.type == 'video' %}
|
| 20 |
+
{%- if is_system_content %}
|
| 21 |
+
{{- raise_exception('System message cannot contain videos.') }}
|
| 22 |
+
{%- endif %}
|
| 23 |
+
{%- if do_vision_count %}
|
| 24 |
+
{%- set video_count.value = video_count.value + 1 %}
|
| 25 |
+
{%- endif %}
|
| 26 |
+
{%- if add_vision_id %}
|
| 27 |
+
{{- 'Video ' ~ video_count.value ~ ': ' }}
|
| 28 |
+
{%- endif %}
|
| 29 |
+
{{- '<|vision_start|><|video_pad|><|vision_end|>' }}
|
| 30 |
+
{%- elif 'text' in item %}
|
| 31 |
+
{{- item.text }}
|
| 32 |
+
{%- else %}
|
| 33 |
+
{{- raise_exception('Unexpected item type in content.') }}
|
| 34 |
+
{%- endif %}
|
| 35 |
+
{%- endfor %}
|
| 36 |
+
{%- elif content is none or content is undefined %}
|
| 37 |
+
{{- '' }}
|
| 38 |
+
{%- else %}
|
| 39 |
+
{{- raise_exception('Unexpected content type.') }}
|
| 40 |
+
{%- endif %}
|
| 41 |
+
{%- endmacro %}
|
| 42 |
+
{%- if not messages %}
|
| 43 |
+
{{- raise_exception('No messages provided.') }}
|
| 44 |
+
{%- endif %}
|
| 45 |
+
{%- set reasoning_instructions = '' %}
|
| 46 |
+
{%- if enable_thinking is undefined or enable_thinking is true %}
|
| 47 |
+
{%- set resolved_reasoning_effort = reasoning_effort|default('xhigh') %}
|
| 48 |
+
{%- if resolved_reasoning_effort not in ('xhigh', 'medium', 'low') %}
|
| 49 |
+
{{- raise_exception('Unexpected reasoning effort ' ~ reasoning_effort ~ '. Supported types are xhigh (default), medium, and low.') }}
|
| 50 |
+
{%- endif %}
|
| 51 |
+
{%- if resolved_reasoning_effort == 'xhigh' %}
|
| 52 |
+
{%- set reasoning_instructions = 'Reasoning effort is set to xhigh. Please think carefully through the task, validate key assumptions, consider plausible alternatives, and prioritize correctness, consistency, and clarity in the final answer.' %}
|
| 53 |
+
{%- elif resolved_reasoning_effort == 'low' %}
|
| 54 |
+
{%- set reasoning_instructions = 'Reasoning effort is set to low. Keep your thinking brief and focused, moving directly to the conclusion without unnecessary elaboration.' %}
|
| 55 |
+
{%- endif %}
|
| 56 |
+
{%- endif %}
|
| 57 |
+
{%- if tools and tools is iterable and tools is not mapping %}
|
| 58 |
+
{{- '<|im_start|>system\n' }}
|
| 59 |
+
{%- if reasoning_instructions %}
|
| 60 |
+
{{- reasoning_instructions + '\n\n' }}
|
| 61 |
+
{%- endif %}
|
| 62 |
+
{{- "# Tools\n\nYou have access to the following functions:\n\n<tools>" }}
|
| 63 |
+
{%- for tool in tools %}
|
| 64 |
+
{{- "\n" }}
|
| 65 |
+
{{- tool | tojson }}
|
| 66 |
+
{%- endfor %}
|
| 67 |
+
{{- "\n</tools>" }}
|
| 68 |
+
{{- '\n\nIf you choose to call a function ONLY reply in the following format with NO suffix:\n\n<tool_call>\n<function=example_function_name>\n<parameter=example_parameter_1>\nvalue_1\n</parameter>\n<parameter=example_parameter_2>\nThis is the value for the second parameter\nthat can span\nmultiple lines\n</parameter>\n</function>\n</tool_call>\n\n<IMPORTANT>\nReminder:\n- Function calls MUST follow the specified format: an inner <function=...></function> block must be nested within <tool_call></tool_call> XML tags\n- Required parameters MUST be specified\n- You may provide optional reasoning for your function call in natural language BEFORE the function call, but NOT after\n- If there is no function call available, answer the question like normal with your current knowledge and do not tell the user about function calls\n</IMPORTANT>' }}
|
| 69 |
+
{%- if messages[0].role == 'system' %}
|
| 70 |
+
{%- set content = render_content(messages[0].content, false, true)|trim %}
|
| 71 |
+
{%- if content %}
|
| 72 |
+
{{- '\n\n' + content }}
|
| 73 |
+
{%- endif %}
|
| 74 |
+
{%- endif %}
|
| 75 |
+
{{- '<|im_end|>\n' }}
|
| 76 |
+
{%- else %}
|
| 77 |
+
{%- if messages[0].role == 'system' %}
|
| 78 |
+
{%- set content = render_content(messages[0].content, false, true)|trim %}
|
| 79 |
+
{%- if content %}
|
| 80 |
+
{{- '<|im_start|>system\n' + (reasoning_instructions + '\n\n' if reasoning_instructions else '') + content + '<|im_end|>\n' }}
|
| 81 |
+
{%- elif reasoning_instructions %}
|
| 82 |
+
{{- '<|im_start|>system\n' + reasoning_instructions + '<|im_end|>\n' }}
|
| 83 |
+
{%- endif %}
|
| 84 |
+
{%- elif reasoning_instructions %}
|
| 85 |
+
{{- '<|im_start|>system\n' + reasoning_instructions + '<|im_end|>\n' }}
|
| 86 |
+
{%- endif %}
|
| 87 |
+
{%- endif %}
|
| 88 |
+
{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
|
| 89 |
+
{%- for message in messages[::-1] %}
|
| 90 |
+
{%- set index = (messages|length - 1) - loop.index0 %}
|
| 91 |
+
{%- if ns.multi_step_tool and message.role == "user" %}
|
| 92 |
+
{%- set content = render_content(message.content, false)|trim %}
|
| 93 |
+
{%- if not(content.startswith('<tool_response>') and content.endswith('</tool_response>')) %}
|
| 94 |
+
{%- set ns.multi_step_tool = false %}
|
| 95 |
+
{%- set ns.last_query_index = index %}
|
| 96 |
+
{%- endif %}
|
| 97 |
+
{%- endif %}
|
| 98 |
+
{%- endfor %}
|
| 99 |
+
{%- if ns.multi_step_tool %}
|
| 100 |
+
{{- raise_exception('No user query found in messages.') }}
|
| 101 |
+
{%- endif %}
|
| 102 |
+
{%- for message in messages %}
|
| 103 |
+
{%- set content = render_content(message.content, true)|trim %}
|
| 104 |
+
{%- if message.role == "system" %}
|
| 105 |
+
{%- if not loop.first %}
|
| 106 |
+
{{- raise_exception('System message must be at the beginning.') }}
|
| 107 |
+
{%- endif %}
|
| 108 |
+
{%- elif message.role == "user" %}
|
| 109 |
+
{{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }}
|
| 110 |
+
{%- elif message.role == "assistant" %}
|
| 111 |
+
{%- set reasoning_content = '' %}
|
| 112 |
+
{%- if message.reasoning_content is string %}
|
| 113 |
+
{%- set reasoning_content = message.reasoning_content %}
|
| 114 |
+
{%- endif %}
|
| 115 |
+
{%- set reasoning_content = reasoning_content|trim %}
|
| 116 |
+
{%- if preserve_thinking is undefined or preserve_thinking is true or loop.index0 > ns.last_query_index %}
|
| 117 |
+
{{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content + '\n</think>\n\n' + content }}
|
| 118 |
+
{%- else %}
|
| 119 |
+
{{- '<|im_start|>' + message.role + '\n' + content }}
|
| 120 |
+
{%- endif %}
|
| 121 |
+
{%- if message.tool_calls and message.tool_calls is iterable and message.tool_calls is not mapping %}
|
| 122 |
+
{%- for tool_call in message.tool_calls %}
|
| 123 |
+
{%- if tool_call.function is defined %}
|
| 124 |
+
{%- set tool_call = tool_call.function %}
|
| 125 |
+
{%- endif %}
|
| 126 |
+
{%- if loop.first %}
|
| 127 |
+
{%- if content|trim %}
|
| 128 |
+
{{- '\n\n<tool_call>\n<function=' + tool_call.name + '>\n' }}
|
| 129 |
+
{%- else %}
|
| 130 |
+
{{- '<tool_call>\n<function=' + tool_call.name + '>\n' }}
|
| 131 |
+
{%- endif %}
|
| 132 |
+
{%- else %}
|
| 133 |
+
{{- '\n<tool_call>\n<function=' + tool_call.name + '>\n' }}
|
| 134 |
+
{%- endif %}
|
| 135 |
+
{%- if tool_call.arguments is defined and tool_call.arguments != '' %}
|
| 136 |
+
{%- for args_name, args_value in tool_call.arguments|items %}
|
| 137 |
+
{{- '<parameter=' + args_name + '>\n' }}
|
| 138 |
+
{%- set args_value = args_value | string if args_value is string else args_value | tojson | safe %}
|
| 139 |
+
{{- args_value }}
|
| 140 |
+
{{- '\n</parameter>\n' }}
|
| 141 |
+
{%- endfor %}
|
| 142 |
+
{%- endif %}
|
| 143 |
+
{{- '</function>\n</tool_call>' }}
|
| 144 |
+
{%- endfor %}
|
| 145 |
+
{%- endif %}
|
| 146 |
+
{{- '<|im_end|>\n' }}
|
| 147 |
+
{%- elif message.role == "tool" %}
|
| 148 |
+
{%- if loop.previtem and loop.previtem.role != "tool" %}
|
| 149 |
+
{{- '<|im_start|>user' }}
|
| 150 |
+
{%- endif %}
|
| 151 |
+
{{- '\n<tool_response>\n' }}
|
| 152 |
+
{{- content }}
|
| 153 |
+
{{- '\n</tool_response>' }}
|
| 154 |
+
{%- if not loop.last and loop.nextitem.role != "tool" %}
|
| 155 |
+
{{- '<|im_end|>\n' }}
|
| 156 |
+
{%- elif loop.last %}
|
| 157 |
+
{{- '<|im_end|>\n' }}
|
| 158 |
+
{%- endif %}
|
| 159 |
+
{%- else %}
|
| 160 |
+
{{- raise_exception('Unexpected message role.') }}
|
| 161 |
+
{%- endif %}
|
| 162 |
+
{%- endfor %}
|
| 163 |
+
{%- if add_generation_prompt %}
|
| 164 |
+
{{- '<|im_start|>assistant\n' }}
|
| 165 |
+
{%- if enable_thinking is defined and enable_thinking is false %}
|
| 166 |
+
{{- '<think>\n\n</think>\n\n' }}
|
| 167 |
+
{%- else %}
|
| 168 |
+
{{- '<think>\n' }}
|
| 169 |
+
{%- endif %}
|
| 170 |
+
{%- endif %}
|
config.json
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"Qwen3_5ForConditionalGeneration"
|
| 4 |
+
],
|
| 5 |
+
"do_sample": true,
|
| 6 |
+
"eos_token_id": [
|
| 7 |
+
248046,
|
| 8 |
+
248044
|
| 9 |
+
],
|
| 10 |
+
"generation_config": {
|
| 11 |
+
"bos_token_id": 248044,
|
| 12 |
+
"do_sample": true,
|
| 13 |
+
"eos_token_id": [
|
| 14 |
+
248046,
|
| 15 |
+
248044
|
| 16 |
+
],
|
| 17 |
+
"pad_token_id": 248044,
|
| 18 |
+
"temperature": 1.0,
|
| 19 |
+
"top_k": 20,
|
| 20 |
+
"top_p": 0.95
|
| 21 |
+
},
|
| 22 |
+
"image_token_id": 248056,
|
| 23 |
+
"language_model_only": false,
|
| 24 |
+
"model_type": "qwen3_5",
|
| 25 |
+
"quantization": {
|
| 26 |
+
"group_size": 64,
|
| 27 |
+
"bits": 4,
|
| 28 |
+
"mode": "affine"
|
| 29 |
+
},
|
| 30 |
+
"quantization_config": {
|
| 31 |
+
"group_size": 64,
|
| 32 |
+
"bits": 4,
|
| 33 |
+
"mode": "affine"
|
| 34 |
+
},
|
| 35 |
+
"temperature": 1.0,
|
| 36 |
+
"text_config": {
|
| 37 |
+
"attention_bias": false,
|
| 38 |
+
"attention_dropout": 0.0,
|
| 39 |
+
"attn_output_gate": true,
|
| 40 |
+
"bos_token_id": 248044,
|
| 41 |
+
"dtype": "bfloat16",
|
| 42 |
+
"eos_token_id": 248044,
|
| 43 |
+
"full_attention_interval": 4,
|
| 44 |
+
"head_dim": 256,
|
| 45 |
+
"hidden_act": "silu",
|
| 46 |
+
"hidden_size": 5120,
|
| 47 |
+
"initializer_range": 0.02,
|
| 48 |
+
"intermediate_size": 17408,
|
| 49 |
+
"layer_types": [
|
| 50 |
+
"linear_attention",
|
| 51 |
+
"linear_attention",
|
| 52 |
+
"linear_attention",
|
| 53 |
+
"full_attention",
|
| 54 |
+
"linear_attention",
|
| 55 |
+
"linear_attention",
|
| 56 |
+
"linear_attention",
|
| 57 |
+
"full_attention",
|
| 58 |
+
"linear_attention",
|
| 59 |
+
"linear_attention",
|
| 60 |
+
"linear_attention",
|
| 61 |
+
"full_attention",
|
| 62 |
+
"linear_attention",
|
| 63 |
+
"linear_attention",
|
| 64 |
+
"linear_attention",
|
| 65 |
+
"full_attention",
|
| 66 |
+
"linear_attention",
|
| 67 |
+
"linear_attention",
|
| 68 |
+
"linear_attention",
|
| 69 |
+
"full_attention",
|
| 70 |
+
"linear_attention",
|
| 71 |
+
"linear_attention",
|
| 72 |
+
"linear_attention",
|
| 73 |
+
"full_attention",
|
| 74 |
+
"linear_attention",
|
| 75 |
+
"linear_attention",
|
| 76 |
+
"linear_attention",
|
| 77 |
+
"full_attention",
|
| 78 |
+
"linear_attention",
|
| 79 |
+
"linear_attention",
|
| 80 |
+
"linear_attention",
|
| 81 |
+
"full_attention",
|
| 82 |
+
"linear_attention",
|
| 83 |
+
"linear_attention",
|
| 84 |
+
"linear_attention",
|
| 85 |
+
"full_attention",
|
| 86 |
+
"linear_attention",
|
| 87 |
+
"linear_attention",
|
| 88 |
+
"linear_attention",
|
| 89 |
+
"full_attention",
|
| 90 |
+
"linear_attention",
|
| 91 |
+
"linear_attention",
|
| 92 |
+
"linear_attention",
|
| 93 |
+
"full_attention",
|
| 94 |
+
"linear_attention",
|
| 95 |
+
"linear_attention",
|
| 96 |
+
"linear_attention",
|
| 97 |
+
"full_attention",
|
| 98 |
+
"linear_attention",
|
| 99 |
+
"linear_attention",
|
| 100 |
+
"linear_attention",
|
| 101 |
+
"full_attention",
|
| 102 |
+
"linear_attention",
|
| 103 |
+
"linear_attention",
|
| 104 |
+
"linear_attention",
|
| 105 |
+
"full_attention",
|
| 106 |
+
"linear_attention",
|
| 107 |
+
"linear_attention",
|
| 108 |
+
"linear_attention",
|
| 109 |
+
"full_attention",
|
| 110 |
+
"linear_attention",
|
| 111 |
+
"linear_attention",
|
| 112 |
+
"linear_attention",
|
| 113 |
+
"full_attention"
|
| 114 |
+
],
|
| 115 |
+
"linear_conv_kernel_dim": 4,
|
| 116 |
+
"linear_key_head_dim": 128,
|
| 117 |
+
"linear_num_key_heads": 16,
|
| 118 |
+
"linear_num_value_heads": 48,
|
| 119 |
+
"linear_value_head_dim": 128,
|
| 120 |
+
"mamba_ssm_dtype": "float32",
|
| 121 |
+
"max_position_embeddings": 262144,
|
| 122 |
+
"model_type": "qwen3_5_text",
|
| 123 |
+
"mtp_num_hidden_layers": 1,
|
| 124 |
+
"mtp_use_dedicated_embeddings": false,
|
| 125 |
+
"num_attention_heads": 24,
|
| 126 |
+
"num_hidden_layers": 64,
|
| 127 |
+
"num_key_value_heads": 4,
|
| 128 |
+
"output_gate_type": "swish",
|
| 129 |
+
"pad_token_id": null,
|
| 130 |
+
"partial_rotary_factor": 0.25,
|
| 131 |
+
"rms_norm_eps": 1e-06,
|
| 132 |
+
"rope_parameters": {
|
| 133 |
+
"mrope_interleaved": true,
|
| 134 |
+
"mrope_section": [
|
| 135 |
+
11,
|
| 136 |
+
11,
|
| 137 |
+
10
|
| 138 |
+
],
|
| 139 |
+
"partial_rotary_factor": 0.25,
|
| 140 |
+
"rope_theta": 10000000,
|
| 141 |
+
"type": "default"
|
| 142 |
+
},
|
| 143 |
+
"tie_word_embeddings": false,
|
| 144 |
+
"use_cache": true,
|
| 145 |
+
"vocab_size": 248320
|
| 146 |
+
},
|
| 147 |
+
"tie_word_embeddings": false,
|
| 148 |
+
"top_k": 20,
|
| 149 |
+
"top_p": 0.95,
|
| 150 |
+
"transformers_version": "5.8.0.dev0",
|
| 151 |
+
"video_token_id": 248057,
|
| 152 |
+
"vision_end_token_id": 248054,
|
| 153 |
+
"vision_start_token_id": 248053
|
| 154 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"bos_token_id": 248044,
|
| 3 |
+
"do_sample": true,
|
| 4 |
+
"eos_token_id": [
|
| 5 |
+
248046,
|
| 6 |
+
248044
|
| 7 |
+
],
|
| 8 |
+
"pad_token_id": 248044,
|
| 9 |
+
"temperature": 1.0,
|
| 10 |
+
"top_k": 20,
|
| 11 |
+
"top_p": 0.95
|
| 12 |
+
}
|
model-00001-of-00003.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:075eac5fbba3951bc4870c1ac65d684c32e0abb24284201bd27f49df56735963
|
| 3 |
+
size 5328325648
|
model-00002-of-00003.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6c99c446987a432beb1f6ef7d6fde6db02682f1ebe1a913760953140e0fa4e47
|
| 3 |
+
size 5354185130
|
model-00003-of-00003.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:68f5cf98dd7ffdf36bb2f42a04e54b11b5bce07836acf062b0b05f607fb27f57
|
| 3 |
+
size 4450532735
|
model.safetensors.index.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:06b9509352d2af50381ab2247e083b80d32d5c0aba91c272ca9ff729b6a0e523
|
| 3 |
+
size 19989325
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_prefix_space": false,
|
| 3 |
+
"audio_bos_token": "<|audio_start|>",
|
| 4 |
+
"audio_eos_token": "<|audio_end|>",
|
| 5 |
+
"audio_token": "<|audio_pad|>",
|
| 6 |
+
"backend": "tokenizers",
|
| 7 |
+
"bos_token": null,
|
| 8 |
+
"clean_up_tokenization_spaces": false,
|
| 9 |
+
"eos_token": "<|im_end|>",
|
| 10 |
+
"errors": "replace",
|
| 11 |
+
"image_token": "<|image_pad|>",
|
| 12 |
+
"is_local": true,
|
| 13 |
+
"local_files_only": false,
|
| 14 |
+
"model_max_length": 262144,
|
| 15 |
+
"model_specific_special_tokens": {
|
| 16 |
+
"audio_bos_token": "<|audio_start|>",
|
| 17 |
+
"audio_eos_token": "<|audio_end|>",
|
| 18 |
+
"audio_token": "<|audio_pad|>",
|
| 19 |
+
"image_token": "<|image_pad|>",
|
| 20 |
+
"video_token": "<|video_pad|>",
|
| 21 |
+
"vision_bos_token": "<|vision_start|>",
|
| 22 |
+
"vision_eos_token": "<|vision_end|>"
|
| 23 |
+
},
|
| 24 |
+
"pad_token": "<|endoftext|>",
|
| 25 |
+
"pretokenize_regex": "(?i:'s|'t|'re|'ve|'m|'ll|'d)|[^\\r\\n\\p{L}\\p{N}]?[\\p{L}\\p{M}]+|\\p{N}| ?[^\\s\\p{L}\\p{M}\\p{N}]+[\\r\\n]*|\\s*[\\r\\n]+|\\s+(?!\\S)|\\s+",
|
| 26 |
+
"processor_class": "Qwen3VLProcessor",
|
| 27 |
+
"split_special_tokens": false,
|
| 28 |
+
"tokenizer_class": "Qwen2Tokenizer",
|
| 29 |
+
"tool_parser_type": "qwen3_coder",
|
| 30 |
+
"unk_token": null,
|
| 31 |
+
"video_token": "<|video_pad|>",
|
| 32 |
+
"vision_bos_token": "<|vision_start|>",
|
| 33 |
+
"vision_eos_token": "<|vision_end|>"
|
| 34 |
+
}
|