Text Generation
Transformers
Safetensors
English
Chinese
qwen3_5_moe
image-text-to-text
code
agent
agentic-coding
Mixture of Experts
coding
conversational
Instructions to use Kwaipilot/KAT-Coder-V2.5-Dev with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Kwaipilot/KAT-Coder-V2.5-Dev with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Kwaipilot/KAT-Coder-V2.5-Dev") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("Kwaipilot/KAT-Coder-V2.5-Dev") model = AutoModelForMultimodalLM.from_pretrained("Kwaipilot/KAT-Coder-V2.5-Dev", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Kwaipilot/KAT-Coder-V2.5-Dev with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Kwaipilot/KAT-Coder-V2.5-Dev" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Kwaipilot/KAT-Coder-V2.5-Dev", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Kwaipilot/KAT-Coder-V2.5-Dev
- SGLang
How to use Kwaipilot/KAT-Coder-V2.5-Dev with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "Kwaipilot/KAT-Coder-V2.5-Dev" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Kwaipilot/KAT-Coder-V2.5-Dev", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "Kwaipilot/KAT-Coder-V2.5-Dev" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Kwaipilot/KAT-Coder-V2.5-Dev", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Kwaipilot/KAT-Coder-V2.5-Dev with Docker Model Runner:
docker model run hf.co/Kwaipilot/KAT-Coder-V2.5-Dev
docs: fix deployment commands — vLLM requires --language-model-only (text-only weights); transformers needs accelerate and drop --continuous-batching; SGLang note
Browse files
README.md
CHANGED
|
@@ -207,6 +207,8 @@ uv pip install sglang[all]
|
|
| 207 |
|
| 208 |
The following will create API endpoints at `http://localhost:8000/v1`:
|
| 209 |
|
|
|
|
|
|
|
| 210 |
- Standard Version: The following command can be used to create an API endpoint with maximum context length 262,144 tokens using tensor parallel on 8 GPUs.
|
| 211 |
```shell
|
| 212 |
python -m sglang.launch_server \
|
|
@@ -239,13 +241,16 @@ uv pip install vllm --torch-backend=auto
|
|
| 239 |
|
| 240 |
The following will create API endpoints at `http://localhost:8000/v1`:
|
| 241 |
|
|
|
|
|
|
|
| 242 |
- Standard Version: The following command can be used to create an API endpoint with maximum context length 262,144 tokens using tensor parallel on 8 GPUs.
|
| 243 |
```shell
|
| 244 |
vllm serve Kwaipilot/KAT-Coder-V2.5-Dev \
|
| 245 |
--port 8000 \
|
| 246 |
--tensor-parallel-size 8 \
|
| 247 |
--max-model-len 262144 \
|
| 248 |
-
--reasoning-parser qwen3
|
|
|
|
| 249 |
```
|
| 250 |
- Tool Call: To support tool use, you can use the following command.
|
| 251 |
```shell
|
|
@@ -255,15 +260,7 @@ The following will create API endpoints at `http://localhost:8000/v1`:
|
|
| 255 |
--max-model-len 262144 \
|
| 256 |
--reasoning-parser qwen3 \
|
| 257 |
--enable-auto-tool-choice \
|
| 258 |
-
--tool-call-parser qwen3_coder
|
| 259 |
-
```
|
| 260 |
-
- Text-Only: The following command skips the vision encoder and multimodal profiling to free up memory for additional KV cache:
|
| 261 |
-
```shell
|
| 262 |
-
vllm serve Kwaipilot/KAT-Coder-V2.5-Dev \
|
| 263 |
-
--port 8000 \
|
| 264 |
-
--tensor-parallel-size 8 \
|
| 265 |
-
--max-model-len 262144 \
|
| 266 |
-
--reasoning-parser qwen3 \
|
| 267 |
--language-model-only
|
| 268 |
```
|
| 269 |
|
|
@@ -273,16 +270,16 @@ KTransformers is a flexible framework for experiencing cutting-edge LLM inferenc
|
|
| 273 |
|
| 274 |
#### Hugging Face Transformers
|
| 275 |
|
| 276 |
-
Hugging Face Transformers contains a lightweight server which can be used for quick testing and moderate load deployment. The latest transformers is required for KAT-Coder-V2.5-Dev:
|
| 277 |
|
| 278 |
```shell
|
| 279 |
-
pip install "transformers[serving]"
|
| 280 |
```
|
| 281 |
|
| 282 |
Then, run transformers serve to launch a server with API endpoints at `http://localhost:8000/v1`; it will place the model on accelerators if available:
|
| 283 |
|
| 284 |
```shell
|
| 285 |
-
transformers serve Kwaipilot/KAT-Coder-V2.5-Dev --port 8000
|
| 286 |
```
|
| 287 |
|
| 288 |
## Using KAT-Coder-V2.5-Dev via the Chat Completions API
|
|
|
|
| 207 |
|
| 208 |
The following will create API endpoints at `http://localhost:8000/v1`:
|
| 209 |
|
| 210 |
+
> **Note:** This open-weight release ships only the language-model weights (no vision tower). If your SGLang version attempts to build the multimodal/vision components at load time, startup may fail on missing vision weights; in that case, run with the version's text/language-model-only option (see `python -m sglang.launch_server --help`).
|
| 211 |
+
|
| 212 |
- Standard Version: The following command can be used to create an API endpoint with maximum context length 262,144 tokens using tensor parallel on 8 GPUs.
|
| 213 |
```shell
|
| 214 |
python -m sglang.launch_server \
|
|
|
|
| 241 |
|
| 242 |
The following will create API endpoints at `http://localhost:8000/v1`:
|
| 243 |
|
| 244 |
+
> **Note:** This open-weight release ships only the language-model weights, so the `--language-model-only` flag is **required**. It tells vLLM to skip the vision encoder and multimodal profiling; without it, vLLM attempts to initialize vision-tower weights that are not present in the checkpoint and startup fails.
|
| 245 |
+
|
| 246 |
- Standard Version: The following command can be used to create an API endpoint with maximum context length 262,144 tokens using tensor parallel on 8 GPUs.
|
| 247 |
```shell
|
| 248 |
vllm serve Kwaipilot/KAT-Coder-V2.5-Dev \
|
| 249 |
--port 8000 \
|
| 250 |
--tensor-parallel-size 8 \
|
| 251 |
--max-model-len 262144 \
|
| 252 |
+
--reasoning-parser qwen3 \
|
| 253 |
+
--language-model-only
|
| 254 |
```
|
| 255 |
- Tool Call: To support tool use, you can use the following command.
|
| 256 |
```shell
|
|
|
|
| 260 |
--max-model-len 262144 \
|
| 261 |
--reasoning-parser qwen3 \
|
| 262 |
--enable-auto-tool-choice \
|
| 263 |
+
--tool-call-parser qwen3_coder \
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 264 |
--language-model-only
|
| 265 |
```
|
| 266 |
|
|
|
|
| 270 |
|
| 271 |
#### Hugging Face Transformers
|
| 272 |
|
| 273 |
+
Hugging Face Transformers contains a lightweight server which can be used for quick testing and moderate load deployment. The latest transformers is required for KAT-Coder-V2.5-Dev. Installing `accelerate` is also required for multi-GPU (sharded) loading:
|
| 274 |
|
| 275 |
```shell
|
| 276 |
+
pip install "transformers[serving]" accelerate
|
| 277 |
```
|
| 278 |
|
| 279 |
Then, run transformers serve to launch a server with API endpoints at `http://localhost:8000/v1`; it will place the model on accelerators if available:
|
| 280 |
|
| 281 |
```shell
|
| 282 |
+
transformers serve Kwaipilot/KAT-Coder-V2.5-Dev --port 8000
|
| 283 |
```
|
| 284 |
|
| 285 |
## Using KAT-Coder-V2.5-Dev via the Chat Completions API
|