lazarevich commited on
Commit
b446ed1
·
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-00099.safetensors +3 -0
  9. model-00002-of-00099.safetensors +3 -0
  10. model-00003-of-00099.safetensors +3 -0
  11. model-00004-of-00099.safetensors +3 -0
  12. model-00005-of-00099.safetensors +3 -0
  13. model-00006-of-00099.safetensors +3 -0
  14. model-00007-of-00099.safetensors +3 -0
  15. model-00008-of-00099.safetensors +3 -0
  16. model-00009-of-00099.safetensors +3 -0
  17. model-00010-of-00099.safetensors +3 -0
  18. model-00011-of-00099.safetensors +3 -0
  19. model-00012-of-00099.safetensors +3 -0
  20. model-00013-of-00099.safetensors +3 -0
  21. model-00014-of-00099.safetensors +3 -0
  22. model-00015-of-00099.safetensors +3 -0
  23. model-00016-of-00099.safetensors +3 -0
  24. model-00017-of-00099.safetensors +3 -0
  25. model-00018-of-00099.safetensors +3 -0
  26. model-00019-of-00099.safetensors +3 -0
  27. model-00020-of-00099.safetensors +3 -0
  28. model-00021-of-00099.safetensors +3 -0
  29. model-00022-of-00099.safetensors +3 -0
  30. model-00023-of-00099.safetensors +3 -0
  31. model-00024-of-00099.safetensors +3 -0
  32. model-00025-of-00099.safetensors +3 -0
  33. model-00026-of-00099.safetensors +3 -0
  34. model-00027-of-00099.safetensors +3 -0
  35. model-00028-of-00099.safetensors +3 -0
  36. model-00029-of-00099.safetensors +3 -0
  37. model-00030-of-00099.safetensors +3 -0
  38. model-00031-of-00099.safetensors +3 -0
  39. model-00032-of-00099.safetensors +3 -0
  40. model-00033-of-00099.safetensors +3 -0
  41. model-00034-of-00099.safetensors +3 -0
  42. model-00035-of-00099.safetensors +3 -0
  43. model-00036-of-00099.safetensors +3 -0
  44. model-00037-of-00099.safetensors +3 -0
  45. model-00038-of-00099.safetensors +3 -0
  46. model-00039-of-00099.safetensors +3 -0
  47. model-00040-of-00099.safetensors +3 -0
  48. model-00041-of-00099.safetensors +3 -0
  49. model-00042-of-00099.safetensors +3 -0
  50. model-00043-of-00099.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-246B-A35B
