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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- multilingual
|
| 4 |
+
license: other
|
| 5 |
+
license_name: kwaipilot-license
|
| 6 |
+
license_link: LICENSE
|
| 7 |
+
library_name: transformers
|
| 8 |
+
---
|
| 9 |
+
|
| 10 |
+
# <span style="color: #7FFF7F;">KAT-Dev GGUF Models</span>
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
## <span style="color: #7F7FFF;">Model Generation Details</span>
|
| 14 |
+
|
| 15 |
+
This model was generated using [llama.cpp](https://github.com/ggerganov/llama.cpp) at commit [`c8dedc99`](https://github.com/ggerganov/llama.cpp/commit/c8dedc9999eccf7821a9fe5b29f10e8d075e2217).
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
---
|
| 22 |
+
|
| 23 |
+
## <span style="color: #7FFF7F;">Quantization Beyond the IMatrix</span>
|
| 24 |
+
|
| 25 |
+
I've been experimenting with a new quantization approach that selectively elevates the precision of key layers beyond what the default IMatrix configuration provides.
|
| 26 |
+
|
| 27 |
+
In my testing, standard IMatrix quantization underperforms at lower bit depths, especially with Mixture of Experts (MoE) models. To address this, I'm using the `--tensor-type` option in `llama.cpp` to manually "bump" important layers to higher precision. You can see the implementation here:
|
| 28 |
+
👉 [Layer bumping with llama.cpp](https://github.com/Mungert69/GGUFModelBuilder/blob/main/model-converter/tensor_list_builder.py)
|
| 29 |
+
|
| 30 |
+
While this does increase model file size, it significantly improves precision for a given quantization level.
|
| 31 |
+
|
| 32 |
+
### **I'd love your feedback—have you tried this? How does it perform for you?**
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
|
| 36 |
+
|
| 37 |
+
---
|
| 38 |
+
|
| 39 |
+
<a href="https://readyforquantum.com/huggingface_gguf_selection_guide.html" style="color: #7FFF7F;">
|
| 40 |
+
Click here to get info on choosing the right GGUF model format
|
| 41 |
+
</a>
|
| 42 |
+
|
| 43 |
+
---
|
| 44 |
+
|
| 45 |
+
|
| 46 |
+
|
| 47 |
+
<!--Begin Original Model Card-->
|
| 48 |
+
|
| 49 |
+
<div align="center">
|
| 50 |
+
<img src="https://cdn-uploads.huggingface.co/production/uploads/61ee40a269351366e29972ad/KIYEa1c_WJEWPpeS0L_k1.png" width="100%" alt="Kwaipilot" />
|
| 51 |
+
</div>
|
| 52 |
+
|
| 53 |
+
<hr>
|
| 54 |
+
|
| 55 |
+
|
| 56 |
+
# Highlights
|
| 57 |
+
**KAT-Dev-32B** is an open-source 32B-parameter model for software engineering tasks.
|
| 58 |
+
|
| 59 |
+
On SWE-Bench Verified, **KAT-Dev-32B** achieves comparable performance with **62.4%** resolved and ranks **5th** among all open-source models with different scales.
|
| 60 |
+
|
| 61 |
+

|
| 62 |
+
|
| 63 |
+
# Introduction
|
| 64 |
+
|
| 65 |
+
**KAT-Dev-32B** is optimized via several stages of training, including a mid-training stage, supervised fine-tuning (SFT) & reinforcement fine-tuning (RFT) stage and an large-scale agentic reinforcement learning (RL) stage. In summary, our contributions include:
|
| 66 |
+
|
| 67 |
+
<table>
|
| 68 |
+
<thead>
|
| 69 |
+
<tr>
|
| 70 |
+
<th style="text-align:left; width:18%;">Stage</th>
|
| 71 |
+
<th style="text-align:left;">Key Techniques</th>
|
| 72 |
+
</tr>
|
| 73 |
+
</thead>
|
| 74 |
+
<tbody>
|
| 75 |
+
<tr>
|
| 76 |
+
<td><strong>1. Mid-Training</strong></td>
|
| 77 |
+
<td>We observe that adding extensive training for tool-use capability, multi-turn interaction, and instruction-following at this stage may not yield large performance gains in the current results (e.g., on leaderboards like SWE-bench). However, since our experiments are based on the Qwen3-32B model, we find that enhancing these foundational capabilities will have a significant impact on the subsequent SFT and RL stages. This suggests that improving such core abilities can profoundly influence the model’s capacity to handle more complex tasks.
|
| 78 |
+
</td>
|
| 79 |
+
</tr>
|
| 80 |
+
<tr>
|
| 81 |
+
<td><strong>2. SFT & RFT</strong></td>
|
| 82 |
+
<td>We meticulously curated eight task types and eight programming scenarios during the SFT stage to ensure the model’s generalization and comprehensive capabilities. Moreover, before RL, we innovatively introduced an RFT stage. Compared with traditional RL, we incorporate “teacher trajectories” annotated by human engineers as guidance during training—much like a learner driver being assisted by an experienced co-driver before officially driving after getting a license. This step not only boosts model performance but also further stabilizes the subsequent RL training.
|
| 83 |
+
</td>
|
| 84 |
+
</tr>
|
| 85 |
+
<tr>
|
| 86 |
+
<td><strong>3. Agentic RL Scaling</strong></td>
|
| 87 |
+
<td>Scaling agentic RL hinges on three challenges: efficient learning over nonlinear trajectory histories, leveraging intrinsic model signals, and building scalable high-throughput infrastructure. We address these with a multi-level prefix caching mechanism in the RL training engine, an entropy-based trajectory pruning technique, and an inner implementation of SeamlessFlow[1] architecture that cleanly decouples agents from training while exploiting heterogeneous compute. These innovations together cut scaling costs and enable efficient large-scale RL.
|
| 88 |
+
</td>
|
| 89 |
+
</tr>
|
| 90 |
+
</tbody>
|
| 91 |
+
</table>
|
| 92 |
+
|
| 93 |
+
For more details, including benchmark evaluation, hardware requirements, and inference performance, please refer to our [blog](https://kwaipilot.github.io/KAT-Coder/).
|
| 94 |
+
|
| 95 |
+
# Quickstart
|
| 96 |
+
|
| 97 |
+
```python
|
| 98 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 99 |
+
|
| 100 |
+
model_name = "Kwaipilot/KAT-Dev"
|
| 101 |
+
|
| 102 |
+
# load the tokenizer and the model
|
| 103 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 104 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 105 |
+
model_name,
|
| 106 |
+
torch_dtype="auto",
|
| 107 |
+
device_map="auto"
|
| 108 |
+
)
|
| 109 |
+
|
| 110 |
+
# prepare the model input
|
| 111 |
+
prompt = "Give me a short introduction to large language model."
|
| 112 |
+
messages = [
|
| 113 |
+
{"role": "user", "content": prompt}
|
| 114 |
+
]
|
| 115 |
+
text = tokenizer.apply_chat_template(
|
| 116 |
+
messages,
|
| 117 |
+
tokenize=False,
|
| 118 |
+
add_generation_prompt=True,
|
| 119 |
+
)
|
| 120 |
+
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
|
| 121 |
+
|
| 122 |
+
# conduct text completion
|
| 123 |
+
generated_ids = model.generate(
|
| 124 |
+
**model_inputs,
|
| 125 |
+
max_new_tokens=65536
|
| 126 |
+
)
|
| 127 |
+
output_ids = generated_ids[0][len(model_inputs.input_ids[0]):].tolist()
|
| 128 |
+
|
| 129 |
+
content = tokenizer.decode(output_ids, skip_special_tokens=True)
|
| 130 |
+
|
| 131 |
+
print("content:", content)
|
| 132 |
+
```
|
| 133 |
+
|
| 134 |
+
## Claude Code
|
| 135 |
+
### vllm server
|
| 136 |
+
```
|
| 137 |
+
MODEL_PATH="Kwaipilot/KAT-Dev"
|
| 138 |
+
|
| 139 |
+
vllm serve $MODEL_PATH \
|
| 140 |
+
--enable-prefix-caching \
|
| 141 |
+
--tensor-parallel-size 8 \
|
| 142 |
+
--tool-parser-plugin $MODEL_PATH/qwen3coder_tool_parser.py \
|
| 143 |
+
--chat-template $MODEL_PATH/chat_template.jinja \
|
| 144 |
+
--enable-auto-tool-choice --tool-call-parser qwen3_coder
|
| 145 |
+
```
|
| 146 |
+
|
| 147 |
+
[claude-code-router](https://github.com/musistudio/claude-code-router) is a third-party routing utility that allows Claude Code to flexibly switch between different backend APIs.
|
| 148 |
+
On the dashScope platform, you can install the **claude-code-config** extension package, which automatically generates a default configuration for `claude-code-router` with built-in dashScope support.
|
| 149 |
+
|
| 150 |
+
Once the configuration files and plugin directory are generated, the environment required by `ccr` will be ready.
|
| 151 |
+
If needed, you can still manually edit `~/.claude-code-router/config.json` and the files under `~/.claude-code-router/plugins/` to customize the setup.
|
| 152 |
+
|
| 153 |
+
Finally, simply start `ccr` to run Claude Code and seamlessly connect it with the powerful coding capabilities of **KAT-Dev-32B**.
|
| 154 |
+
Happy coding!
|
| 155 |
+
|
| 156 |
+
<!--End Original Model Card-->
|
| 157 |
+
|
| 158 |
+
---
|
| 159 |
+
|
| 160 |
+
# <span id="testllm" style="color: #7F7FFF;">🚀 If you find these models useful</span>
|
| 161 |
+
|
| 162 |
+
Help me test my **AI-Powered Quantum Network Monitor Assistant** with **quantum-ready security checks**:
|
| 163 |
+
|
| 164 |
+
👉 [Quantum Network Monitor](https://readyforquantum.com/?assistant=open&utm_source=huggingface&utm_medium=referral&utm_campaign=huggingface_repo_readme)
|
| 165 |
+
|
| 166 |
+
|
| 167 |
+
The full Open Source Code for the Quantum Network Monitor Service available at my github repos ( repos with NetworkMonitor in the name) : [Source Code Quantum Network Monitor](https://github.com/Mungert69). You will also find the code I use to quantize the models if you want to do it yourself [GGUFModelBuilder](https://github.com/Mungert69/GGUFModelBuilder)
|
| 168 |
+
|
| 169 |
+
💬 **How to test**:
|
| 170 |
+
Choose an **AI assistant type**:
|
| 171 |
+
- `TurboLLM` (GPT-4.1-mini)
|
| 172 |
+
- `HugLLM` (Hugginface Open-source models)
|
| 173 |
+
- `TestLLM` (Experimental CPU-only)
|
| 174 |
+
|
| 175 |
+
### **What I’m Testing**
|
| 176 |
+
I’m pushing the limits of **small open-source models for AI network monitoring**, specifically:
|
| 177 |
+
- **Function calling** against live network services
|
| 178 |
+
- **How small can a model go** while still handling:
|
| 179 |
+
- Automated **Nmap security scans**
|
| 180 |
+
- **Quantum-readiness checks**
|
| 181 |
+
- **Network Monitoring tasks**
|
| 182 |
+
|
| 183 |
+
🟡 **TestLLM** – Current experimental model (llama.cpp on 2 CPU threads on huggingface docker space):
|
| 184 |
+
- ✅ **Zero-configuration setup**
|
| 185 |
+
- ⏳ 30s load time (slow inference but **no API costs**) . No token limited as the cost is low.
|
| 186 |
+
- 🔧 **Help wanted!** If you’re into **edge-device AI**, let’s collaborate!
|
| 187 |
+
|
| 188 |
+
### **Other Assistants**
|
| 189 |
+
🟢 **TurboLLM** – Uses **gpt-4.1-mini** :
|
| 190 |
+
- **It performs very well but unfortunatly OpenAI charges per token. For this reason tokens usage is limited.
|
| 191 |
+
- **Create custom cmd processors to run .net code on Quantum Network Monitor Agents**
|
| 192 |
+
- **Real-time network diagnostics and monitoring**
|
| 193 |
+
- **Security Audits**
|
| 194 |
+
- **Penetration testing** (Nmap/Metasploit)
|
| 195 |
+
|
| 196 |
+
🔵 **HugLLM** – Latest Open-source models:
|
| 197 |
+
- 🌐 Runs on Hugging Face Inference API. Performs pretty well using the lastest models hosted on Novita.
|
| 198 |
+
|
| 199 |
+
### 💡 **Example commands you could test**:
|
| 200 |
+
1. `"Give me info on my websites SSL certificate"`
|
| 201 |
+
2. `"Check if my server is using quantum safe encyption for communication"`
|
| 202 |
+
3. `"Run a comprehensive security audit on my server"`
|
| 203 |
+
4. '"Create a cmd processor to .. (what ever you want)" Note you need to install a [Quantum Network Monitor Agent](https://readyforquantum.com/Download/?utm_source=huggingface&utm_medium=referral&utm_campaign=huggingface_repo_readme) to run the .net code on. This is a very flexible and powerful feature. Use with caution!
|
| 204 |
+
|
| 205 |
+
### Final Word
|
| 206 |
+
|
| 207 |
+
I fund the servers used to create these model files, run the Quantum Network Monitor service, and pay for inference from Novita and OpenAI—all out of my own pocket. All the code behind the model creation and the Quantum Network Monitor project is [open source](https://github.com/Mungert69). Feel free to use whatever you find helpful.
|
| 208 |
+
|
| 209 |
+
If you appreciate the work, please consider [buying me a coffee](https://www.buymeacoffee.com/mahadeva) ☕. Your support helps cover service costs and allows me to raise token limits for everyone.
|
| 210 |
+
|
| 211 |
+
I'm also open to job opportunities or sponsorship.
|
| 212 |
+
|
| 213 |
+
Thank you! 😊
|