lazarevich commited on
Commit
7b1697b
·
0 Parent(s):

upload checkpoint

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. LICENSE +198 -0
  2. README.md +138 -0
  3. added_tokens.json +28 -0
  4. chat_template.jinja +117 -0
  5. config.json +40 -0
  6. generation_config.json +13 -0
  7. merges.txt +0 -0
  8. model-00001-of-00146.safetensors +3 -0
  9. model-00002-of-00146.safetensors +3 -0
  10. model-00003-of-00146.safetensors +3 -0
  11. model-00004-of-00146.safetensors +3 -0
  12. model-00005-of-00146.safetensors +3 -0
  13. model-00006-of-00146.safetensors +3 -0
  14. model-00007-of-00146.safetensors +3 -0
  15. model-00008-of-00146.safetensors +3 -0
  16. model-00009-of-00146.safetensors +3 -0
  17. model-00010-of-00146.safetensors +3 -0
  18. model-00011-of-00146.safetensors +3 -0
  19. model-00012-of-00146.safetensors +3 -0
  20. model-00013-of-00146.safetensors +3 -0
  21. model-00014-of-00146.safetensors +3 -0
  22. model-00015-of-00146.safetensors +3 -0
  23. model-00016-of-00146.safetensors +3 -0
  24. model-00017-of-00146.safetensors +3 -0
  25. model-00018-of-00146.safetensors +3 -0
  26. model-00019-of-00146.safetensors +3 -0
  27. model-00020-of-00146.safetensors +3 -0
  28. model-00021-of-00146.safetensors +3 -0
  29. model-00022-of-00146.safetensors +3 -0
  30. model-00023-of-00146.safetensors +3 -0
  31. model-00024-of-00146.safetensors +3 -0
  32. model-00025-of-00146.safetensors +3 -0
  33. model-00026-of-00146.safetensors +3 -0
  34. model-00027-of-00146.safetensors +3 -0
  35. model-00028-of-00146.safetensors +3 -0
  36. model-00029-of-00146.safetensors +3 -0
  37. model-00030-of-00146.safetensors +3 -0
  38. model-00031-of-00146.safetensors +3 -0
  39. model-00032-of-00146.safetensors +3 -0
  40. model-00033-of-00146.safetensors +3 -0
  41. model-00034-of-00146.safetensors +3 -0
  42. model-00035-of-00146.safetensors +3 -0
  43. model-00036-of-00146.safetensors +3 -0
  44. model-00037-of-00146.safetensors +3 -0
  45. model-00038-of-00146.safetensors +3 -0
  46. model-00039-of-00146.safetensors +3 -0
  47. model-00040-of-00146.safetensors +3 -0
  48. model-00041-of-00146.safetensors +3 -0
  49. model-00042-of-00146.safetensors +3 -0
  50. model-00043-of-00146.safetensors +3 -0