12
+ description: >
13
+ This model was obtained by uniformly pruning 50% of experts in Qwen3-Coder-480B-A35B-Instruct using the REAP method.
14
+ readme: >
15
+ https://huggingface.co/cerebras/Qwen3-Coder-REAP-246B-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-246B-A35B
28
+
29
+ ## ✨ Highlights
30
+
31
+ Introducing **Qwen3-Coder-REAP-246B-A35B**, a **memory-efficient compressed variant** of Qwen3-Coder-480B-A35B-Instruct that maintains near-identical performance while being **50% 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
+ - **50% Memory Reduction**: Compressed from 480B to 246B 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-246B-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**: 50% expert pruning
48
+ - **Type**: Sparse Mixture-of-Experts (SMoE) Causal Language Model
49
+ - **Number of Parameters**: 246B 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**: 80 (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-246B-A35B-FP8#%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-246B-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 **50% 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": 80,
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-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fc28ddd0af164d9aa29f19766d3ad4756aad1391e0376d14af17144f09385618
3
+ size 4994838728
model-00002-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f2593eb1bc9bc3fe622594a3267ae269f6be7c315c6c5295123ee3cf0e587fd5
3
+ size 4926253936
model-00003-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:19ad4b3a023fb2d845beea26eababa3e31b41ca3eb0ba5d47d72286c91309eaf
3
+ size 4996419144
model-00004-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:91da337d70b37c8ae427b4e5879bf998ec66f2722218d5ba704f78980bdf8feb
3
+ size 4983860640
model-00005-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bbb11c66df0f7d60dfb015e1ed39aca0d3e554f14468caf06f612152ab37c8f5
3
+ size 4970269856
model-00006-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c5805029db3e834fb7ba3e2d3116feac4fb98d82c8bd0b0d49b67183b9871d7c
3
+ size 4983860632
model-00007-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d91e1d24c540fdea61bfd5ed8b1d4ac5836253b119c7b32241983166a8e39a91
3
+ size 4983860640
model-00008-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:abf35d1498b35cf7522ad46d72280a021b88567e2a625bc05ef78f4ed709b419
3
+ size 4970269848
model-00009-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5dfbef48492209947e086caa5145a040c5309858e045b6fd51aee074a2ed6f47
3
+ size 4983860640
model-00010-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ce75779b385169602d208e96f0c8e0681796c8bba94cf0bd0223b0a3d8db651e
3
+ size 4983860656
model-00011-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:67c30810cdb755108e583467c616417763b4c05e906ea2d15aaf613546ec9724
3
+ size 4970269832
model-00012-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5783993d6cecc6fa8778958746eca7414735a15b74c77d58da6bb2b2038776a3
3
+ size 4983860640
model-00013-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1b15ecbf03e3c82d3a39c1c60f503b6bf0523851585da381109e283f655f9f84
3
+ size 4970269848
model-00014-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:542db5572f11b63c2247e02bf8276c4e6de80156ca800c3882e60e1e2926ff5e
3
+ size 4983860640
model-00015-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d840bda7de858be20f2f4dc6992b639bc271648ea4e871f0ea7196494d3fbe0b
3
+ size 4983860640
model-00016-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:15c225a06fd0e3f6c35277f6b28710ecd6d2bea6e8a64bbc6a2ecf3d189ca571
3
+ size 4970269856
model-00017-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:64de1c321efe700746a8a905067af515d9b4eddf76e2bfb316ad05abd4556ef5
3
+ size 4983860768
model-00018-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dc6acbff20fefefab601b537c06511bce30b306643b8bcb50d0644c33e5a1531
3
+ size 4983860800
model-00019-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:21dc3eb58e8e5c042e8b789c34ea8d7a2df93621087ba17faeff6c278c0a3350
3
+ size 4970270000
model-00020-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5c5ebdcdcc99fb53d2d72e7f1c8937a0b49875bb1f23195682a58cf44687a42c
3
+ size 4983860792
model-00021-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5c5b23d0e349d81d6196bde4afb4ddaf58e86bea6f24cc19c2810527b2722084
3
+ size 4894796688
model-00022-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ec93a84a4f51bbdeb4c583df16420b20e94e0475a82685a6a98353bf3f9ec459
3
+ size 4996419304
model-00023-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b8a94673362a5ac29e1a826006e426f614a4cd9756751a9a4b5b6095fbe22dd0
3
+ size 4983860792
model-00024-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:582511cdbf54022d55cd7ada69e305c118e10dcccf6bee2cae94731320cb0a1a
3
+ size 4970270008
model-00025-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3d2a775ec6281dec876eec50e6ef4147ed994e6177805a4a87ef2db9103f9aca
3
+ size 4983860792
model-00026-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:15e8ee98a2e93cdcb65537f89f8ec1707a6cde5c5110266b7d11b363f764e49b
3
+ size 4983860792
model-00027-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e1847d21dc313131a321ed769fbb8f12624bc05588789cd495bb62e369bb3524
3
+ size 4970270008
model-00028-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fe2b67b80e35086ccbdb395fe8b3d5fa4a4031f7fcf0f74954d05694dbb7f513
3
+ size 4983860792
model-00029-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:649e457471639153fd8fa228520748a6879641d3618c2ca11f5a37364051b96a
3
+ size 4983860816
model-00030-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f56a0a7b1d6b1225f5aada93d0f13f8332b79b354f36508e6c08c9b61601d651
3
+ size 4970269992
model-00031-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1d86406864bf978035633e6ceff29d56c9ed7f84bb20a57fa7a0f3f45b179fcc
3
+ size 4983860792
model-00032-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d8bee3c26512ba5595a414a72a12349da892cd1db6322e6a9af070814afa3671
3
+ size 4970270008
model-00033-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:faf5993045cd4656bf88b0958f48de52d6d839c3e6b1f9db11fb0bd17dcc7ffb
3
+ size 4983860792
model-00034-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:629733daaebe15cf1509473faccb22a01082ce77ee1518a89cfe43ccfb121c3d
3
+ size 4983860792
model-00035-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fa4634c4139badf659274a276606afc2054f1ede99d4cf3d967034d893ce967b
3
+ size 4970270008
model-00036-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4de631bcee59ef5a0eeb943e2fb20a168b9b2ba5b02e14cec989d05959f3b59d
3
+ size 4983860792
model-00037-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c5dd16594835fd0f502e4ba692aadb4bd58ed6735af9b27328cd03254b86d562
3
+ size 4983860800
model-00038-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2d022c7ab558e33cd76e6125fac1cf29f648162fa097714e897b78791da22aeb
3
+ size 4970270000
model-00039-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:184ca36ad7fd6c2e7553f220fc7da1da482b87830beb3a837376a9f19f2c1cbc
3
+ size 4983860792
model-00040-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e3745ab711d851ec6114884c5c8bf1a349401e4353f2f47b474b410f8f65dd13
3
+ size 4894796688
model-00041-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2375e658b47aae61cf172212f8c00b541f07028eb92ba37c9d1564df25c316f8
3
+ size 4996419304
model-00042-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2e4134407990399fa2a2e923b6b7e5ffa3095ba4d76bd9fe17e1897d38128fd7
3
+ size 4983860792
model-00043-of-00099.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:950277b97f69d6c3299e363cb69994c5c5605d5ea25c4e28565b39da2240a902
3
+ size 4970270008