Upload folder using huggingface_hub
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- .gitattributes +3 -0
- LICENSE +27 -0
- README.md +819 -0
- THIRD_PARTY_NOTICES.md +47 -0
- chat_template.jinja +37 -0
- config.json +72 -0
- configuration_deepseek.py +212 -0
- docs/deploy_guidance.md +196 -0
- docs/tool_call_guidance.md +241 -0
- figures/banner.png +3 -0
- figures/kimi-logo.png +0 -0
- generation_config.json +4 -0
- kimi-logo.png +0 -0
- model-1-of-61.safetensors +3 -0
- model-10-of-61.safetensors +3 -0
- model-11-of-61.safetensors +3 -0
- model-12-of-61.safetensors +3 -0
- model-13-of-61.safetensors +3 -0
- model-14-of-61.safetensors +3 -0
- model-15-of-61.safetensors +3 -0
- model-16-of-61.safetensors +3 -0
- model-17-of-61.safetensors +3 -0
- model-18-of-61.safetensors +3 -0
- model-19-of-61.safetensors +3 -0
- model-2-of-61.safetensors +3 -0
- model-20-of-61.safetensors +3 -0
- model-21-of-61.safetensors +3 -0
- model-22-of-61.safetensors +3 -0
- model-23-of-61.safetensors +3 -0
- model-24-of-61.safetensors +3 -0
- model-25-of-61.safetensors +3 -0
- model-26-of-61.safetensors +3 -0
- model-27-of-61.safetensors +3 -0
- model-28-of-61.safetensors +3 -0
- model-29-of-61.safetensors +3 -0
- model-3-of-61.safetensors +3 -0
- model-30-of-61.safetensors +3 -0
- model-31-of-61.safetensors +3 -0
- model-32-of-61.safetensors +3 -0
- model-33-of-61.safetensors +3 -0
- model-34-of-61.safetensors +3 -0
- model-35-of-61.safetensors +3 -0
- model-36-of-61.safetensors +3 -0
- model-37-of-61.safetensors +3 -0
- model-38-of-61.safetensors +3 -0
- model-39-of-61.safetensors +3 -0
- model-4-of-61.safetensors +3 -0
- model-40-of-61.safetensors +3 -0
- model-41-of-61.safetensors +3 -0
- model-42-of-61.safetensors +3 -0
.gitattributes
CHANGED
@@ -33,3 +33,6 @@ 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 |
+
model.safetensors.index.json filter=lfs diff=lfs merge=lfs -text
|
37 |
+
banner.png filter=lfs diff=lfs merge=lfs -text
|
38 |
+
figures/banner.png filter=lfs diff=lfs merge=lfs -text
|
LICENSE
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Modified MIT License
|
2 |
+
|
3 |
+
Copyright (c) 2025 Moonshot AI
|
4 |
+
|
5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6 |
+
of this software and associated documentation files (the “Software”), to deal
|
7 |
+
in the Software without restriction, including without limitation the rights
|
8 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9 |
+
copies of the Software, and to permit persons to whom the Software is
|
10 |
+
furnished to do so, subject to the following conditions:
|
11 |
+
|
12 |
+
The above copyright notice and this permission notice shall be included in all
|
13 |
+
copies or substantial portions of the Software.
|
14 |
+
|
15 |
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21 |
+
SOFTWARE.
|
22 |
+
|
23 |
+
Our only modification part is that, if the Software (or any derivative works
|
24 |
+
thereof) is used for any of your commercial products or services that have
|
25 |
+
more than 100 million monthly active users, or more than 20 million US dollars
|
26 |
+
(or equivalent in other currencies) in monthly revenue, you shall prominently
|
27 |
+
display "Kimi K2" on the user interface of such product or service.
|
README.md
ADDED
@@ -0,0 +1,819 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
tags:
|
3 |
+
- unsloth
|
4 |
+
base_model:
|
5 |
+
- moonshotai/Kimi-K2-Base
|
6 |
+
license: other
|
7 |
+
license_name: modified-mit
|
8 |
+
library_name: transformers
|
9 |
+
---
|
10 |
+
> [!NOTE]
|
11 |
+
> Includes our **chat template fixes**! <br> For `llama.cpp`, use `--jinja`
|
12 |
+
>
|
13 |
+
|
14 |
+
<div>
|
15 |
+
<p style="margin-top: 0;margin-bottom: 0;">
|
16 |
+
<em><a href="https://docs.unsloth.ai/basics/unsloth-dynamic-v2.0-gguf">Unsloth Dynamic 2.0</a> achieves superior accuracy & outperforms other leading quants.</em>
|
17 |
+
</p>
|
18 |
+
<div style="display: flex; gap: 5px; align-items: center; ">
|
19 |
+
<a href="https://github.com/unslothai/unsloth/">
|
20 |
+
<img src="https://github.com/unslothai/unsloth/raw/main/images/unsloth%20new%20logo.png" width="133">
|
21 |
+
</a>
|
22 |
+
<a href="https://discord.gg/unsloth">
|
23 |
+
<img src="https://github.com/unslothai/unsloth/raw/main/images/Discord%20button.png" width="173">
|
24 |
+
</a>
|
25 |
+
<a href="https://docs.unsloth.ai/">
|
26 |
+
<img src="https://raw.githubusercontent.com/unslothai/unsloth/refs/heads/main/images/documentation%20green%20button.png" width="143">
|
27 |
+
</a>
|
28 |
+
</div>
|
29 |
+
</div>
|
30 |
+
|
31 |
+
<div align="center">
|
32 |
+
<picture>
|
33 |
+
<img src="figures/kimi-logo.png" width="30%" alt="Kimi K2: Open Agentic Intellignece">
|
34 |
+
</picture>
|
35 |
+
</div>
|
36 |
+
|
37 |
+
<hr>
|
38 |
+
|
39 |
+
<div align="center" style="line-height:1">
|
40 |
+
<a href="https://www.kimi.com" target="_blank"><img alt="Chat" src="https://img.shields.io/badge/🤖%20Chat-Kimi%20K2-ff6b6b?color=1783ff&logoColor=white"/></a>
|
41 |
+
<a href="https://www.moonshot.ai" target="_blank"><img alt="Homepage" src="https://img.shields.io/badge/Homepage-Moonshot%20AI-white?logo=Kimi&logoColor=white"/></a>
|
42 |
+
</div>
|
43 |
+
|
44 |
+
<div align="center" style="line-height: 1;">
|
45 |
+
<a href="https://huggingface.co/moonshotai" target="_blank"><img alt="Hugging Face" src="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Moonshot%20AI-ffc107?color=ffc107&logoColor=white"/></a>
|
46 |
+
<a href="https://twitter.com/kimi_moonshot" target="_blank"><img alt="Twitter Follow" src="https://img.shields.io/badge/Twitter-Kimi.ai-white?logo=x&logoColor=white"/></a>
|
47 |
+
<a href="https://discord.gg/TYU2fdJykW" target="_blank"><img alt="Discord" src="https://img.shields.io/badge/Discord-Kimi.ai-white?logo=discord&logoColor=white"/></a>
|
48 |
+
</div>
|
49 |
+
|
50 |
+
<div align="center" style="line-height: 1;">
|
51 |
+
<a href="https://github.com/moonshotai/Kimi-K2/blob/main/LICENSE"><img alt="License" src="https://img.shields.io/badge/License-Modified_MIT-f5de53?&color=f5de53"/></a>
|
52 |
+
</div>
|
53 |
+
|
54 |
+
<p align="center">
|
55 |
+
<b>📰 <a href="https://moonshotai.github.io/Kimi-K2/">Tech Blog</a></b> | <b>📄 Paper Link (comming soon)</b>
|
56 |
+
</p>
|
57 |
+
|
58 |
+
## 1. Model Introduction
|
59 |
+
|
60 |
+
Kimi K2 is a state-of-the-art mixture-of-experts (MoE) language model with 32 billion activated parameters and 1 trillion total parameters. Trained with the Muon optimizer, Kimi K2 achieves exceptional performance across frontier knowledge, reasoning, and coding tasks while being meticulously optimized for agentic capabilities.
|
61 |
+
|
62 |
+
### Key Features
|
63 |
+
- Large-Scale Training: Pre-trained a 1T parameter MoE model on 15.5T tokens with zero training instability.
|
64 |
+
- MuonClip Optimizer: We apply the Muon optimizer to an unprecedented scale, and develop novel optimization techniques to resolve instabilities while scaling up.
|
65 |
+
- Agentic Intelligence: Specifically designed for tool use, reasoning, and autonomous problem-solving.
|
66 |
+
|
67 |
+
### Model Variants
|
68 |
+
- **Kimi-K2-Base**: The foundation model, a strong start for researchers and builders who want full control for fine-tuning and custom solutions.
|
69 |
+
- **Kimi-K2-Instruct**: The post-trained model best for drop-in, general-purpose chat and agentic experiences. It is a reflex-grade model without long thinking.
|
70 |
+
|
71 |
+
<div align="center">
|
72 |
+
<picture>
|
73 |
+
<img src="figures/banner.png" width="80%" alt="Evaluation Results">
|
74 |
+
</picture>
|
75 |
+
</div>
|
76 |
+
|
77 |
+
## 2. Model Summary
|
78 |
+
|
79 |
+
<div align="center">
|
80 |
+
|
81 |
+
|
82 |
+
| | |
|
83 |
+
|:---:|:---:|
|
84 |
+
| **Architecture** | Mixture-of-Experts (MoE) |
|
85 |
+
| **Total Parameters** | 1T |
|
86 |
+
| **Activated Parameters** | 32B |
|
87 |
+
| **Number of Layers** (Dense layer included) | 61 |
|
88 |
+
| **Number of Dense Layers** | 1 |
|
89 |
+
| **Attention Hidden Dimension** | 7168 |
|
90 |
+
| **MoE Hidden Dimension** (per Expert) | 2048 |
|
91 |
+
| **Number of Attention Heads** | 64 |
|
92 |
+
| **Number of Experts** | 384 |
|
93 |
+
| **Selected Experts per Token** | 8 |
|
94 |
+
| **Number of Shared Experts** | 1 |
|
95 |
+
| **Vocabulary Size** | 160K |
|
96 |
+
| **Context Length** | 128K |
|
97 |
+
| **Attention Mechanism** | MLA |
|
98 |
+
| **Activation Function** | SwiGLU |
|
99 |
+
</div>
|
100 |
+
|
101 |
+
## 3. Evaluation Results
|
102 |
+
|
103 |
+
#### Instruction model evaluation results
|
104 |
+
|
105 |
+
<div align="center">
|
106 |
+
<table>
|
107 |
+
<thead>
|
108 |
+
<tr>
|
109 |
+
<th align="center">Benchmark</th>
|
110 |
+
<th align="center">Metric</th>
|
111 |
+
<th align="center"><sup>Kimi K2 Instruct</sup></th>
|
112 |
+
<th align="center"><sup>DeepSeek-V3-0324</sup></th>
|
113 |
+
<th align="center"><sup>Qwen3-235B-A22B <br><sup>(non-thinking)</sup></sup></th>
|
114 |
+
<th align="center"><sup>Claude Sonnet 4 <br><sup>(w/o extended thinking)</sup></sup></th>
|
115 |
+
<th align="center"><sup>Claude Opus 4 <br><sup>(w/o extended thinking)</sup></sup></th>
|
116 |
+
<th align="center"><sup>GPT-4.1</sup></th>
|
117 |
+
<th align="center"><sup>Gemini 2.5 Flash <br> Preview (05-20)</sup></th>
|
118 |
+
</tr>
|
119 |
+
</thead>
|
120 |
+
<tbody>
|
121 |
+
<tr>
|
122 |
+
<td align="center" colspan=9><strong>Coding Tasks</strong></td>
|
123 |
+
</tr>
|
124 |
+
<tr>
|
125 |
+
<td align="center">LiveCodeBench v6<br><sup>(Aug 24 - May 25)</sup></td>
|
126 |
+
<td align="center">Pass@1</td>
|
127 |
+
<td align="center"><strong>53.7</strong></td>
|
128 |
+
<td align="center">46.9</td>
|
129 |
+
<td align="center">37.0</td>
|
130 |
+
<td align="center">48.5</td>
|
131 |
+
<td align="center">47.4</td>
|
132 |
+
<td align="center">44.7</td>
|
133 |
+
<td align="center">44.7</td>
|
134 |
+
</tr>
|
135 |
+
<tr>
|
136 |
+
<td align="center">OJBench</td>
|
137 |
+
<td align="center">Pass@1</td>
|
138 |
+
<td align="center"><strong>27.1</strong></td>
|
139 |
+
<td align="center">24.0</td>
|
140 |
+
<td align="center">11.3</td>
|
141 |
+
<td align="center">15.3</td>
|
142 |
+
<td align="center">19.6</td>
|
143 |
+
<td align="center">19.5</td>
|
144 |
+
<td align="center">19.5</td>
|
145 |
+
</tr>
|
146 |
+
|
147 |
+
<tr>
|
148 |
+
<td align="center">MultiPL-E</td>
|
149 |
+
<td align="center">Pass@1</td>
|
150 |
+
<td align="center"><ins><strong>85.7</strong></ins></td>
|
151 |
+
<td align="center">83.1</td>
|
152 |
+
<td align="center">78.2</td>
|
153 |
+
<td align="center">88.6</td>
|
154 |
+
<td align="center"><strong>89.6</strong></td>
|
155 |
+
<td align="center">86.7</td>
|
156 |
+
<td align="center">85.6</td>
|
157 |
+
</tr>
|
158 |
+
|
159 |
+
<tr>
|
160 |
+
<td align="center">SWE-bench Verified <br/><sup>(Agentless Coding)</sup></td>
|
161 |
+
<td align="center">Single Patch w/o Test (Acc)</td>
|
162 |
+
<td align="center"><ins><strong>51.8</strong></ins></td>
|
163 |
+
<td align="center">36.6</td>
|
164 |
+
<td align="center">39.4</td>
|
165 |
+
<td align="center">50.2</td>
|
166 |
+
<td align="center"><strong>53.0</strong></td>
|
167 |
+
<td align="center">40.8</td>
|
168 |
+
<td align="center">32.6</td>
|
169 |
+
</tr>
|
170 |
+
|
171 |
+
<tr>
|
172 |
+
<td align="center" rowspan="2">SWE-bench Verified <br/> <sup>(Agentic Coding)</sup></td>
|
173 |
+
<td align="center">Single Attempt (Acc)</td>
|
174 |
+
<td align="center"><ins><strong>65.8</strong></ins></td>
|
175 |
+
<td align="center">38.8</td>
|
176 |
+
<td align="center">34.4</td>
|
177 |
+
<td align="center"><strong>72.7</strong><sup>*</sup></td>
|
178 |
+
<td align="center">72.5<sup>*</sup></td>
|
179 |
+
<td align="center">54.6</td>
|
180 |
+
<td align="center">—</td>
|
181 |
+
</tr>
|
182 |
+
|
183 |
+
<tr>
|
184 |
+
<!--<td align="center">(Agentic Coding)</td>-->
|
185 |
+
<td align="center">Multiple Attempts (Acc)</td>
|
186 |
+
<td align="center"><ins><strong>71.6</strong></ins></td>
|
187 |
+
<td align="center">—</td>
|
188 |
+
<td align="center">—</td>
|
189 |
+
<td align="center"><strong>80.2</strong></td>
|
190 |
+
<td align="center">79.4<sup>*</sup></td>
|
191 |
+
<td align="center">—</td>
|
192 |
+
<td align="center">—</td>
|
193 |
+
</tr>
|
194 |
+
|
195 |
+
<tr>
|
196 |
+
<td align="center">SWE-bench Multilingual<br /> <sup>(Agentic Coding)</sup></td>
|
197 |
+
<td align="center">Single Attempt (Acc)</td>
|
198 |
+
<td align="center"><ins><strong>47.3</strong> </ins></td>
|
199 |
+
<td align="center">25.8</td>
|
200 |
+
<td align="center">20.9</td>
|
201 |
+
<td align="center"><strong>51.0</strong></td>
|
202 |
+
<td align="center">—</td>
|
203 |
+
<td align="center">31.5</td>
|
204 |
+
<td align="center">—</td>
|
205 |
+
</tr>
|
206 |
+
|
207 |
+
<tr>
|
208 |
+
<td align="center" rowspan="2">TerminalBench</td>
|
209 |
+
<td align="center">Inhouse Framework (Acc)</td>
|
210 |
+
<td align="center"><ins><strong>30.0</strong></ins></td>
|
211 |
+
<td align="center">—</td>
|
212 |
+
<td align="center">—</td>
|
213 |
+
<td align="center">35.5</td>
|
214 |
+
<td align="center"><strong>43.2</strong></td>
|
215 |
+
<td align="center">8.3</td>
|
216 |
+
<td align="center">—</td>
|
217 |
+
</tr>
|
218 |
+
|
219 |
+
<tr>
|
220 |
+
<!--<td align="center">TerminalBench</td>-->
|
221 |
+
<td align="center">Terminus (Acc)</td>
|
222 |
+
<td align="center"><ins><strong>25.0</strong> </ins></td>
|
223 |
+
<td align="center">16.3</td>
|
224 |
+
<td align="center">6.6</td>
|
225 |
+
<td align="center">—</td>
|
226 |
+
<td align="center">—</td>
|
227 |
+
<td align="center"><strong>30.3</strong></td>
|
228 |
+
<td align="center">16.8</td>
|
229 |
+
</tr>
|
230 |
+
<tr>
|
231 |
+
<td align="center">Aider-Polyglot</td>
|
232 |
+
<td align="center">Acc</td>
|
233 |
+
<td align="center">60.0</td>
|
234 |
+
<td align="center">55.1</td>
|
235 |
+
<td align="center"><ins><strong>61.8</strong></ins></td>
|
236 |
+
<td align="center">56.4</td>
|
237 |
+
<td align="center"><strong>70.7</strong></td>
|
238 |
+
<td align="center">52.4</td>
|
239 |
+
<td align="center">44.0</td>
|
240 |
+
</tr>
|
241 |
+
<tr>
|
242 |
+
<td align="center" colspan=9><strong>Tool Use Tasks</strong></td>
|
243 |
+
</tr>
|
244 |
+
<tr>
|
245 |
+
<td align="center">Tau2 retail</td>
|
246 |
+
<td align="center">Avg@4</td>
|
247 |
+
<td align="center"><ins><strong>70.6</strong></ins></td>
|
248 |
+
<td align="center">69.1</td>
|
249 |
+
<td align="center">57.0</td>
|
250 |
+
<td align="center">75.0</td>
|
251 |
+
<td align="center"><strong>81.8</strong></td>
|
252 |
+
<td align="center">74.8</td>
|
253 |
+
<td align="center">64.3</td>
|
254 |
+
</tr>
|
255 |
+
<tr>
|
256 |
+
<td align="center">Tau2 airline</td>
|
257 |
+
<td align="center">Avg@4</td>
|
258 |
+
<td align="center"><ins><strong>56.5</strong></ins></td>
|
259 |
+
<td align="center">39.0</td>
|
260 |
+
<td align="center">26.5</td>
|
261 |
+
<td align="center">55.5</td>
|
262 |
+
<td align="center"><strong>60.0</strong></td>
|
263 |
+
<td align="center">54.5</td>
|
264 |
+
<td align="center">42.5</td>
|
265 |
+
</tr>
|
266 |
+
<tr>
|
267 |
+
<td align="center">Tau2 telecom</td>
|
268 |
+
<td align="center">Avg@4</td>
|
269 |
+
<td align="center"><strong>65.8</strong></td>
|
270 |
+
<td align="center">32.5</td>
|
271 |
+
<td align="center">22.1</td>
|
272 |
+
<td align="center">45.2</td>
|
273 |
+
<td align="center">57.0</td>
|
274 |
+
<td align="center">38.6</td>
|
275 |
+
<td align="center">16.9</td>
|
276 |
+
</tr>
|
277 |
+
<tr>
|
278 |
+
<td align="center">AceBench</td>
|
279 |
+
<td align="center">Acc</td>
|
280 |
+
<td align="center"><ins><strong>76.5</strong></ins></td>
|
281 |
+
<td align="center">72.7</td>
|
282 |
+
<td align="center">70.5</td>
|
283 |
+
<td align="center">76.2</td>
|
284 |
+
<td align="center">75.6</td>
|
285 |
+
<td align="center"><strong>80.1</strong></td>
|
286 |
+
<td align="center">74.5</td>
|
287 |
+
</tr>
|
288 |
+
<tr>
|
289 |
+
<td align="center" colspan=9><strong>Math & STEM Tasks</strong></td>
|
290 |
+
</tr>
|
291 |
+
<tr>
|
292 |
+
<td align="center">AIME 2024</td>
|
293 |
+
<td align="center">Avg@64</td>
|
294 |
+
<td align="center"><strong>69.6</strong></td>
|
295 |
+
<td align="center">59.4<sup>*</sup></td>
|
296 |
+
<td align="center">40.1<sup>*</sup></td>
|
297 |
+
<td align="center">43.4</td>
|
298 |
+
<td align="center">48.2</td>
|
299 |
+
<td align="center">46.5</td>
|
300 |
+
<td align="center">61.3</td>
|
301 |
+
</tr>
|
302 |
+
<tr>
|
303 |
+
<td align="center">AIME 2025</td>
|
304 |
+
<td align="center">Avg@64</td>
|
305 |
+
<td align="center"><strong>49.5</strong></td>
|
306 |
+
<td align="center">46.7</td>
|
307 |
+
<td align="center">24.7<sup>*</sup></td>
|
308 |
+
<td align="center">33.1<sup>*</sup></td>
|
309 |
+
<td align="center">33.9<sup>*</sup></td>
|
310 |
+
<td align="center">37.0</td>
|
311 |
+
<td align="center">46.6</td>
|
312 |
+
</tr>
|
313 |
+
<tr>
|
314 |
+
<td align="center">MATH-500</td>
|
315 |
+
<td align="center">Acc</td>
|
316 |
+
<td align="center"><strong>97.4</strong></td>
|
317 |
+
<td align="center">94.0<sup>*</sup></td>
|
318 |
+
<td align="center">91.2<sup>*</sup></td>
|
319 |
+
<td align="center">94.0</td>
|
320 |
+
<td align="center">94.4</td>
|
321 |
+
<td align="center">92.4</td>
|
322 |
+
<td align="center">95.4</td>
|
323 |
+
</tr>
|
324 |
+
<tr>
|
325 |
+
<td align="center">HMMT 2025</td>
|
326 |
+
<td align="center">Avg@32</td>
|
327 |
+
<td align="center"><strong>38.8</strong></td>
|
328 |
+
<td align="center">27.5</td>
|
329 |
+
<td align="center">11.9</td>
|
330 |
+
<td align="center">15.9</td>
|
331 |
+
<td align="center">15.9</td>
|
332 |
+
<td align="center">19.4</td>
|
333 |
+
<td align="center">34.7</td>
|
334 |
+
</tr>
|
335 |
+
<tr>
|
336 |
+
<td align="center">CNMO 2024</td>
|
337 |
+
<td align="center">Avg@16</td>
|
338 |
+
<td align="center">74.3</td>
|
339 |
+
<td align="center"><ins><strong>74.7</strong></ins></td>
|
340 |
+
<td align="center">48.6</td>
|
341 |
+
<td align="center">60.4</td>
|
342 |
+
<td align="center">57.6</td>
|
343 |
+
<td align="center">56.6</td>
|
344 |
+
<td align="center"><strong>75.0</strong></td>
|
345 |
+
</tr>
|
346 |
+
<tr>
|
347 |
+
<td align="center">PolyMath-en</td>
|
348 |
+
<td align="center">Avg@4</td>
|
349 |
+
<td align="center"><strong>65.1</strong></td>
|
350 |
+
<td align="center">59.5</td>
|
351 |
+
<td align="center">51.9</td>
|
352 |
+
<td align="center">52.8</td>
|
353 |
+
<td align="center">49.8</td>
|
354 |
+
<td align="center">54.0</td>
|
355 |
+
<td align="center">49.9</td>
|
356 |
+
</tr>
|
357 |
+
|
358 |
+
<tr>
|
359 |
+
<td align="center">ZebraLogic</td>
|
360 |
+
<td align="center">Acc</td>
|
361 |
+
<td align="center"><strong>89.0</strong></td>
|
362 |
+
<td align="center">84.0</td>
|
363 |
+
<td align="center">37.7<sup>*</sup></td>
|
364 |
+
<td align="center">73.7</td>
|
365 |
+
<td align="center">59.3</td>
|
366 |
+
<td align="center">58.5</td>
|
367 |
+
<td align="center">57.9</td>
|
368 |
+
</tr>
|
369 |
+
|
370 |
+
<tr>
|
371 |
+
<td align="center">AutoLogi</td>
|
372 |
+
<td align="center">Acc</td>
|
373 |
+
<td align="center"><ins><strong>89.5</strong></ins></td>
|
374 |
+
<td align="center">88.9</td>
|
375 |
+
<td align="center">83.3</td>
|
376 |
+
<td align="center"><strong>89.8</strong></td>
|
377 |
+
<td align="center">86.1</td>
|
378 |
+
<td align="center">88.2</td>
|
379 |
+
<td align="center">84.1</td>
|
380 |
+
</tr>
|
381 |
+
|
382 |
+
<tr>
|
383 |
+
<td align="center">GPQA-Diamond</td>
|
384 |
+
<td align="center">Avg@8</td>
|
385 |
+
<td align="center"><strong>75.1</strong></td>
|
386 |
+
<td align="center">68.4<sup>*</sup></td>
|
387 |
+
<td align="center">62.9<sup>*</sup></td>
|
388 |
+
<td align="center">70.0<sup>*</sup></td>
|
389 |
+
<td align="center">74.9<sup>*</sup></td>
|
390 |
+
<td align="center">66.3</td>
|
391 |
+
<td align="center">68.2</td>
|
392 |
+
</tr>
|
393 |
+
|
394 |
+
<tr>
|
395 |
+
<td align="center">SuperGPQA</td>
|
396 |
+
<td align="center">Acc</td>
|
397 |
+
<td align="center"><strong>57.2</strong></td>
|
398 |
+
<td align="center">53.7</td>
|
399 |
+
<td align="center">50.2</td>
|
400 |
+
<td align="center">55.7</td>
|
401 |
+
<td align="center">56.5</td>
|
402 |
+
<td align="center">50.8</td>
|
403 |
+
<td align="center">49.6</td>
|
404 |
+
</tr>
|
405 |
+
|
406 |
+
<tr>
|
407 |
+
<td align="center">Humanity's Last Exam<br><sup>(Text Only)</sup></td>
|
408 |
+
<td align="center">-</td>
|
409 |
+
<td align="center">4.7</td>
|
410 |
+
<td align="center">5.2</td>
|
411 |
+
<td align="center"><ins><strong>5.7</strong></ins></td>
|
412 |
+
<td align="center">5.8</td>
|
413 |
+
<td align="center"><strong>7.1</strong></td>
|
414 |
+
<td align="center">3.7</td>
|
415 |
+
<td align="center">5.6</td>
|
416 |
+
</tr>
|
417 |
+
|
418 |
+
<tr>
|
419 |
+
<td align="center" colspan=9><strong>General Tasks</strong></td>
|
420 |
+
</tr>
|
421 |
+
|
422 |
+
<tr>
|
423 |
+
<td align="center">MMLU</td>
|
424 |
+
<td align="center">EM</td>
|
425 |
+
<td align="center"><ins><strong>89.5</strong></ins></td>
|
426 |
+
<td align="center">89.4</td>
|
427 |
+
<td align="center">87.0</td>
|
428 |
+
<td align="center">91.5</td>
|
429 |
+
<td align="center"><strong>92.9</strong></td>
|
430 |
+
<td align="center">90.4</td>
|
431 |
+
<td align="center">90.1</td>
|
432 |
+
</tr>
|
433 |
+
|
434 |
+
<tr>
|
435 |
+
<td align="center">MMLU-Redux</td>
|
436 |
+
<td align="center">EM</td>
|
437 |
+
<td align="center"><ins><strong>92.7</strong></ins></td>
|
438 |
+
<td align="center">90.5</td>
|
439 |
+
<td align="center">89.2</td>
|
440 |
+
<td align="center">93.6</td>
|
441 |
+
<td align="center"><strong>94.2</strong></td>
|
442 |
+
<td align="center">92.4</td>
|
443 |
+
<td align="center">90.6</td>
|
444 |
+
</tr>
|
445 |
+
|
446 |
+
<tr>
|
447 |
+
<td align="center">MMLU-Pro</td>
|
448 |
+
<td align="center">EM</td>
|
449 |
+
<td align="center">81.1</td>
|
450 |
+
<td align="center"><ins><strong>81.2</strong></ins><sup>*</sup></td>
|
451 |
+
<td align="center">77.3</td>
|
452 |
+
<td align="center">83.7</td>
|
453 |
+
<td align="center"><strong>86.6</strong></td>
|
454 |
+
<td align="center">81.8</td>
|
455 |
+
<td align="center">79.4</td>
|
456 |
+
</tr>
|
457 |
+
|
458 |
+
<tr>
|
459 |
+
<td align="center">IFEval</td>
|
460 |
+
<td align="center">Prompt Strict</td>
|
461 |
+
<td align="center"><strong>89.8</strong></td>
|
462 |
+
<td align="center">81.1</td>
|
463 |
+
<td align="center">83.2<sup>*</sup></td>
|
464 |
+
<td align="center">87.6</td>
|
465 |
+
<td align="center">87.4</td>
|
466 |
+
<td align="center">88.0</td>
|
467 |
+
<td align="center">84.3</td>
|
468 |
+
</tr>
|
469 |
+
|
470 |
+
<tr>
|
471 |
+
<td align="center">Multi-Challenge</td>
|
472 |
+
<td align="center">Acc</td>
|
473 |
+
<td align="center"><strong>54.1</strong></td>
|
474 |
+
<td align="center">31.4</td>
|
475 |
+
<td align="center">34.0</td>
|
476 |
+
<td align="center">46.8</td>
|
477 |
+
<td align="center">49.0</td>
|
478 |
+
<td align="center">36.4</td>
|
479 |
+
<td align="center">39.5</td>
|
480 |
+
</tr>
|
481 |
+
|
482 |
+
<tr>
|
483 |
+
<td align="center">SimpleQA</td>
|
484 |
+
<td align="center">Correct</td>
|
485 |
+
<td align="center"><ins><strong>31.0</strong></ins></td>
|
486 |
+
<td align="center">27.7</td>
|
487 |
+
<td align="center">13.2</td>
|
488 |
+
<td align="center">15.9</td>
|
489 |
+
<td align="center">22.8</td>
|
490 |
+
<td align="center"><strong>42.3</strong></td>
|
491 |
+
<td align="center">23.3</td>
|
492 |
+
</tr>
|
493 |
+
|
494 |
+
<tr>
|
495 |
+
<td align="center">Livebench</td>
|
496 |
+
<td align="center">Pass@1</td>
|
497 |
+
<td align="center"><strong>76.4</strong></td>
|
498 |
+
<td align="center">72.4</td>
|
499 |
+
<td align="center">67.6</td>
|
500 |
+
<td align="center">74.8</td>
|
501 |
+
<td align="center">74.6</td>
|
502 |
+
<td align="center">69.8</td>
|
503 |
+
<td align="center">67.8</td>
|
504 |
+
</tr>
|
505 |
+
</tbody>
|
506 |
+
</table>
|
507 |
+
</div>
|
508 |
+
<sup>
|
509 |
+
• Bold denotes global SOTA, and underlined denotes open-source SOTA.
|
510 |
+
</sup><br/><sup>
|
511 |
+
• Data points marked with * are taken directly from the model's tech report or blog.
|
512 |
+
</sup><br/><sup>
|
513 |
+
• All metrics, except for SWE-bench Verified (Agentless), are evaluated with an 8k output token length. SWE-bench Verified (Agentless) is limited to a 16k output token length.
|
514 |
+
</sup><br/><sup>
|
515 |
+
• Kimi K2 achieves 65.8% pass@1 on the SWE-bench Verified tests with bash/editor tools (single-attempt patches, no test-time compute). It also achieves a 47.3% pass@1 on the SWE-bench Multilingual tests under the same conditions. Additionally, we report results on SWE-bench Verified tests (71.6%) that leverage parallel test-time compute by sampling multiple sequences and selecting the single best via an internal scoring model.
|
516 |
+
</sup><br/><sup>
|
517 |
+
• To ensure the stability of the evaluation, we employed avg@k on the AIME, HMMT, CNMO, PolyMath-en, GPQA-Diamond, EvalPlus, Tau2.
|
518 |
+
</sup><br/><sup>
|
519 |
+
• Some data points have been omitted due to prohibitively expensive evaluation costs.
|
520 |
+
</sup>
|
521 |
+
|
522 |
+
---
|
523 |
+
|
524 |
+
#### Base model evaluation results
|
525 |
+
|
526 |
+
<div align="center">
|
527 |
+
|
528 |
+
<table>
|
529 |
+
<thead>
|
530 |
+
<tr>
|
531 |
+
<th align="center">Benchmark</th>
|
532 |
+
<th align="center">Metric</th>
|
533 |
+
<th align="center">Shot</th>
|
534 |
+
<th align="center">Kimi K2 Base</th>
|
535 |
+
<th align="center">Deepseek-V3-Base</th>
|
536 |
+
<th align="center">Qwen2.5-72B</th>
|
537 |
+
<th align="center">Llama 4 Maverick</th>
|
538 |
+
</tr>
|
539 |
+
</thead>
|
540 |
+
<tbody>
|
541 |
+
<tr>
|
542 |
+
<td align="center" colspan="7"><strong>General Tasks</strong></td>
|
543 |
+
</tr>
|
544 |
+
<tr>
|
545 |
+
<td align="center">MMLU</td>
|
546 |
+
<td align="center">EM</td>
|
547 |
+
<td align="center">5-shot</td>
|
548 |
+
<td align="center"><strong>87.8</strong></td>
|
549 |
+
<td align="center">87.1</td>
|
550 |
+
<td align="center">86.1</td>
|
551 |
+
<td align="center">84.9</td>
|
552 |
+
</tr>
|
553 |
+
<tr>
|
554 |
+
<td align="center">MMLU-pro</td>
|
555 |
+
<td align="center">EM</td>
|
556 |
+
<td align="center">5-shot</td>
|
557 |
+
<td align="center"><strong>69.2</strong></td>
|
558 |
+
<td align="center">60.6</td>
|
559 |
+
<td align="center">62.8</td>
|
560 |
+
<td align="center">63.5</td>
|
561 |
+
</tr>
|
562 |
+
<tr>
|
563 |
+
<td align="center">MMLU-redux-2.0</td>
|
564 |
+
<td align="center">EM</td>
|
565 |
+
<td align="center">5-shot</td>
|
566 |
+
<td align="center"><strong>90.2</strong></td>
|
567 |
+
<td align="center">89.5</td>
|
568 |
+
<td align="center">87.8</td>
|
569 |
+
<td align="center">88.2</td>
|
570 |
+
</tr>
|
571 |
+
<tr>
|
572 |
+
<td align="center">SimpleQA</td>
|
573 |
+
<td align="center">Correct</td>
|
574 |
+
<td align="center">5-shot</td>
|
575 |
+
<td align="center"><strong>35.3</strong></td>
|
576 |
+
<td align="center">26.5</td>
|
577 |
+
<td align="center">10.3</td>
|
578 |
+
<td align="center">23.7</td>
|
579 |
+
</tr>
|
580 |
+
<tr>
|
581 |
+
<td align="center">TriviaQA</td>
|
582 |
+
<td align="center">EM</td>
|
583 |
+
<td align="center">5-shot</td>
|
584 |
+
<td align="center"><strong>85.1</strong></td>
|
585 |
+
<td align="center">84.1</td>
|
586 |
+
<td align="center">76.0</td>
|
587 |
+
<td align="center">79.3</td>
|
588 |
+
</tr>
|
589 |
+
<tr>
|
590 |
+
<td align="center">GPQA-Diamond</td>
|
591 |
+
<td align="center">Avg@8</td>
|
592 |
+
<td align="center">5-shot</td>
|
593 |
+
<td align="center">48.1</td>
|
594 |
+
<td align="center"><strong>50.5</strong></td>
|
595 |
+
<td align="center">40.8</td>
|
596 |
+
<td align="center">49.4</td>
|
597 |
+
</tr>
|
598 |
+
<tr>
|
599 |
+
<td align="center">SuperGPQA</td>
|
600 |
+
<td align="center">EM</td>
|
601 |
+
<td align="center">5-shot</td>
|
602 |
+
<td align="center"><strong>44.7</strong></td>
|
603 |
+
<td align="center">39.2</td>
|
604 |
+
<td align="center">34.2</td>
|
605 |
+
<td align="center">38.8</td>
|
606 |
+
</tr>
|
607 |
+
<tr>
|
608 |
+
<td align="center" colspan="7"><strong>Coding Tasks</strong></td>
|
609 |
+
</tr>
|
610 |
+
<tr>
|
611 |
+
<td align="center">LiveCodeBench v6</td>
|
612 |
+
<td align="center">Pass@1</td>
|
613 |
+
<td align="center">1-shot</td>
|
614 |
+
<td align="center"><strong>26.3</strong></td>
|
615 |
+
<td align="center">22.9</td>
|
616 |
+
<td align="center">21.1</td>
|
617 |
+
<td align="center">25.1</td>
|
618 |
+
</tr>
|
619 |
+
<tr>
|
620 |
+
<td align="center">EvalPlus</td>
|
621 |
+
<td align="center">Pass@1</td>
|
622 |
+
<td align="center">-</td>
|
623 |
+
<td align="center"><strong>80.3</strong></td>
|
624 |
+
<td align="center">65.6</td>
|
625 |
+
<td align="center">66.0</td>
|
626 |
+
<td align="center">65.5</td>
|
627 |
+
</tr>
|
628 |
+
<tr>
|
629 |
+
<td align="center" colspan="7"><strong>Mathematics Tasks</strong></td>
|
630 |
+
</tr>
|
631 |
+
<tr>
|
632 |
+
<td align="center">MATH</td>
|
633 |
+
<td align="center">EM</td>
|
634 |
+
<td align="center">4-shot</td>
|
635 |
+
<td align="center"><strong>70.2</strong></td>
|
636 |
+
<td align="center">60.1</td>
|
637 |
+
<td align="center">61.0</td>
|
638 |
+
<td align="center">63.0</td>
|
639 |
+
</tr>
|
640 |
+
<tr>
|
641 |
+
<td align="center">GSM8k</td>
|
642 |
+
<td align="center">EM</td>
|
643 |
+
<td align="center">8-shot</td>
|
644 |
+
<td align="center"><strong>92.1</strong></td>
|
645 |
+
<td align="center">91.7</td>
|
646 |
+
<td align="center">90.4</td>
|
647 |
+
<td align="center">86.3</td>
|
648 |
+
</tr>
|
649 |
+
<tr>
|
650 |
+
<td align="center" colspan="7"><strong>Chinese Tasks</strong></td>
|
651 |
+
</tr>
|
652 |
+
<tr>
|
653 |
+
<td align="center">C-Eval</td>
|
654 |
+
<td align="center">EM</td>
|
655 |
+
<td align="center">5-shot</td>
|
656 |
+
<td align="center"><strong>92.5</strong></td>
|
657 |
+
<td align="center">90.0</td>
|
658 |
+
<td align="center">90.9</td>
|
659 |
+
<td align="center">80.9</td>
|
660 |
+
</tr>
|
661 |
+
<tr>
|
662 |
+
<td align="center">CSimpleQA</td>
|
663 |
+
<td align="center">Correct</td>
|
664 |
+
<td align="center">5-shot</td>
|
665 |
+
<td align="center"><strong>77.6</strong></td>
|
666 |
+
<td align="center">72.1</td>
|
667 |
+
<td align="center">50.5</td>
|
668 |
+
<td align="center">53.5</td>
|
669 |
+
</tr>
|
670 |
+
</tbody>
|
671 |
+
</table>
|
672 |
+
</div>
|
673 |
+
<sup>
|
674 |
+
• We only evaluate open-source pretrained models in this work. We report results for Qwen2.5-72B because the base checkpoint for Qwen3-235B-A22B was not open-sourced at the time of our study.
|
675 |
+
</sup><br/><sup>
|
676 |
+
• All models are evaluated using the same evaluation protocol.
|
677 |
+
|
678 |
+
</sup>
|
679 |
+
|
680 |
+
|
681 |
+
## 4. Deployment
|
682 |
+
> [!Note]
|
683 |
+
> You can access Kimi K2's API on https://platform.moonshot.ai , we provide OpenAI/Anthropic-compatible API for you.
|
684 |
+
>
|
685 |
+
> The Anthropic-compatible API maps temperature by `real_temperature = request_temperature * 0.6` for better compatible with existing applications.
|
686 |
+
|
687 |
+
Our model checkpoints are stored in the block-fp8 format, you can find it on [Huggingface](https://huggingface.co/moonshotai/Kimi-K2-Instruct).
|
688 |
+
|
689 |
+
Currently, Kimi-K2 is recommended to run on the following inference engines:
|
690 |
+
|
691 |
+
* vLLM
|
692 |
+
* SGLang
|
693 |
+
* KTransformers
|
694 |
+
* TensorRT-LLM
|
695 |
+
|
696 |
+
Deployment examples for vLLM and SGLang can be found in the [Model Deployment Guide](docs/deploy_guidance.md).
|
697 |
+
|
698 |
+
---
|
699 |
+
|
700 |
+
## 5. Model Usage
|
701 |
+
|
702 |
+
### Chat Completion
|
703 |
+
|
704 |
+
Once the local inference service is up, you can interact with it through the chat endpoint:
|
705 |
+
|
706 |
+
```python
|
707 |
+
def simple_chat(client: OpenAI, model_name: str):
|
708 |
+
messages = [
|
709 |
+
{"role": "system", "content": "You are Kimi, an AI assistant created by Moonshot AI."},
|
710 |
+
{"role": "user", "content": [{"type": "text", "text": "Please give a brief self-introduction."}]},
|
711 |
+
]
|
712 |
+
response = client.chat.completions.create(
|
713 |
+
model=model_name,
|
714 |
+
messages=messages,
|
715 |
+
stream=False,
|
716 |
+
temperature=0.6,
|
717 |
+
max_tokens=256
|
718 |
+
)
|
719 |
+
print(response.choices[0].message.content)
|
720 |
+
```
|
721 |
+
|
722 |
+
> [!NOTE]
|
723 |
+
> The recommended temperature for Kimi-K2-Instruct is `temperature = 0.6`.
|
724 |
+
> If no special instructions are required, the system prompt above is a good default.
|
725 |
+
|
726 |
+
---
|
727 |
+
|
728 |
+
### Tool Calling
|
729 |
+
|
730 |
+
Kimi-K2-Instruct has strong tool-calling capabilities.
|
731 |
+
To enable them, you need to pass the list of available tools in each request, then the model will autonomously decide when and how to invoke them.
|
732 |
+
|
733 |
+
The following example demonstrates calling a weather tool end-to-end:
|
734 |
+
|
735 |
+
```python
|
736 |
+
# Your tool implementation
|
737 |
+
def get_weather(city: str) -> dict:
|
738 |
+
return {"weather": "Sunny"}
|
739 |
+
|
740 |
+
# Tool schema definition
|
741 |
+
tools = [{
|
742 |
+
"type": "function",
|
743 |
+
"function": {
|
744 |
+
"name": "get_weather",
|
745 |
+
"description": "Retrieve current weather information. Call this when the user asks about the weather.",
|
746 |
+
"parameters": {
|
747 |
+
"type": "object",
|
748 |
+
"required": ["city"],
|
749 |
+
"properties": {
|
750 |
+
"city": {
|
751 |
+
"type": "string",
|
752 |
+
"description": "Name of the city"
|
753 |
+
}
|
754 |
+
}
|
755 |
+
}
|
756 |
+
}
|
757 |
+
}]
|
758 |
+
|
759 |
+
# Map tool names to their implementations
|
760 |
+
tool_map = {
|
761 |
+
"get_weather": get_weather
|
762 |
+
}
|
763 |
+
|
764 |
+
def tool_call_with_client(client: OpenAI, model_name: str):
|
765 |
+
messages = [
|
766 |
+
{"role": "system", "content": "You are Kimi, an AI assistant created by Moonshot AI."},
|
767 |
+
{"role": "user", "content": "What's the weather like in Beijing today? Use the tool to check."}
|
768 |
+
]
|
769 |
+
finish_reason = None
|
770 |
+
while finish_reason is None or finish_reason == "tool_calls":
|
771 |
+
completion = client.chat.completions.create(
|
772 |
+
model=model_name,
|
773 |
+
messages=messages,
|
774 |
+
temperature=0.6,
|
775 |
+
tools=tools, # tool list defined above
|
776 |
+
tool_choice="auto"
|
777 |
+
)
|
778 |
+
choice = completion.choices[0]
|
779 |
+
finish_reason = choice.finish_reason
|
780 |
+
if finish_reason == "tool_calls":
|
781 |
+
messages.append(choice.message)
|
782 |
+
for tool_call in choice.message.tool_calls:
|
783 |
+
tool_call_name = tool_call.function.name
|
784 |
+
tool_call_arguments = json.loads(tool_call.function.arguments)
|
785 |
+
tool_function = tool_map[tool_call_name]
|
786 |
+
tool_result = tool_function(**tool_call_arguments)
|
787 |
+
print("tool_result:", tool_result)
|
788 |
+
|
789 |
+
messages.append({
|
790 |
+
"role": "tool",
|
791 |
+
"tool_call_id": tool_call.id,
|
792 |
+
"name": tool_call_name,
|
793 |
+
"content": json.dumps(tool_result)
|
794 |
+
})
|
795 |
+
print("-" * 100)
|
796 |
+
print(choice.message.content)
|
797 |
+
```
|
798 |
+
|
799 |
+
The `tool_call_with_client` function implements the pipeline from user query to tool execution.
|
800 |
+
This pipeline requires the inference engine to support Kimi-K2’s native tool-parsing logic.
|
801 |
+
For streaming output and manual tool-parsing, see the [Tool Calling Guide](docs/tool_call_guidance.md).
|
802 |
+
|
803 |
+
---
|
804 |
+
|
805 |
+
## 6. License
|
806 |
+
|
807 |
+
Both the code repository and the model weights are released under the [Modified MIT License](LICENSE).
|
808 |
+
|
809 |
+
---
|
810 |
+
|
811 |
+
## 7. Third Party Notices
|
812 |
+
|
813 |
+
See [THIRD PARTY NOTICES](THIRD_PARTY_NOTICES.md)
|
814 |
+
|
815 |
+
---
|
816 |
+
|
817 |
+
## 7. Contact Us
|
818 |
+
|
819 |
+
If you have any questions, please reach out at [[email protected]](mailto:[email protected]).
|
THIRD_PARTY_NOTICES.md
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# THIRD_PARTY_NOTICES
|
2 |
+
|
3 |
+
This file lists third-party software contained in Kimi-K2 along with their licenses, in compliance with the redistribution clauses of those licenses.
|
4 |
+
|
5 |
+
---
|
6 |
+
|
7 |
+
## 1. DeepSeek-V3
|
8 |
+
|
9 |
+
Our model archietecture is DeepSeek-V3-like. Some of modeling codes are copied from the source repository.
|
10 |
+
|
11 |
+
- **Source Repository**
|
12 |
+
https://huggingface.co/deepseek-ai/DeepSeek-V3
|
13 |
+
|
14 |
+
- **Files / Directories Used**
|
15 |
+
- configuation_deepseek.py
|
16 |
+
- modeling_deepseek.py
|
17 |
+
|
18 |
+
- **License Type**
|
19 |
+
MIT License
|
20 |
+
|
21 |
+
- **Copyright Notice**
|
22 |
+
Copyright (c) 2023 DeepSeek
|
23 |
+
|
24 |
+
- **Full License Text**
|
25 |
+
```
|
26 |
+
MIT License
|
27 |
+
|
28 |
+
Copyright (c) 2023 DeepSeek
|
29 |
+
|
30 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
31 |
+
of this software and associated documentation files (the "Software"), to deal
|
32 |
+
in the Software without restriction, including without limitation the rights
|
33 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
34 |
+
copies of the Software, and to permit persons to whom the Software is
|
35 |
+
furnished to do so, subject to the following conditions:
|
36 |
+
|
37 |
+
The above copyright notice and this permission notice shall be included in all
|
38 |
+
copies or substantial portions of the Software.
|
39 |
+
|
40 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
41 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
42 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
43 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
44 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
45 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
46 |
+
SOFTWARE.
|
47 |
+
```
|
chat_template.jinja
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{% if tools -%}
|
2 |
+
{{ '<|im_system|>tool_declare<|im_middle|>' -}}
|
3 |
+
{{- tools | tojson -}}
|
4 |
+
{{ '<|im_end|>' -}}
|
5 |
+
{%- endif -%}
|
6 |
+
|
7 |
+
{%- for message in messages -%}
|
8 |
+
{%- if loop.first and messages[0]['role'] != 'system' -%}
|
9 |
+
{{ '<|im_system|>system<|im_middle|>You are a helpful assistant<|im_end|>' }}
|
10 |
+
{%- endif -%}
|
11 |
+
{%- if message['role'] == 'system' -%}
|
12 |
+
{{ '<|im_system|>system<|im_middle|>' }}
|
13 |
+
{%- elif message['role'] == 'user' -%}
|
14 |
+
{{ '<|im_user|>user<|im_middle|>' }}
|
15 |
+
{%- elif message['role'] == 'assistant' -%}
|
16 |
+
{{ '<|im_assistant|>assistant<|im_middle|>' }}
|
17 |
+
{%- elif message['role'] == 'tool' -%}
|
18 |
+
{{ '<|im_system|>tool<|im_middle|>' }}
|
19 |
+
{%- endif -%}
|
20 |
+
|
21 |
+
{%- if message['content'] is string -%}
|
22 |
+
{{- message['content'] + '<|im_end|>' -}}
|
23 |
+
{%- else -%}
|
24 |
+
{%- for content in message['content'] -%}
|
25 |
+
{%- if content['type'] == 'image' or 'image' in content or 'image_url' in content -%}
|
26 |
+
{{ '<|media_start|>image<|media_content|><|media_pad|><|media_end|>' }}
|
27 |
+
{%- else -%}
|
28 |
+
{{ content['text'] }}
|
29 |
+
{%- endif -%}
|
30 |
+
{%- endfor -%}
|
31 |
+
{{ '<|im_end|>' }}
|
32 |
+
{%- endif -%}
|
33 |
+
{%- endfor -%}
|
34 |
+
|
35 |
+
{%- if add_generation_prompt -%}
|
36 |
+
{{ '<|im_assistant|>assistant<|im_middle|>' }}
|
37 |
+
{%- endif -%}
|
config.json
ADDED
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"architectures": [
|
3 |
+
"DeepseekV3ForCausalLM"
|
4 |
+
],
|
5 |
+
"attention_bias": false,
|
6 |
+
"attention_dropout": 0.0,
|
7 |
+
"auto_map": {
|
8 |
+
"AutoConfig": "configuration_deepseek.DeepseekV3Config",
|
9 |
+
"AutoModel": "modeling_deepseek.DeepseekV3Model",
|
10 |
+
"AutoModelForCausalLM": "modeling_deepseek.DeepseekV3ForCausalLM"
|
11 |
+
},
|
12 |
+
"aux_loss_alpha": 0.001,
|
13 |
+
"bos_token_id": 163584,
|
14 |
+
"eos_token_id": 163585,
|
15 |
+
"ep_size": 1,
|
16 |
+
"first_k_dense_replace": 1,
|
17 |
+
"hidden_act": "silu",
|
18 |
+
"hidden_size": 7168,
|
19 |
+
"initializer_range": 0.02,
|
20 |
+
"intermediate_size": 18432,
|
21 |
+
"kv_lora_rank": 512,
|
22 |
+
"max_position_embeddings": 131072,
|
23 |
+
"model_type": "deepseek_v3",
|
24 |
+
"moe_intermediate_size": 2048,
|
25 |
+
"moe_layer_freq": 1,
|
26 |
+
"n_group": 1,
|
27 |
+
"n_routed_experts": 384,
|
28 |
+
"n_shared_experts": 1,
|
29 |
+
"norm_topk_prob": true,
|
30 |
+
"num_attention_heads": 64,
|
31 |
+
"num_experts_per_tok": 8,
|
32 |
+
"num_hidden_layers": 61,
|
33 |
+
"num_key_value_heads": 64,
|
34 |
+
"num_nextn_predict_layers": 0,
|
35 |
+
"pad_token_id": 163839,
|
36 |
+
"pretraining_tp": 1,
|
37 |
+
"q_lora_rank": 1536,
|
38 |
+
"qk_nope_head_dim": 128,
|
39 |
+
"qk_rope_head_dim": 64,
|
40 |
+
"quantization_config": {
|
41 |
+
"activation_scheme": "dynamic",
|
42 |
+
"fmt": "e4m3",
|
43 |
+
"quant_method": "fp8",
|
44 |
+
"weight_block_size": [
|
45 |
+
128,
|
46 |
+
128
|
47 |
+
]
|
48 |
+
},
|
49 |
+
"rms_norm_eps": 1e-06,
|
50 |
+
"rope_scaling": {
|
51 |
+
"beta_fast": 1.0,
|
52 |
+
"beta_slow": 1.0,
|
53 |
+
"factor": 32.0,
|
54 |
+
"mscale": 1.0,
|
55 |
+
"mscale_all_dim": 1.0,
|
56 |
+
"original_max_position_embeddings": 4096,
|
57 |
+
"type": "yarn"
|
58 |
+
},
|
59 |
+
"rope_theta": 50000.0,
|
60 |
+
"routed_scaling_factor": 2.827,
|
61 |
+
"scoring_func": "sigmoid",
|
62 |
+
"seq_aux": true,
|
63 |
+
"tie_word_embeddings": false,
|
64 |
+
"topk_group": 1,
|
65 |
+
"topk_method": "noaux_tc",
|
66 |
+
"torch_dtype": "bfloat16",
|
67 |
+
"transformers_version": "4.53.2",
|
68 |
+
"unsloth_fixed": true,
|
69 |
+
"use_cache": true,
|
70 |
+
"v_head_dim": 128,
|
71 |
+
"vocab_size": 163840
|
72 |
+
}
|
configuration_deepseek.py
ADDED
@@ -0,0 +1,212 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Copy from https://huggingface.co/deepseek-ai/DeepSeek-V3/blob/main/configuration_deepseek.py
|
2 |
+
|
3 |
+
from transformers.configuration_utils import PretrainedConfig
|
4 |
+
from transformers.utils import logging
|
5 |
+
|
6 |
+
logger = logging.get_logger(__name__)
|
7 |
+
|
8 |
+
DEEPSEEK_PRETRAINED_CONFIG_ARCHIVE_MAP = {}
|
9 |
+
class DeepseekV3Config(PretrainedConfig):
|
10 |
+
r"""
|
11 |
+
This is the configuration class to store the configuration of a [`DeepseekV3Model`]. It is used to instantiate an DeepSeek
|
12 |
+
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
|
13 |
+
defaults will yield a similar configuration to that of the DeepSeek-V3.
|
14 |
+
|
15 |
+
Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
|
16 |
+
documentation from [`PretrainedConfig`] for more information.
|
17 |
+
|
18 |
+
|
19 |
+
Args:
|
20 |
+
vocab_size (`int`, *optional*, defaults to 129280):
|
21 |
+
Vocabulary size of the Deep model. Defines the number of different tokens that can be represented by the
|
22 |
+
`inputs_ids` passed when calling [`DeepseekV3Model`]
|
23 |
+
hidden_size (`int`, *optional*, defaults to 4096):
|
24 |
+
Dimension of the hidden representations.
|
25 |
+
intermediate_size (`int`, *optional*, defaults to 11008):
|
26 |
+
Dimension of the MLP representations.
|
27 |
+
moe_intermediate_size (`int`, *optional*, defaults to 1407):
|
28 |
+
Dimension of the MoE representations.
|
29 |
+
num_hidden_layers (`int`, *optional*, defaults to 32):
|
30 |
+
Number of hidden layers in the Transformer decoder.
|
31 |
+
num_nextn_predict_layers (`int`, *optional*, defaults to 1):
|
32 |
+
Number of nextn predict layers in the DeepSeekV3 Model.
|
33 |
+
num_attention_heads (`int`, *optional*, defaults to 32):
|
34 |
+
Number of attention heads for each attention layer in the Transformer decoder.
|
35 |
+
n_shared_experts (`int`, *optional*, defaults to None):
|
36 |
+
Number of shared experts, None means dense model.
|
37 |
+
n_routed_experts (`int`, *optional*, defaults to None):
|
38 |
+
Number of routed experts, None means dense model.
|
39 |
+
routed_scaling_factor (`float`, *optional*, defaults to 1.0):
|
40 |
+
Scaling factor or routed experts.
|
41 |
+
topk_method (`str`, *optional*, defaults to `gready`):
|
42 |
+
Topk method used in routed gate.
|
43 |
+
n_group (`int`, *optional*, defaults to None):
|
44 |
+
Number of groups for routed experts.
|
45 |
+
topk_group (`int`, *optional*, defaults to None):
|
46 |
+
Number of selected groups for each token(for each token, ensuring the selected experts is only within `topk_group` groups).
|
47 |
+
num_experts_per_tok (`int`, *optional*, defaults to None):
|
48 |
+
Number of selected experts, None means dense model.
|
49 |
+
moe_layer_freq (`int`, *optional*, defaults to 1):
|
50 |
+
The frequency of the MoE layer: one expert layer for every `moe_layer_freq - 1` dense layers.
|
51 |
+
first_k_dense_replace (`int`, *optional*, defaults to 0):
|
52 |
+
Number of dense layers in shallow layers(embed->dense->dense->...->dense->moe->moe...->lm_head).
|
53 |
+
\--k dense layers--/
|
54 |
+
norm_topk_prob (`bool`, *optional*, defaults to False):
|
55 |
+
Whether to normalize the weights of the routed experts.
|
56 |
+
scoring_func (`str`, *optional*, defaults to 'softmax'):
|
57 |
+
Method of computing expert weights.
|
58 |
+
aux_loss_alpha (`float`, *optional*, defaults to 0.001):
|
59 |
+
Auxiliary loss weight coefficient.
|
60 |
+
seq_aux = (`bool`, *optional*, defaults to True):
|
61 |
+
Whether to compute the auxiliary loss for each individual sample.
|
62 |
+
num_key_value_heads (`int`, *optional*):
|
63 |
+
This is the number of key_value heads that should be used to implement Grouped Query Attention. If
|
64 |
+
`num_key_value_heads=num_attention_heads`, the model will use Multi Head Attention (MHA), if
|
65 |
+
`num_key_value_heads=1 the model will use Multi Query Attention (MQA) otherwise GQA is used. When
|
66 |
+
converting a multi-head checkpoint to a GQA checkpoint, each group key and value head should be constructed
|
67 |
+
by meanpooling all the original heads within that group. For more details checkout [this
|
68 |
+
paper](https://arxiv.org/pdf/2305.13245.pdf). If it is not specified, will default to
|
69 |
+
`num_attention_heads`.
|
70 |
+
hidden_act (`str` or `function`, *optional*, defaults to `"silu"`):
|
71 |
+
The non-linear activation function (function or string) in the decoder.
|
72 |
+
max_position_embeddings (`int`, *optional*, defaults to 2048):
|
73 |
+
The maximum sequence length that this model might ever be used with.
|
74 |
+
initializer_range (`float`, *optional*, defaults to 0.02):
|
75 |
+
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.
|
76 |
+
rms_norm_eps (`float`, *optional*, defaults to 1e-06):
|
77 |
+
The epsilon used by the rms normalization layers.
|
78 |
+
use_cache (`bool`, *optional*, defaults to `True`):
|
79 |
+
Whether or not the model should return the last key/values attentions (not used by all models). Only
|
80 |
+
relevant if `config.is_decoder=True`.
|
81 |
+
pad_token_id (`int`, *optional*):
|
82 |
+
Padding token id.
|
83 |
+
bos_token_id (`int`, *optional*, defaults to 1):
|
84 |
+
Beginning of stream token id.
|
85 |
+
eos_token_id (`int`, *optional*, defaults to 2):
|
86 |
+
End of stream token id.
|
87 |
+
pretraining_tp (`int`, *optional*, defaults to 1):
|
88 |
+
Experimental feature. Tensor parallelism rank used during pretraining. Please refer to [this
|
89 |
+
document](https://huggingface.co/docs/transformers/parallelism) to understand more about it. This value is
|
90 |
+
necessary to ensure exact reproducibility of the pretraining results. Please refer to [this
|
91 |
+
issue](https://github.com/pytorch/pytorch/issues/76232).
|
92 |
+
tie_word_embeddings (`bool`, *optional*, defaults to `False`):
|
93 |
+
Whether to tie weight embeddings
|
94 |
+
rope_theta (`float`, *optional*, defaults to 10000.0):
|
95 |
+
The base period of the RoPE embeddings.
|
96 |
+
rope_scaling (`Dict`, *optional*):
|
97 |
+
Dictionary containing the scaling configuration for the RoPE embeddings. Currently supports two scaling
|
98 |
+
strategies: linear and dynamic. Their scaling factor must be a float greater than 1. The expected format is
|
99 |
+
`{"type": strategy name, "factor": scaling factor}`. When using this flag, don't update
|
100 |
+
`max_position_embeddings` to the expected new maximum.
|
101 |
+
attention_bias (`bool`, defaults to `False`, *optional*, defaults to `False`):
|
102 |
+
Whether to use a bias in the query, key, value and output projection layers during self-attention.
|
103 |
+
attention_dropout (`float`, *optional*, defaults to 0.0):
|
104 |
+
The dropout ratio for the attention probabilities.
|
105 |
+
|
106 |
+
```python
|
107 |
+
>>> from transformers import DeepseekV3Model, DeepseekV3Config
|
108 |
+
|
109 |
+
>>> # Initializing a Deepseek-V3 style configuration
|
110 |
+
>>> configuration = DeepseekV3Config()
|
111 |
+
|
112 |
+
>>> # Accessing the model configuration
|
113 |
+
>>> configuration = model.config
|
114 |
+
```"""
|
115 |
+
|
116 |
+
model_type = "deepseek_v3"
|
117 |
+
keys_to_ignore_at_inference = ["past_key_values"]
|
118 |
+
|
119 |
+
def __init__(
|
120 |
+
self,
|
121 |
+
vocab_size=129280,
|
122 |
+
hidden_size=7168,
|
123 |
+
intermediate_size=18432,
|
124 |
+
moe_intermediate_size = 2048,
|
125 |
+
num_hidden_layers=61,
|
126 |
+
num_nextn_predict_layers=1,
|
127 |
+
num_attention_heads=128,
|
128 |
+
num_key_value_heads=128,
|
129 |
+
n_shared_experts = 1,
|
130 |
+
n_routed_experts = 256,
|
131 |
+
ep_size = 1,
|
132 |
+
routed_scaling_factor = 2.5,
|
133 |
+
kv_lora_rank = 512,
|
134 |
+
q_lora_rank = 1536,
|
135 |
+
qk_rope_head_dim = 64,
|
136 |
+
v_head_dim = 128,
|
137 |
+
qk_nope_head_dim = 128,
|
138 |
+
topk_method = 'noaux_tc',
|
139 |
+
n_group = 8,
|
140 |
+
topk_group = 4,
|
141 |
+
num_experts_per_tok = 8,
|
142 |
+
moe_layer_freq = 1,
|
143 |
+
first_k_dense_replace = 3,
|
144 |
+
norm_topk_prob = True,
|
145 |
+
scoring_func = 'sigmoid',
|
146 |
+
aux_loss_alpha = 0.001,
|
147 |
+
seq_aux = True,
|
148 |
+
hidden_act="silu",
|
149 |
+
max_position_embeddings=4096,
|
150 |
+
initializer_range=0.02,
|
151 |
+
rms_norm_eps=1e-6,
|
152 |
+
use_cache=True,
|
153 |
+
pad_token_id=None,
|
154 |
+
bos_token_id=0,
|
155 |
+
eos_token_id=1,
|
156 |
+
pretraining_tp=1,
|
157 |
+
tie_word_embeddings=False,
|
158 |
+
rope_theta=10000.0,
|
159 |
+
rope_scaling=None,
|
160 |
+
attention_bias=False,
|
161 |
+
attention_dropout=0.0,
|
162 |
+
**kwargs,
|
163 |
+
):
|
164 |
+
self.vocab_size = vocab_size
|
165 |
+
self.max_position_embeddings = max_position_embeddings
|
166 |
+
self.hidden_size = hidden_size
|
167 |
+
self.intermediate_size = intermediate_size
|
168 |
+
self.moe_intermediate_size = moe_intermediate_size
|
169 |
+
self.num_hidden_layers = num_hidden_layers
|
170 |
+
self.num_nextn_predict_layers = num_nextn_predict_layers
|
171 |
+
self.num_attention_heads = num_attention_heads
|
172 |
+
self.n_shared_experts = n_shared_experts
|
173 |
+
self.n_routed_experts = n_routed_experts
|
174 |
+
self.ep_size = ep_size
|
175 |
+
self.routed_scaling_factor = routed_scaling_factor
|
176 |
+
self.kv_lora_rank = kv_lora_rank
|
177 |
+
self.q_lora_rank = q_lora_rank
|
178 |
+
self.qk_rope_head_dim = qk_rope_head_dim
|
179 |
+
self.v_head_dim = v_head_dim
|
180 |
+
self.qk_nope_head_dim = qk_nope_head_dim
|
181 |
+
self.topk_method = topk_method
|
182 |
+
self.n_group = n_group
|
183 |
+
self.topk_group = topk_group
|
184 |
+
self.num_experts_per_tok = num_experts_per_tok
|
185 |
+
self.moe_layer_freq = moe_layer_freq
|
186 |
+
self.first_k_dense_replace = first_k_dense_replace
|
187 |
+
self.norm_topk_prob = norm_topk_prob
|
188 |
+
self.scoring_func = scoring_func
|
189 |
+
self.aux_loss_alpha = aux_loss_alpha
|
190 |
+
self.seq_aux = seq_aux
|
191 |
+
# for backward compatibility
|
192 |
+
if num_key_value_heads is None:
|
193 |
+
num_key_value_heads = num_attention_heads
|
194 |
+
|
195 |
+
self.num_key_value_heads = num_key_value_heads
|
196 |
+
self.hidden_act = hidden_act
|
197 |
+
self.initializer_range = initializer_range
|
198 |
+
self.rms_norm_eps = rms_norm_eps
|
199 |
+
self.pretraining_tp = pretraining_tp
|
200 |
+
self.use_cache = use_cache
|
201 |
+
self.rope_theta = rope_theta
|
202 |
+
self.rope_scaling = rope_scaling
|
203 |
+
self.attention_bias = attention_bias
|
204 |
+
self.attention_dropout = attention_dropout
|
205 |
+
|
206 |
+
super().__init__(
|
207 |
+
pad_token_id=pad_token_id,
|
208 |
+
bos_token_id=bos_token_id,
|
209 |
+
eos_token_id=eos_token_id,
|
210 |
+
tie_word_embeddings=tie_word_embeddings,
|
211 |
+
**kwargs,
|
212 |
+
)
|
docs/deploy_guidance.md
ADDED
@@ -0,0 +1,196 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Kimi-K2 Deployment Guide
|
2 |
+
|
3 |
+
> [!Note]
|
4 |
+
> This guide only provides some examples of deployment commands for Kimi-K2, which may not be the optimal configuration. Since inference engines are still being updated frequenty, please continue to follow the guidance from their homepage if you want to achieve better inference performance.
|
5 |
+
|
6 |
+
|
7 |
+
## vLLM Deployment
|
8 |
+
|
9 |
+
The smallest deployment unit for Kimi-K2 FP8 weights with 128k seqlen on mainstream H200 or H20 platform is a cluster with 16 GPUs with either Tensor Parallel (TP) or "data parallel + expert parallel" (DP+EP).
|
10 |
+
Running parameters for this environment are provided below. You may scale up to more nodes and increase expert-parallelism to enlarge the inference batch size and overall throughput.
|
11 |
+
|
12 |
+
### Tensor Parallelism
|
13 |
+
|
14 |
+
When the parallelism degree ≤ 16, you can run inference with pure Tensor Parallelism. A sample launch command is:
|
15 |
+
|
16 |
+
``` bash
|
17 |
+
# start ray on node 0 and node 1
|
18 |
+
|
19 |
+
# node 0:
|
20 |
+
vllm serve $MODEL_PATH \
|
21 |
+
--port 8000 \
|
22 |
+
--served-model-name kimi-k2 \
|
23 |
+
--trust-remote-code \
|
24 |
+
--tensor-parallel-size 16 \
|
25 |
+
--enable-auto-tool-choice \
|
26 |
+
--tool-call-parser kimi_k2
|
27 |
+
```
|
28 |
+
|
29 |
+
**Key parameter notes:**
|
30 |
+
- `--tensor-parallel-size 16`: If using more than 16 GPUs, combine with pipeline-parallelism.
|
31 |
+
- `--enable-auto-tool-choice`: Required when enabling tool usage.
|
32 |
+
- `--tool-call-parser kimi_k2`: Required when enabling tool usage.
|
33 |
+
|
34 |
+
### Data Parallelism + Expert Parallelism
|
35 |
+
|
36 |
+
You can install libraries like DeepEP and DeepGEMM as needed. Then run the command (example on H200):
|
37 |
+
|
38 |
+
``` bash
|
39 |
+
# node 0
|
40 |
+
vllm serve $MODEL_PATH --port 8000 --served-model-name kimi-k2 --trust-remote-code --data-parallel-size 16 --data-parallel-size-local 8 --data-parallel-address $MASTER_IP --data-parallel-rpc-port $PORT --enable-expert-parallel --max-num-batched-tokens 8192 --max-num-seqs 256 --gpu-memory-utilization 0.85 --enable-auto-tool-choice --tool-call-parser kimi_k2
|
41 |
+
|
42 |
+
# node 1
|
43 |
+
vllm serve $MODEL_PATH --headless --data-parallel-start-rank 8 --port 8000 --served-model-name kimi-k2 --trust-remote-code --data-parallel-size 16 --data-parallel-size-local 8 --data-parallel-address $MASTER_IP --data-parallel-rpc-port $PORT --enable-expert-parallel --max-num-batched-tokens 8192 --max-num-seqs 256 --gpu-memory-utilization 0.85 --enable-auto-tool-choice --tool-call-parser kimi_k2
|
44 |
+
```
|
45 |
+
|
46 |
+
## SGLang Deployment
|
47 |
+
|
48 |
+
Similarly, we can use TP or DP+EP in SGLang for Deployment, here are the examples.
|
49 |
+
|
50 |
+
|
51 |
+
### Tensor Parallelism
|
52 |
+
|
53 |
+
Here is the simple example code to run TP16 with two nodes on H200:
|
54 |
+
|
55 |
+
``` bash
|
56 |
+
# Node 0
|
57 |
+
python -m sglang.launch_server --model-path $MODEL_PATH --tp 16 --dist-init-addr $MASTER_IP:50000 --nnodes 2 --node-rank 0 --trust-remote-code --tool-call-parser kimi_k2
|
58 |
+
|
59 |
+
# Node 1
|
60 |
+
python -m sglang.launch_server --model-path $MODEL_PATH --tp 16 --dist-init-addr $MASTER_IP:50000 --nnodes 2 --node-rank 1 --trust-remote-code --tool-call-parser kimi_k2
|
61 |
+
```
|
62 |
+
|
63 |
+
**Key parameter notes:**
|
64 |
+
- `--tool-call-parser kimi_k2`: Required when enabling tool usage.
|
65 |
+
|
66 |
+
### Data Parallelism + Expert Parallelism
|
67 |
+
|
68 |
+
Here is an example for large scale Prefill-Decode Disaggregation (4P12D H200) with DP+EP in SGLang:
|
69 |
+
|
70 |
+
``` bash
|
71 |
+
# for prefill node
|
72 |
+
MC_TE_METRIC=true SGLANG_DISAGGREGATION_HEARTBEAT_INTERVAL=10000000 SGLANG_DISAGGREGATION_BOOTSTRAP_TIMEOUT=100000 SGLANG_DISAGGREGATION_WAITING_TIMEOUT=100000 PYTHONUNBUFFERED=1 \
|
73 |
+
python -m sglang.launch_server --model-path $MODEL_PATH \
|
74 |
+
--trust-remote-code --disaggregation-mode prefill --dist-init-addr $PREFILL_NODE0$:5757 --tp-size 32 --dp-size 32 --enable-dp-attention --host $LOCAL_IP --decode-log-interval 1 --disable-radix-cache --enable-deepep-moe --moe-dense-tp-size 1 --enable-dp-lm-head --disable-shared-experts-fusion --watchdog-timeout 1000000 --enable-two-batch-overlap --disaggregation-ib-device $IB_DEVICE --chunked-prefill-size 131072 --mem-fraction-static 0.85 --deepep-mode normal --ep-dispatch-algorithm dynamic --eplb-algorithm deepseek --max-running-requests 1024 --nnodes 4 --node-rank $RANK --tool-call-parser kimi_k2
|
75 |
+
|
76 |
+
|
77 |
+
# for decode node
|
78 |
+
SGLANG_DEEPEP_NUM_MAX_DISPATCH_TOKENS_PER_RANK=480 MC_TE_METRIC=true SGLANG_DISAGGREGATION_HEARTBEAT_INTERVAL=10000000 SGLANG_DISAGGREGATION_BOOTSTRAP_TIMEOUT=100000 SGLANG_DISAGGREGATION_WAITING_TIMEOUT=100000 PYTHONUNBUFFERED=1 \
|
79 |
+
python -m sglang.launch_server --model-path $MODEL_PATH --trust-remote-code --disaggregation-mode decode --dist-init-addr $DECODE_NODE0:5757 --tp-size 96 --dp-size 96 --enable-dp-attention --host $LOCAL_IP --decode-log-interval 1 --context-length 2176 --disable-radix-cache --enable-deepep-moe --moe-dense-tp-size 1 --enable-dp-lm-head --disable-shared-experts-fusion --watchdog-timeout 1000000 --enable-two-batch-overlap --disaggregation-ib-device $IB_DEVICE --deepep-mode low_latency --mem-fraction-static 0.8 --cuda-graph-bs 480 --max-running-requests 46080 --ep-num-redundant-experts 96 --nnodes 12 --node-rank $RANK --tool-call-parser kimi_k2
|
80 |
+
|
81 |
+
# pdlb
|
82 |
+
PYTHONUNBUFFERED=1 python -m sglang.srt.disaggregation.launch_lb --prefill http://${PREFILL_NODE0}:30000 --decode http://${DECODE_NODE0}:30000
|
83 |
+
```
|
84 |
+
|
85 |
+
## KTransformers Deployment
|
86 |
+
|
87 |
+
Please copy all configuration files (i.e., everything except the .safetensors files) into the GGUF checkpoint folder at /path/to/K2. Then run:
|
88 |
+
``` bash
|
89 |
+
python ktransformers/server/main.py --model_path /path/to/K2 --gguf_path /path/to/K2 --cache_lens 30000
|
90 |
+
```
|
91 |
+
|
92 |
+
To enable AMX optimization, run:
|
93 |
+
|
94 |
+
``` bash
|
95 |
+
python ktransformers/server/main.py --model_path /path/to/K2 --gguf_path /path/to/K2 --cache_lens 30000 --optimize_config_path ktransformers/optimize/optimize_rules/DeepSeek-V3-Chat-fp8-linear-ggml-experts-serve-amx.yaml
|
96 |
+
```
|
97 |
+
|
98 |
+
## TensoRT-LLM Deployment
|
99 |
+
### Prerequisite
|
100 |
+
Please refer to [this guide](https://nvidia.github.io/TensorRT-LLM/installation/build-from-source-linux.html) to build TensorRT-LLM v1.0.0-rc2 from source and start a TRT-LLM docker container.
|
101 |
+
|
102 |
+
install blobfile by:
|
103 |
+
```bash
|
104 |
+
pip install blobfile
|
105 |
+
```
|
106 |
+
### Multi-node Serving
|
107 |
+
TensorRT-LLM supports multi-node inference. You can use mpirun to launch Kimi-K2 with multi-node jobs. We will use two nodes for this example.
|
108 |
+
|
109 |
+
#### mpirun
|
110 |
+
mpirun requires each node to have passwordless ssh access to the other node. We need to setup the environment inside the docker container. Run the container with host network and mount the current directory as well as model directory to the container.
|
111 |
+
|
112 |
+
```bash
|
113 |
+
# use host network
|
114 |
+
IMAGE=<YOUR_IMAGE>
|
115 |
+
NAME=test_2node_docker
|
116 |
+
# host1
|
117 |
+
docker run -it --name ${NAME}_host1 --ipc=host --gpus=all --network host --privileged --ulimit memlock=-1 --ulimit stack=67108864 -v ${PWD}:/workspace -v <YOUR_MODEL_DIR>:/models/DeepSeek-V3 -w /workspace ${IMAGE}
|
118 |
+
# host2
|
119 |
+
docker run -it --name ${NAME}_host2 --ipc=host --gpus=all --network host --privileged --ulimit memlock=-1 --ulimit stack=67108864 -v ${PWD}:/workspace -v <YOUR_MODEL_DIR>:/models/DeepSeek-V3 -w /workspace ${IMAGE}
|
120 |
+
```
|
121 |
+
|
122 |
+
Set up ssh inside the container
|
123 |
+
|
124 |
+
```bash
|
125 |
+
apt-get update && apt-get install -y openssh-server
|
126 |
+
|
127 |
+
# modify /etc/ssh/sshd_config
|
128 |
+
PermitRootLogin yes
|
129 |
+
PubkeyAuthentication yes
|
130 |
+
# modify /etc/ssh/sshd_config, change default port 22 to another unused port
|
131 |
+
port 2233
|
132 |
+
|
133 |
+
# modify /etc/ssh
|
134 |
+
```
|
135 |
+
|
136 |
+
Generate ssh key on host1 and copy to host2, vice versa.
|
137 |
+
|
138 |
+
```bash
|
139 |
+
# on host1
|
140 |
+
ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519
|
141 |
+
ssh-copy-id -i ~/.ssh/id_ed25519.pub root@<HOST2>
|
142 |
+
# on host2
|
143 |
+
ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519
|
144 |
+
ssh-copy-id -i ~/.ssh/id_ed25519.pub root@<HOST1>
|
145 |
+
|
146 |
+
# restart ssh service on host1 and host2
|
147 |
+
service ssh restart # or
|
148 |
+
/etc/init.d/ssh restart # or
|
149 |
+
systemctl restart ssh
|
150 |
+
```
|
151 |
+
|
152 |
+
Generate additional config for trtllm serve.
|
153 |
+
```bash
|
154 |
+
cat >/path/to/TensorRT-LLM/extra-llm-api-config.yml <<EOF
|
155 |
+
cuda_graph_config:
|
156 |
+
padding_enabled: true
|
157 |
+
batch_sizes:
|
158 |
+
- 1
|
159 |
+
- 2
|
160 |
+
- 4
|
161 |
+
- 8
|
162 |
+
- 16
|
163 |
+
- 32
|
164 |
+
- 64
|
165 |
+
- 128
|
166 |
+
print_iter_log: true
|
167 |
+
enable_attention_dp: true
|
168 |
+
EOF
|
169 |
+
```
|
170 |
+
|
171 |
+
|
172 |
+
After the preparations,you can run the trtllm-serve on two nodes using mpirun:
|
173 |
+
|
174 |
+
```bash
|
175 |
+
mpirun -np 16 \
|
176 |
+
-H <HOST1>:8,<HOST2>:8 \
|
177 |
+
-mca plm_rsh_args "-p 2233" \
|
178 |
+
--allow-run-as-root \
|
179 |
+
trtllm-llmapi-launch trtllm-serve serve \
|
180 |
+
--backend pytorch \
|
181 |
+
--tp_size 16 \
|
182 |
+
--ep_size 8 \
|
183 |
+
--kv_cache_free_gpu_memory_fraction 0.95 \
|
184 |
+
--trust_remote_code \
|
185 |
+
--max_batch_size 128 \
|
186 |
+
--max_num_tokens 4096 \
|
187 |
+
--extra_llm_api_options /path/to/TensorRT-LLM/extra-llm-api-config.yml \
|
188 |
+
--port 8000 \
|
189 |
+
<YOUR_MODEL_DIR>
|
190 |
+
```
|
191 |
+
|
192 |
+
## Others
|
193 |
+
|
194 |
+
Kimi-K2 reuses the `DeepSeekV3CausalLM` architecture and convert it's weight into proper shape to save redevelopment effort. To let inference engines distinguish it from DeepSeek-V3 and apply the best optimizations, we set `"model_type": "kimi_k2"` in `config.json`.
|
195 |
+
|
196 |
+
If you are using a framework that is not on the recommended list, you can still run the model by manually changing `model_type` to "deepseek_v3" in `config.json` as a temporary workaround. You may need to manually parse tool calls in case no tool call parser is available in your framework.
|
docs/tool_call_guidance.md
ADDED
@@ -0,0 +1,241 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
## Tool Calling
|
2 |
+
To enable the tool calling feature, you may need to set certain tool calling parser options when starting the service. See [deploy_guidance](./deploy_guidance.md) for details.
|
3 |
+
In Kimi-K2, a tool calling process includes:
|
4 |
+
- Passing function descriptions to Kimi-K2
|
5 |
+
- Kimi-K2 decides to make a function call and returns the necessary information for the function call to the user
|
6 |
+
- The user performs the function call, collects the call results, and passes the function call results to Kimi-K2
|
7 |
+
- Kimi-K2 continues to generate content based on the function call results until the model believes it has obtained sufficient information to respond to the user
|
8 |
+
|
9 |
+
### Preparing Tools
|
10 |
+
Suppose we have a function `get_weather` that can query the weather conditions in real-time.
|
11 |
+
This function accepts a city name as a parameter and returns the weather conditions. We need to prepare a structured description for it so that Kimi-K2 can understand its functionality.
|
12 |
+
|
13 |
+
```python
|
14 |
+
def get_weather(city):
|
15 |
+
return {"weather": "Sunny"}
|
16 |
+
|
17 |
+
# Collect the tool descriptions in tools
|
18 |
+
tools = [{
|
19 |
+
"type": "function",
|
20 |
+
"function": {
|
21 |
+
"name": "get_weather",
|
22 |
+
"description": "Get weather information. Call this tool when the user needs to get weather information",
|
23 |
+
"parameters": {
|
24 |
+
"type": "object",
|
25 |
+
"required": ["city"],
|
26 |
+
"properties": {
|
27 |
+
"city": {
|
28 |
+
"type": "string",
|
29 |
+
"description": "City name",
|
30 |
+
}
|
31 |
+
}
|
32 |
+
}
|
33 |
+
}
|
34 |
+
}]
|
35 |
+
|
36 |
+
# Tool name->object mapping for easy calling later
|
37 |
+
tool_map = {
|
38 |
+
"get_weather": get_weather
|
39 |
+
}
|
40 |
+
```
|
41 |
+
### Chat with tools
|
42 |
+
We use `openai.OpenAI` to send messages to Kimi-K2 along with tool descriptions. Kimi-K2 will autonomously decide whether to use and how to use the provided tools.
|
43 |
+
If Kimi-K2 believes a tool call is needed, it will return a result with `finish_reason='tool_calls'`. At this point, the returned result includes the tool call information.
|
44 |
+
After calling tools with the provided information, we then need to append the tool call results to the chat history and continue calling Kimi-K2.
|
45 |
+
Kimi-K2 may need to call tools multiple times until the model believes the current results can answer the user's question. We should check `finish_reason` until it is not `tool_calls`.
|
46 |
+
|
47 |
+
The results obtained by the user after calling the tools should be added to `messages` with `role='tool'`.
|
48 |
+
|
49 |
+
```python
|
50 |
+
import json
|
51 |
+
from openai import OpenAI
|
52 |
+
model_name='moonshotai/Kimi-K2-Instruct'
|
53 |
+
client = OpenAI(base_url=endpoint,
|
54 |
+
api_key='xxx')
|
55 |
+
|
56 |
+
messages = [
|
57 |
+
{"role": "user", "content": "What's the weather like in Beijing today? Let's check using the tool."}
|
58 |
+
]
|
59 |
+
finish_reason = None
|
60 |
+
while finish_reason is None or finish_reason == "tool_calls":
|
61 |
+
completion = client.chat.completions.create(
|
62 |
+
model=model_name,
|
63 |
+
messages=messages,
|
64 |
+
temperature=0.3,
|
65 |
+
tools=tools,
|
66 |
+
tool_choice="auto",
|
67 |
+
)
|
68 |
+
choice = completion.choices[0]
|
69 |
+
finish_reason = choice.finish_reason
|
70 |
+
# Note: The finish_reason when tool calls end may vary across different engines, so this condition check needs to be adjusted accordingly
|
71 |
+
if finish_reason == "tool_calls":
|
72 |
+
messages.append(choice.message)
|
73 |
+
for tool_call in choice.message.tool_calls:
|
74 |
+
tool_call_name = tool_call.function.name
|
75 |
+
tool_call_arguments = json.loads(tool_call.function.arguments)
|
76 |
+
tool_function = tool_map[tool_call_name]
|
77 |
+
tool_result = tool_function(tool_call_arguments)
|
78 |
+
print("tool_result", tool_result)
|
79 |
+
|
80 |
+
messages.append({
|
81 |
+
"role": "tool",
|
82 |
+
"tool_call_id": tool_call.id,
|
83 |
+
"name": tool_call_name,
|
84 |
+
"content": json.dumps(tool_result),
|
85 |
+
})
|
86 |
+
print('-' * 100)
|
87 |
+
print(choice.message.content)
|
88 |
+
```
|
89 |
+
### Tool Calling in Streaming Mode
|
90 |
+
Tool calling can also be used in streaming mode. In this case, we need to collect the tool call information returned in the stream until we have a complete tool call. Please refer to the code below:
|
91 |
+
|
92 |
+
```python
|
93 |
+
messages = [
|
94 |
+
{"role": "user", "content": "What's the weather like in Beijing today? Let's check using the tool."}
|
95 |
+
]
|
96 |
+
finish_reason = None
|
97 |
+
msg = ''
|
98 |
+
while finish_reason is None or finish_reason == "tool_calls":
|
99 |
+
completion = client.chat.completions.create(
|
100 |
+
model=model_name,
|
101 |
+
messages=messages,
|
102 |
+
temperature=0.3,
|
103 |
+
tools=tools,
|
104 |
+
tool_choice="auto",
|
105 |
+
stream=True
|
106 |
+
)
|
107 |
+
tool_calls = []
|
108 |
+
for chunk in completion:
|
109 |
+
delta = chunk.choices[0].delta
|
110 |
+
if delta.content:
|
111 |
+
msg += delta.content
|
112 |
+
if delta.tool_calls:
|
113 |
+
for tool_call_chunk in delta.tool_calls:
|
114 |
+
if tool_call_chunk.index is not None:
|
115 |
+
# Extend the tool_calls list
|
116 |
+
while len(tool_calls) <= tool_call_chunk.index:
|
117 |
+
tool_calls.append({
|
118 |
+
"id": "",
|
119 |
+
"type": "function",
|
120 |
+
"function": {
|
121 |
+
"name": "",
|
122 |
+
"arguments": ""
|
123 |
+
}
|
124 |
+
})
|
125 |
+
|
126 |
+
tc = tool_calls[tool_call_chunk.index]
|
127 |
+
|
128 |
+
if tool_call_chunk.id:
|
129 |
+
tc["id"] += tool_call_chunk.id
|
130 |
+
if tool_call_chunk.function.name:
|
131 |
+
tc["function"]["name"] += tool_call_chunk.function.name
|
132 |
+
if tool_call_chunk.function.arguments:
|
133 |
+
tc["function"]["arguments"] += tool_call_chunk.function.arguments
|
134 |
+
|
135 |
+
finish_reason = chunk.choices[0].finish_reason
|
136 |
+
# Note: The finish_reason when tool calls end may vary across different engines, so this condition check needs to be adjusted accordingly
|
137 |
+
if finish_reason == "tool_calls":
|
138 |
+
for tool_call in tool_calls:
|
139 |
+
tool_call_name = tool_call['function']['name']
|
140 |
+
tool_call_arguments = json.loads(tool_call['function']['arguments'])
|
141 |
+
tool_function = tool_map[tool_call_name]
|
142 |
+
tool_result = tool_function(tool_call_arguments)
|
143 |
+
messages.append({
|
144 |
+
"role": "tool",
|
145 |
+
"tool_call_id": tool_call['id'],
|
146 |
+
"name": tool_call_name,
|
147 |
+
"content": json.dumps(tool_result),
|
148 |
+
})
|
149 |
+
# The text generated by the tool call is not the final version, reset msg
|
150 |
+
msg = ''
|
151 |
+
|
152 |
+
print(msg)
|
153 |
+
```
|
154 |
+
### Manually Parsing Tool Calls
|
155 |
+
The tool call requests generated by Kimi-K2 can also be parsed manually, which is especially useful when the service you are using does not provide a tool-call parser.
|
156 |
+
The tool call requests generated by Kimi-K2 are wrapped by `<|tool_calls_section_begin|>` and `<|tool_calls_section_end|>`,
|
157 |
+
with each tool call wrapped by `<|tool_call_begin|>` and `<|tool_call_end|>`. The tool ID and arguments are separated by `<|tool_call_argument_begin|>`.
|
158 |
+
The format of the tool ID is `functions.{func_name}:{idx}`, from which we can parse the function name.
|
159 |
+
|
160 |
+
Based on the above rules, we can directly post request to the completions interface and manually parse tool calls.
|
161 |
+
|
162 |
+
```python
|
163 |
+
import requests
|
164 |
+
from transformers import AutoTokenizer
|
165 |
+
messages = [
|
166 |
+
{"role": "user", "content": "What's the weather like in Beijing today? Let's check using the tool."}
|
167 |
+
]
|
168 |
+
msg = ''
|
169 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
|
170 |
+
while True:
|
171 |
+
text = tokenizer.apply_chat_template(
|
172 |
+
messages,
|
173 |
+
tokenize=False,
|
174 |
+
tools=tools,
|
175 |
+
add_generation_prompt=True,
|
176 |
+
)
|
177 |
+
payload = {
|
178 |
+
"model": model_name,
|
179 |
+
"prompt": text,
|
180 |
+
"max_tokens": 512
|
181 |
+
}
|
182 |
+
response = requests.post(
|
183 |
+
f"{endpoint}/completions",
|
184 |
+
headers={"Content-Type": "application/json"},
|
185 |
+
json=payload,
|
186 |
+
stream=False,
|
187 |
+
)
|
188 |
+
raw_out = response.json()
|
189 |
+
|
190 |
+
raw_output = raw_out["choices"][0]["text"]
|
191 |
+
tool_calls = extract_tool_call_info(raw_output)
|
192 |
+
if len(tool_calls) == 0:
|
193 |
+
# No tool calls
|
194 |
+
msg = raw_output
|
195 |
+
break
|
196 |
+
else:
|
197 |
+
for tool_call in tool_calls:
|
198 |
+
tool_call_name = tool_call['function']['name']
|
199 |
+
tool_call_arguments = json.loads(tool_call['function']['arguments'])
|
200 |
+
tool_function = tool_map[tool_call_name]
|
201 |
+
tool_result = tool_function(tool_call_arguments)
|
202 |
+
|
203 |
+
messages.append({
|
204 |
+
"role": "tool",
|
205 |
+
"tool_call_id": tool_call['id'],
|
206 |
+
"name": tool_call_name,
|
207 |
+
"content": json.dumps(tool_result),
|
208 |
+
})
|
209 |
+
print('-' * 100)
|
210 |
+
print(msg)
|
211 |
+
```
|
212 |
+
Here, `extract_tool_call_info` parses the model output and returns the model call information. A simple implementation would be:
|
213 |
+
```python
|
214 |
+
def extract_tool_call_info(tool_call_rsp: str):
|
215 |
+
if '<|tool_calls_section_begin|>' not in tool_call_rsp:
|
216 |
+
# No tool calls
|
217 |
+
return []
|
218 |
+
import re
|
219 |
+
pattern = r"<\|tool_calls_section_begin\|>(.*?)<\|tool_calls_section_end\|>"
|
220 |
+
|
221 |
+
tool_calls_sections = re.findall(pattern, tool_call_rsp, re.DOTALL)
|
222 |
+
|
223 |
+
# Extract multiple tool calls
|
224 |
+
func_call_pattern = r"<\|tool_call_begin\|>\s*(?P<tool_call_id>[\w\.]+:\d+)\s*<\|tool_call_argument_begin\|>\s*(?P<function_arguments>.*?)\s*<\|tool_call_end\|>"
|
225 |
+
tool_calls = []
|
226 |
+
for match in re.findall(func_call_pattern, tool_calls_sections[0], re.DOTALL):
|
227 |
+
function_id, function_args = match
|
228 |
+
# function_id: functions.get_weather:0
|
229 |
+
function_name = function_id.split('.')[1].split(':')[0]
|
230 |
+
tool_calls.append(
|
231 |
+
{
|
232 |
+
"id": function_id,
|
233 |
+
"type": "function",
|
234 |
+
"function": {
|
235 |
+
"name": function_name,
|
236 |
+
"arguments": function_args
|
237 |
+
}
|
238 |
+
}
|
239 |
+
)
|
240 |
+
return tool_calls
|
241 |
+
```
|
figures/banner.png
ADDED
![]() |
Git LFS Details
|
figures/kimi-logo.png
ADDED
![]() |
generation_config.json
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"max_length": 131072,
|
3 |
+
"eos_token_id": 163585
|
4 |
+
}
|
kimi-logo.png
ADDED
![]() |
model-1-of-61.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:6588a247fcf5538b0fdcfeea096893e8b7dd9c5b060f732c64a9c8e4513642d9
|
3 |
+
size 2846451040
|
model-10-of-61.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:65a1acc308054a60d93c09064542a8234d077ed404da111e23e00a7dd477311d
|
3 |
+
size 17066593104
|
model-11-of-61.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:5d7bb19290aa16be216ed59d616d1ef8c837dfc31e73ea81860ae0c17b6bc066
|
3 |
+
size 17066595432
|
model-12-of-61.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:8b6c4432d6562db0c22405ecfba1d9b5e8c7e52f63a53f223f379d516201678c
|
3 |
+
size 17066595432
|
model-13-of-61.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a53278f0777055cf4cf3f5e9daad803cf6895dd126f544880d3093c3c25be2ec
|
3 |
+
size 17066595432
|
model-14-of-61.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:260ce11bc3e2ff1ab14a610ef3eb77537c1f38ac3674c4e3921f19495af7ac58
|
3 |
+
size 17066595432
|
model-15-of-61.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f032c15758f09958ebac92eda24a68bd029e8db3e9f877864b36611d76187ea6
|
3 |
+
size 17066595432
|
model-16-of-61.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:6a277ec201afc53edda1c109cae0f927a6c5ed25a5c8efb30556ed3f1c43c478
|
3 |
+
size 17066595432
|
model-17-of-61.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:c5b8f09959653888b434fbd7ecb0e4abb11f8be7fa222386733a57b567e69d4c
|
3 |
+
size 17066595432
|
model-18-of-61.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:5f1633da1551f0f6cd8948ef8e43be92fe94f660876570d8ba1ebf06320439f4
|
3 |
+
size 17066595432
|
model-19-of-61.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:37f0a7d395f0e8e9cbe3150a315a9f199222c19feae870f002610856c605a12a
|
3 |
+
size 17066595432
|
model-2-of-61.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:78b30915b84c270ce710df51981156d8b3f75a091df21238fcc7815c3ec88a61
|
3 |
+
size 17066593104
|
model-20-of-61.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:847d034c34f5c9e4ad173b8808b43eb771b9359b20c286d49d892d621e88608c
|
3 |
+
size 17066595432
|
model-21-of-61.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d2e432244d1dfbe7e6ad290ddd0f0fc3b499978342b691e6545db6f6c1984a04
|
3 |
+
size 17066595432
|
model-22-of-61.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a4212dcf0872a741ac89c1df73d26278a85393b85649029608a47ffb689bfbff
|
3 |
+
size 17066595432
|
model-23-of-61.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:4ba7127d0d6b8a4846eedf2d79af2f99ec017ed4ab73d9050f90789cce927418
|
3 |
+
size 17066595432
|
model-24-of-61.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:47dda5474725ca5ec02aa6ccfbfd742319761ed6be04151aa23efb7498b46a17
|
3 |
+
size 17066595432
|
model-25-of-61.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:8043e47252b37cbded4997128fd82501ebe13b55ce1b0156e8f0dc82934000c0
|
3 |
+
size 17066595432
|
model-26-of-61.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:7a7c266b4f2c2fb89d08148c0523d5ba59971ae5806587943f217064ee87dc1b
|
3 |
+
size 17066595432
|
model-27-of-61.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:4959b33787160976972c53e5b4849170e1d9bd194bab1b13f8542c21defbef93
|
3 |
+
size 17066595432
|
model-28-of-61.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:4110af78af032ce3ebe8baae28f20dbdf455092cf35220a34cecc213d5ca0adf
|
3 |
+
size 17066595432
|
model-29-of-61.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d261aaa72fc71696b20af14c5ab1d36263532030f91d20c5951c33b5f0819147
|
3 |
+
size 17066595432
|
model-3-of-61.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ddcd18f3ec7ebf67ae168a6a0ba4cd1eb35f836c8f11bdfac2a1aa62ad45c590
|
3 |
+
size 17066593104
|
model-30-of-61.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ce858d304a5b161f373c48a2c75ff98e32036940639d93ef46d8b4c9fb68aca8
|
3 |
+
size 17066595432
|
model-31-of-61.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9f839db81f7fe95b685523f2fc772a06035ece2efd59bb7793def182e8ea4ad1
|
3 |
+
size 17066595432
|
model-32-of-61.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:44e1705eb4fb121fc50ed3bb07a78213a236c6492ef74b502b998d58f3511cd0
|
3 |
+
size 17066595432
|
model-33-of-61.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:6431b89ff446439c160c773534bdad375baac7cf4860cae6c09078f55d344447
|
3 |
+
size 17066595432
|
model-34-of-61.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:02723b4ee44f810caf6240bb20774b0fcf9fd9784df7c5389f219c1e2bc72c42
|
3 |
+
size 17066595432
|
model-35-of-61.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:40b0ed67d813ab9fef81b726082c662c17b4a70cfb1ec206ec1e35ab7f60a123
|
3 |
+
size 17066595432
|
model-36-of-61.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:30c455ac599a0a49015a0efc4cb24310ef9668fc873542bc97cc9aaee7985afb
|
3 |
+
size 17066595432
|
model-37-of-61.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f8335076188c044e43a8fc0016b295dadd044daf6256b1f4e6f75b770ed39205
|
3 |
+
size 17066595432
|
model-38-of-61.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f439eac5795dc25be67d3346e4c4af838ee1c3c55142d01b14c73b04a5935a2e
|
3 |
+
size 17066595432
|
model-39-of-61.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:3a3a091f098026f33e43e77ae23a2f50a1cba9521a6f17c5f9937021477f60e7
|
3 |
+
size 17066595432
|
model-4-of-61.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:31c3deb9197dd64f1560610890e08908111455086eef83c4b59cce9896db3e04
|
3 |
+
size 17066593104
|
model-40-of-61.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1254cd6a9e4dad67a4c29680284e08a74a24a60d04c8b289dcf8684e940ba844
|
3 |
+
size 17066595432
|
model-41-of-61.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ea5a8de924ee8edc03e20ae218dce8a0391531df56a884c5e3ee4bdab0aea76c
|
3 |
+
size 17066595432
|
model-42-of-61.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:2336cbc4fc310579b9269fd951af0bc0cabd07dd198e5b16b0f09d58ddcc2086
|
3 |
+
size 17066595432
|