LICENSE ADDED
@@ -0,0 +1,198 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+ Copyright 2024 Alibaba Cloud
190
+ Licensed under the Apache License, Version 2.0 (the "License");
191
+ you may not use this file except in compliance with the License.
192
+ You may obtain a copy of the License at
193
+ http://www.apache.org/licenses/LICENSE-2.0
194
+ Unless required by applicable law or agreed to in writing, software
195
+ distributed under the License is distributed on an "AS IS" BASIS,
196
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
197
+ See the License for the specific language governing permissions and
198
+ limitations under the License.
README.md ADDED
@@ -0,0 +1,138 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ library_name: transformers
5
+ tags:
6
+ - qwen-coder
7
+ - MOE
8
+ - pruning
9
+ - compression
10
+ license: apache-2.0
11
+ name: cerebras/Qwen3-Coder-REAP-363B-A35B
12
+ description: >
13
+ This model was obtained by uniformly pruning 25% of experts in Qwen3-Coder-480B-A35B-Instruct using the REAP method.
14
+ readme: >
15
+ https://huggingface.co/cerebras/Qwen3-Coder-REAP-363B-A35B/main/README.md
16
+ license_link: https://huggingface.co/Qwen/Qwen3-Coder-480B-A35B-Instruct/blob/main/LICENSE
17
+ pipeline_tag: text-generation
18
+ base_model:
19
+ - Qwen/Qwen3-Coder-480B-A35B-Instruct
20
+ ---
21
+
22
+ <p align="center">
23
+ <em>𓌳 <strong>REAP</strong>𓌳 the Experts: Why Pruning Prevails for One-Shot MoE Compression</em><br>
24
+ <img src="https://i.imgur.com/rmzG3gg.png" alt="REAP" width="75%">
25
+ </p>
26
+
27
+ # Qwen3-Coder-REAP-363B-A35B
28
+
29
+ ## ✨ Highlights
30
+
31
+ Introducing **Qwen3-Coder-REAP-363B-A35B**, a **memory-efficient compressed variant** of Qwen3-Coder-480B-A35B-Instruct that maintains near-identical performance while being **25% lighter**.
32
+
33
+ This model was created using **REAP (Router-weighted Expert Activation Pruning)**, a novel expert pruning method that selectively removes redundant experts while preserving the router's independent control over remaining experts. Key features include:
34
+
35
+ - **Near-Lossless Performance**: Maintains almost identical accuracy on code generation, agentic coding, and function calling tasks compared to the full 480B model
36
+ - **25% Memory Reduction**: Compressed from 480B to 363B parameters, significantly lowering deployment costs and memory requirements
37
+ - **Preserved Capabilities**: Retains all core functionalities including code generation, agentic workflows, repository-scale understanding, and function calling
38
+ - **Drop-in Compatibility**: Works with vanilla vLLM - no source modifications or custom patches required
39
+ - **Optimized for Real-World Use**: Particularly effective for resource-constrained environments, local deployments, and academic research
40
+ ---
41
+ ## 📋 Model Overview
42
+
43
+ **Qwen3-Coder-REAP-363B-A35B** has the following specifications:
44
+
45
+ - **Base Model**: Qwen3-Coder-480B-A35B-Instruct
46
+ - **Compression Method**: REAP (Router-weighted Expert Activation Pruning)
47
+ - **Compression Ratio**: 25% expert pruning
48
+ - **Type**: Sparse Mixture-of-Experts (SMoE) Causal Language Model
49
+ - **Number of Parameters**: 363B total, 35B activated per token
50
+ - **Number of Layers**: 62
51
+ - **Number of Attention Heads (GQA)**: 96 for Q and 8 for KV
52
+ - **Number of Experts**: 120 (uniformly pruned from 160)
53
+ - **Number of Activated Experts**: 8 per token
54
+ - **Context Length**: 262,144 tokens natively (extendable to 1M with YaRN)
55
+ - **Quantization**: FP8
56
+ - **License**: Apache 2.0
57
+
58
+ ---
59
+
60
+ ## 📊 Evaluations
61
+
62
+ TBD for BF16 model. [Evalulation results available for the FP8 variant](https://huggingface.co/cerebras/Qwen3-Coder-REAP-363B-A35B#%F0%9F%93%8A-evaluations).
63
+
64
+
65
+ For more details on the evaluation setup, refer to the [REAP arXiv preprint](https://arxiv.org/abs/2510.13999).
66
+
67
+ ---
68
+
69
+ ## 🚀 Deployment
70
+
71
+ You can deploy the model directly using the **latest vLLM** (v0.11.0), no source modifications or custom patches required.
72
+
73
+ ```bash
74
+ vllm serve cerebras/Qwen3-Coder-REAP-363B-A35B \
75
+ --tensor-parallel-size 8 \
76
+ --tool-call-parser qwen3_coder \
77
+ --enable-auto-tool-choice \
78
+ --enable-expert-parallel
79
+ ```
80
+
81
+ If you encounter insufficient memory when running this model, you might need to set a lower value for `--max-num-seqs` flag (e.g. set to 64).
82
+
83
+
84
+ ## 🧩 Model Creation
85
+
86
+ This checkpoint was created by applying the **REAP (Router-weighted Expert Activation Pruning)** method uniformly across all Mixture-of-Experts (MoE) blocks of **Qwen3-Coder-480B-A35B-Instruct**, with a **25% pruning rate**.
87
+
88
+ ### How REAP Works
89
+
90
+ REAP selects experts to prune based on a novel **saliency criterion** that considers both:
91
+ - **Router gate values**: How frequently and strongly the router activates each expert
92
+ - **Expert activation norms**: The magnitude of each expert's output contributions
93
+
94
+ This dual consideration ensures that experts contributing minimally to the layer's output are pruned, while preserving those that play critical roles in the model's computations.
95
+
96
+ ### Key Advantages
97
+
98
+ - **One-Shot Compression**: No fine-tuning required after pruning - the model is immediately ready for deployment
99
+ - **Preserved Router Control**: Unlike expert merging methods, REAP maintains the router's independent, input-dependent control over remaining experts, avoiding "functional subspace collapse"
100
+ - **Generative Task Superiority**: REAP significantly outperforms expert merging approaches on generative benchmarks (code generation, creative writing, mathematical reasoning) while maintaining competitive performance on discriminative tasks
101
+
102
+ ### Calibration
103
+
104
+ The model was calibrated using a diverse mixture of domain-specific datasets including:
105
+ - Code generation samples ([evol-codealpaca](https://huggingface.co/datasets/theblackcat102/evol-codealpaca-v1))
106
+ - Function calling examples ([xlam-function-calling](https://huggingface.co/datasets/Salesforce/xlam-function-calling-60k))
107
+ - Agentic multi-turn trajectories ([SWE-smith-trajectories](https://huggingface.co/datasets/SWE-bench/SWE-smith-trajectories))
108
+
109
+ 📚 For more details, refer to the following resources:
110
+
111
+ - [🧾 arXiv Preprint](https://arxiv.org/abs/2510.13999)
112
+ - [🧾 REAP Blog](https://www.cerebras.ai/blog/reap)
113
+ - [💻 REAP Codebase (GitHub)](https://github.com/CerebrasResearch/reap)
114
+
115
+ ---
116
+
117
+ ## ⚖️ License
118
+
119
+ This model is derived from
120
+ **[`Qwen/Qwen3-Coder-480B-A35B-Instruct`](https://huggingface.co/Qwen/Qwen3-Coder-480B-A35B-Instruct)**
121
+ and distributed under the **Apache 2.0 License**.
122
+
123
+ 🔗 [View License File →](https://huggingface.co/Qwen/Qwen3-Coder-480B-A35B-Instruct/blob/main/LICENSE)
124
+
125
+ ---
126
+
127
+ ## 🧾 Citation
128
+
129
+ If you use this checkpoint, please cite the REAP paper:
130
+
131
+ ```bibtex
132
+ @article{lasby-reap,
133
+ title={REAP the Experts: Why Pruning Prevails for One-Shot MoE compression},
134
+ author={Lasby, Mike and Lazarevich, Ivan and Sinnadurai, Nish and Lie, Sean and Ioannou, Yani and Thangarasa, Vithursan},
135
+ journal={arXiv preprint arXiv:2510.13999},
136
+ year={2025}
137
+ }
138
+ ```
added_tokens.json ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "</think>": 151668,
3
+ "</tool_call>": 151658,
4
+ "</tool_response>": 151666,
5
+ "<think>": 151667,
6
+ "<tool_call>": 151657,
7
+ "<tool_response>": 151665,
8
+ "<|box_end|>": 151649,
9
+ "<|box_start|>": 151648,
10
+ "<|endoftext|>": 151643,
11
+ "<|file_sep|>": 151664,
12
+ "<|fim_middle|>": 151660,
13
+ "<|fim_pad|>": 151662,
14
+ "<|fim_prefix|>": 151659,
15
+ "<|fim_suffix|>": 151661,
16
+ "<|im_end|>": 151645,
17
+ "<|im_start|>": 151644,
18
+ "<|image_pad|>": 151655,
19
+ "<|object_ref_end|>": 151647,
20
+ "<|object_ref_start|>": 151646,
21
+ "<|quad_end|>": 151651,
22
+ "<|quad_start|>": 151650,
23
+ "<|repo_name|>": 151663,
24
+ "<|video_pad|>": 151656,
25
+ "<|vision_end|>": 151653,
26
+ "<|vision_pad|>": 151654,
27
+ "<|vision_start|>": 151652
28
+ }
chat_template.jinja ADDED
@@ -0,0 +1,117 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {% macro render_extra_keys(json_dict, handled_keys) %}
2
+ {%- if json_dict is mapping %}
3
+ {%- for json_key in json_dict if json_key not in handled_keys %}
4
+ {%- if json_dict[json_key] is mapping or (json_dict[json_key] is sequence and json_dict[json_key] is not string) %}
5
+ {{- '\n<' ~ json_key ~ '>' ~ (json_dict[json_key] | tojson | safe) ~ '</' ~ json_key ~ '>' }}
6
+ {%- else %}
7
+ {{-'\n<' ~ json_key ~ '>' ~ (json_dict[json_key] | string) ~ '</' ~ json_key ~ '>' }}
8
+ {%- endif %}
9
+ {%- endfor %}
10
+ {%- endif %}
11
+ {% endmacro %}
12
+
13
+ {%- if messages[0]["role"] == "system" %}
14
+ {%- set system_message = messages[0]["content"] %}
15
+ {%- set loop_messages = messages[1:] %}
16
+ {%- else %}
17
+ {%- set loop_messages = messages %}
18
+ {%- endif %}
19
+
20
+ {%- if not tools is defined %}
21
+ {%- set tools = [] %}
22
+ {%- endif %}
23
+
24
+ {%- if system_message is defined %}
25
+ {{- "<|im_start|>system\n" + system_message }}
26
+ {%- else %}
27
+ {%- if tools is iterable and tools | length > 0 %}
28
+ {{- "<|im_start|>system\nYou are Qwen, a helpful AI assistant that can interact with a computer to solve tasks." }}
29
+ {%- endif %}
30
+ {%- endif %}
31
+ {%- if tools is iterable and tools | length > 0 %}
32
+ {{- "\n\n# Tools\n\nYou have access to the following functions:\n\n" }}
33
+ {{- "<tools>" }}
34
+ {%- for tool in tools %}
35
+ {%- if tool.function is defined %}
36
+ {%- set tool = tool.function %}
37
+ {%- endif %}
38
+ {{- "\n<function>\n<name>" ~ tool.name ~ "</name>" }}
39
+ {%- if tool.description is defined %}
40
+ {{- '\n<description>' ~ (tool.description | trim) ~ '</description>' }}
41
+ {%- endif %}
42
+ {{- '\n<parameters>' }}
43
+ {%- if tool.parameters is defined and tool.parameters is mapping and tool.parameters.properties is defined and tool.parameters.properties is mapping %}
44
+ {%- for param_name, param_fields in tool.parameters.properties|items %}
45
+ {{- '\n<parameter>' }}
46
+ {{- '\n<name>' ~ param_name ~ '</name>' }}
47
+ {%- if param_fields.type is defined %}
48
+ {{- '\n<type>' ~ (param_fields.type | string) ~ '</type>' }}
49
+ {%- endif %}
50
+ {%- if param_fields.description is defined %}
51
+ {{- '\n<description>' ~ (param_fields.description | trim) ~ '</description>' }}
52
+ {%- endif %}
53
+ {%- set handled_keys = ['name', 'type', 'description'] %}
54
+ {{- render_extra_keys(param_fields, handled_keys) }}
55
+ {{- '\n</parameter>' }}
56
+ {%- endfor %}
57
+ {%- endif %}
58
+ {% set handled_keys = ['type', 'properties'] %}
59
+ {{- render_extra_keys(tool.parameters, handled_keys) }}
60
+ {{- '\n</parameters>' }}
61
+ {%- set handled_keys = ['type', 'name', 'description', 'parameters'] %}
62
+ {{- render_extra_keys(tool, handled_keys) }}
63
+ {{- '\n</function>' }}
64
+ {%- endfor %}
65
+ {{- "\n</tools>" }}
66
+ {{- '\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>' }}
67
+ {%- endif %}
68
+ {%- if system_message is defined %}
69
+ {{- '<|im_end|>\n' }}
70
+ {%- else %}
71
+ {%- if tools is iterable and tools | length > 0 %}
72
+ {{- '<|im_end|>\n' }}
73
+ {%- endif %}
74
+ {%- endif %}
75
+ {%- for message in loop_messages %}
76
+ {%- if message.role == "assistant" and message.tool_calls is defined and message.tool_calls is iterable and message.tool_calls | length > 0 %}
77
+ {{- '<|im_start|>' + message.role }}
78
+ {%- if message.content is defined and message.content is string and message.content | trim | length > 0 %}
79
+ {{- '\n' + message.content | trim + '\n' }}
80
+ {%- endif %}
81
+ {%- for tool_call in message.tool_calls %}
82
+ {%- if tool_call.function is defined %}
83
+ {%- set tool_call = tool_call.function %}
84
+ {%- endif %}
85
+ {{- '\n<tool_call>\n<function=' + tool_call.name + '>\n' }}
86
+ {%- if tool_call.arguments is defined %}
87
+ {%- for args_name, args_value in tool_call.arguments|items %}
88
+ {{- '<parameter=' + args_name + '>\n' }}
89
+ {%- set args_value = args_value | tojson | safe if args_value is mapping or (args_value is sequence and args_value is not string) else args_value | string %}
90
+ {{- args_value }}
91
+ {{- '\n</parameter>\n' }}
92
+ {%- endfor %}
93
+ {%- endif %}
94
+ {{- '</function>\n</tool_call>' }}
95
+ {%- endfor %}
96
+ {{- '<|im_end|>\n' }}
97
+ {%- elif message.role == "user" or message.role == "system" or message.role == "assistant" %}
98
+ {{- '<|im_start|>' + message.role + '\n' + message.content + '<|im_end|>' + '\n' }}
99
+ {%- elif message.role == "tool" %}
100
+ {%- if loop.previtem and loop.previtem.role != "tool" %}
101
+ {{- '<|im_start|>user\n' }}
102
+ {%- endif %}
103
+ {{- '<tool_response>\n' }}
104
+ {{- message.content }}
105
+ {{- '\n</tool_response>\n' }}
106
+ {%- if not loop.last and loop.nextitem.role != "tool" %}
107
+ {{- '<|im_end|>\n' }}
108
+ {%- elif loop.last %}
109
+ {{- '<|im_end|>\n' }}
110
+ {%- endif %}
111
+ {%- else %}
112
+ {{- '<|im_start|>' + message.role + '\n' + message.content + '<|im_end|>\n' }}
113
+ {%- endif %}
114
+ {%- endfor %}
115
+ {%- if add_generation_prompt %}
116
+ {{- '<|im_start|>assistant\n' }}
117
+ {%- endif %}
config.json ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "Qwen3MoeForCausalLM"
4
+ ],
5
+ "attention_bias": false,
6
+ "attention_dropout": 0.0,
7
+ "decoder_sparse_step": 1,
8
+ "dtype": "bfloat16",
9
+ "eos_token_id": 151645,
10
+ "head_dim": 128,
11
+ "hidden_act": "silu",
12
+ "hidden_size": 6144,
13
+ "initializer_range": 0.02,
14
+ "intermediate_size": 8192,
15
+ "max_position_embeddings": 262144,
16
+ "max_window_layers": 62,
17
+ "mlp_only_layers": [],
18
+ "model_type": "qwen3_moe",
19
+ "moe_intermediate_size": 2560,
20
+ "norm_topk_prob": true,
21
+ "num_attention_heads": 96,
22
+ "num_experts": 120,
23
+ "num_experts_per_tok": 8,
24
+ "num_hidden_layers": 62,
25
+ "num_key_value_heads": 8,
26
+ "output_router_logits": false,
27
+ "qkv_bias": false,
28
+ "rms_norm_eps": 1e-06,
29
+ "rope_scaling": null,
30
+ "rope_theta": 10000000,
31
+ "router_aux_loss_coef": 0.0,
32
+ "shared_expert_intermediate_size": 0,
33
+ "sliding_window": null,
34
+ "tie_word_embeddings": false,
35
+ "transformers_version": "4.57.1",
36
+ "use_cache": true,
37
+ "use_qk_norm": true,
38
+ "use_sliding_window": false,
39
+ "vocab_size": 151936
40
+ }
generation_config.json ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "do_sample": true,
3
+ "eos_token_id": [
4
+ 151645,
5
+ 151643
6
+ ],
7
+ "pad_token_id": 151643,
8
+ "repetition_penalty": 1.05,
9
+ "temperature": 0.7,
10
+ "top_k": 20,
11
+ "top_p": 0.8,
12
+ "transformers_version": "4.57.1"
13
+ }
merges.txt ADDED
The diff for this file is too large to render. See raw diff
 
model-00001-of-00146.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f19ab5292156a36cb92f938ecebbb49bab9447fc68741eef2cfa4ec0c1a2e81e
3
+ size 4995330248
model-00002-of-00146.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:72512eb82e3520fb8af1df3ee34196d1ecb4ed534521f8bf64ee5f480937931b
3
+ size 4970269856
model-00003-of-00146.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:91a8f516c45b179de85eade62b27216784ce62b2da6d49a7773dff708afda7d0
3
+ size 4984352216
model-00004-of-00146.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fba40aad80301239bd8edfd2030fc3bb5f2a180a5b87de3302fc847224ef5fdc
3
+ size 4970269856
model-00005-of-00146.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:278b05706e4e15b035dee190902c571326148f8fb2e055706fb7726cc1d2216b
3
+ size 4970269904
model-00006-of-00146.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:30edfb6714500b5108707f57ba0a53e76a3ce954567ba07390792914706b97fc
3
+ size 4984352168
model-00007-of-00146.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:19d2c6928c69c9cea1d89ede14c403cb74dc793f3b6aa7ab886de305359fb774
3
+ size 4970269848
model-00008-of-00146.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:346b0d079f88c67f547a878ba7d8203157d49231b70c389cbbfa3ac64169e8a3
3
+ size 4984352216
model-00009-of-00146.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:75f164697ac199de977addcedf20be1811d3120fbe4b69b39b769f976b9f3183
3
+ size 4970269848
model-00010-of-00146.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:828f6f4d5b44e85a54f9ab7f352bae9b1ed959b745215e29542f66b2efe774f4
3
+ size 4984352216
model-00011-of-00146.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2c48bdc7fed11da360cdc4553d0b2c27489f311ccf6159dfaed726ba782f7ac7
3
+ size 4970269848
model-00012-of-00146.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:02436cff7073e04dd1fec83e3297e2f3f2ea4e6033d984fc4f136308e00843b5
3
+ size 4970269896
model-00013-of-00146.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:29096e21b25011975e0e9e369e42fb54840d3976653663245e48b87968531e2c
3
+ size 4984352168
model-00014-of-00146.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a1e0ffb18c9fe3e714b0ec1d228af7a1ee598bec2d9482cd467fa838b715d9b6
3
+ size 4970269848
model-00015-of-00146.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ae0648bd5cfd2e64b7072b867b4b0d910ff29dac7c7d606ed04230e6c249214d
3
+ size 4984352216
model-00016-of-00146.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c1fba987f964b9defcdc26d02115d59383ad8e54af2128a56215c8703b8a87fc
3
+ size 4970269848
model-00017-of-00146.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:289caa2d068e5564a285474787ae5f4db19a046b5329e0a92264a171d7fe2922
3
+ size 4984352224
model-00018-of-00146.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:85c406202841136d7dc2351e50e9c344b36f1a6fc0c6ce95f273bdd31cab6b42
3
+ size 4970269848
model-00019-of-00146.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b418c270a4ee14a3290d72265d034f886709bcc176a05830a16b4678f6f05d82
3
+ size 4970269896
model-00020-of-00146.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9105b35f25e5daaf621bbc3b90e4fbacd67bc42bf23b2f4596e073cdadb9b467
3
+ size 4984352176
model-00021-of-00146.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c9189d3c4503d92e6941df9ac93a693f3a402e44a4b67acdf378317c64822952
3
+ size 4970269856
model-00022-of-00146.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2000fec914e2bcd180708c805dd75472542131c7faef67037ef7ccaf199b6b67
3
+ size 4984352216
model-00023-of-00146.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7bb5deef9105916de35c4b837586a534bff1b8940981d5eada34efd5ef3e239d
3
+ size 4970269856
model-00024-of-00146.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:33bdbfef8681f24d0e8b9dcee41a98140e848d2b56b5cd78c1f4d2e0751a65bc
3
+ size 4984352272
model-00025-of-00146.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1f6ebcbc819e4c06ef0eb882890288a50976dc615ed755396d4d40e3a62e81f4
3
+ size 4970270000
model-00026-of-00146.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2df591047f9e64a6439d38509806fe0ccfb5e31403f564b210324c1ab90347c2
3
+ size 4970270048
model-00027-of-00146.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:49d718ae9c1f9ad992e8d3cc2155556393689669b20d3135a56da577d98f7d6e
3
+ size 4984352336
model-00028-of-00146.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f849048ae31de4fc6ac0ddb29bf572f0d3c9e11efa6465cd4e44d57bf70eb18e
3
+ size 4970270008
model-00029-of-00146.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:02c5482075783a14f81fbba11697eaceb868566634af297936c7b8b8afb818c8
3
+ size 4984352376
model-00030-of-00146.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:af3d5a974a0e5b7fb338b24171164bca42be9928b5e733810cb424624d32d618
3
+ size 4970270008
model-00031-of-00146.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:16388323511e069f814ff833b10da50127089cc20438d977ec864e9e4eb50f18
3
+ size 4984352384
model-00032-of-00146.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:61f2900944606a7fe1f4a439c9d6f737f412caf2ac9dfbcbb197bd9fe57f4496
3
+ size 4970270000
model-00033-of-00146.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8a1dd0aa1ade9e96635a919e6548641fd79dacccc192fe11d4e2f5e451c43ccc
3
+ size 4970270040
model-00034-of-00146.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c30f24b8e01d490cbb3a2b20404435f96300d63da0017b560a6e7e56e1943aaa
3
+ size 4984352336
model-00035-of-00146.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:312672d9e508fe7135aac5792c297cff51574f9879fd002d3013fdec0fb51159
3
+ size 4970270008
model-00036-of-00146.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b76ca6af04a553de14a1fba057e07e5c5e010d9c30e72dcbc73bb9a79806b5e0
3
+ size 4984352376
model-00037-of-00146.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0dd68ec8d5ed5ad51bd6922d0b4a543e277b01240d914d67c6bc568159756027
3
+ size 4970270008
model-00038-of-00146.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:06b71c508505b7662e19701b879ae088882301e6de1a2f8f8037ec2b334562ad
3
+ size 4984352392
model-00039-of-00146.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:372da1a10158718454828a9eb217900d3bddb366ca84a4e02ac979ebc15d44c0
3
+ size 4970269992
model-00040-of-00146.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c8ce7dd9217519139497ce05806d910f07f0c1cb462d5857168953feca9c9504
3
+ size 4970270040
model-00041-of-00146.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ff7c1958e9788554c240ceeed8bd2c7b137204c4e0edb5ae6bb82b77b89b77a2
3
+ size 4984352344
model-00042-of-00146.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:98ca420361cb05437ccc51036c02ed4b27bf2bdf44ae841952b8db21c4293175
3
+ size 4970270008
model-00043-of-00146.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2a90cea370b3b014408421c59f68e39b3883a520a15ae86c2018ceabb316d1a1
3
+ size 4984352376