Instructions to use Chinook416/caracat_code with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Chinook416/caracat_code with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Chinook416/caracat_code")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Chinook416/caracat_code", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Chinook416/caracat_code with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Chinook416/caracat_code" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Chinook416/caracat_code", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Chinook416/caracat_code
- SGLang
How to use Chinook416/caracat_code 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 "Chinook416/caracat_code" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Chinook416/caracat_code", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "Chinook416/caracat_code" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Chinook416/caracat_code", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Chinook416/caracat_code with Docker Model Runner:
docker model run hf.co/Chinook416/caracat_code
Update README.md
Browse files
README.md
CHANGED
|
@@ -5,204 +5,39 @@ license_link: https://huggingface.co/Qwen/Qwen3-Coder-Next/blob/main/LICENSE
|
|
| 5 |
pipeline_tag: text-generation
|
| 6 |
---
|
| 7 |
|
| 8 |
-
#
|
| 9 |
|
| 10 |
-
|
| 11 |
|
| 12 |
-
|
| 13 |
|
| 14 |
-
|
| 15 |
-
- **Advanced Agentic Capabilities**: Through an elaborate training recipe, it excels at long-horizon reasoning, complex tool usage, and recovery from execution failures, ensuring robust performance in dynamic coding tasks.
|
| 16 |
-
- **Versatile Integration with Real-World IDE**: Its 256k context length, combined with adaptability to various scaffold templates, enables seamless integration with different CLI/IDE platforms (e.g., Claude Code, Qwen Code, Qoder, Kilo, Trae, Cline, etc.), supporting diverse development environments.
|
| 17 |
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
|
| 20 |
-
|
| 21 |
|
| 22 |
-
|
| 23 |
|
| 24 |
-
**Qwen3-Coder-Next**
|
| 25 |
-
- Type: Causal Language Models
|
| 26 |
-
- Training Stage: Pretraining & Post-training
|
| 27 |
-
- Number of Parameters: 80B in total and 3B activated
|
| 28 |
-
- Number of Parameters (Non-Embedding): 79B
|
| 29 |
-
- Hidden Dimension: 2048
|
| 30 |
-
- Number of Layers: 48
|
| 31 |
-
- Hybrid Layout: 12 \* (3 \* (Gated DeltaNet -> MoE) -> 1 \* (Gated Attention -> MoE))
|
| 32 |
-
- Gated Attention:
|
| 33 |
-
- Number of Attention Heads: 16 for Q and 2 for KV
|
| 34 |
-
- Head Dimension: 256
|
| 35 |
-
- Rotary Position Embedding Dimension: 64
|
| 36 |
-
- Gated DeltaNet:
|
| 37 |
-
- Number of Linear Attention Heads: 32 for V and 16 for QK
|
| 38 |
-
- Head Dimension: 128
|
| 39 |
-
- Mixture of Experts:
|
| 40 |
-
- Number of Experts: 512
|
| 41 |
-
- Number of Activated Experts: 10
|
| 42 |
-
- Number of Shared Experts: 1
|
| 43 |
-
- Expert Intermediate Dimension: 512
|
| 44 |
-
- Context Length: 262,144 natively
|
| 45 |
|
| 46 |
-
|
| 47 |
|
| 48 |
-
|
| 49 |
|
|
|
|
| 50 |
|
| 51 |
-
##
|
| 52 |
|
| 53 |
-
|
| 54 |
|
| 55 |
-
|
| 56 |
-
```python
|
| 57 |
-
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 58 |
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
# load the tokenizer and the model
|
| 62 |
-
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 63 |
-
model = AutoModelForCausalLM.from_pretrained(
|
| 64 |
-
model_name,
|
| 65 |
-
torch_dtype="auto",
|
| 66 |
-
device_map="auto"
|
| 67 |
-
)
|
| 68 |
-
|
| 69 |
-
# prepare the model input
|
| 70 |
-
prompt = "Write a quick sort algorithm."
|
| 71 |
-
messages = [
|
| 72 |
-
{"role": "user", "content": prompt}
|
| 73 |
-
]
|
| 74 |
-
text = tokenizer.apply_chat_template(
|
| 75 |
-
messages,
|
| 76 |
-
tokenize=False,
|
| 77 |
-
add_generation_prompt=True,
|
| 78 |
-
)
|
| 79 |
-
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
|
| 80 |
-
|
| 81 |
-
# conduct text completion
|
| 82 |
-
generated_ids = model.generate(
|
| 83 |
-
**model_inputs,
|
| 84 |
-
max_new_tokens=65536
|
| 85 |
-
)
|
| 86 |
-
output_ids = generated_ids[0][len(model_inputs.input_ids[0]):].tolist()
|
| 87 |
-
|
| 88 |
-
content = tokenizer.decode(output_ids, skip_special_tokens=True)
|
| 89 |
-
|
| 90 |
-
print("content:", content)
|
| 91 |
-
```
|
| 92 |
-
|
| 93 |
-
**Note: If you encounter out-of-memory (OOM) issues, consider reducing the context length to a shorter value, such as `32,768`.**
|
| 94 |
-
|
| 95 |
-
For local use, applications such as Ollama, LMStudio, MLX-LM, llama.cpp, and KTransformers have also supported Qwen3.
|
| 96 |
-
|
| 97 |
-
## Deployment
|
| 98 |
-
|
| 99 |
-
For deployment, you can use the latest `sglang` or `vllm` to create an OpenAI-compatible API endpoint.
|
| 100 |
-
|
| 101 |
-
### SGLang
|
| 102 |
-
|
| 103 |
-
[SGLang](https://github.com/sgl-project/sglang) is a fast serving framework for large language models and vision language models.
|
| 104 |
-
SGLang could be used to launch a server with OpenAI-compatible API service.
|
| 105 |
-
|
| 106 |
-
`sglang>=v0.5.8` is required for Qwen3-Coder-Next, which can be installed using:
|
| 107 |
-
```shell
|
| 108 |
-
pip install 'sglang[all]>=v0.5.8'
|
| 109 |
-
```
|
| 110 |
-
See [its documentation](https://docs.sglang.ai/get_started/install.html) for more details.
|
| 111 |
-
|
| 112 |
-
The following command can be used to create an API endpoint at `http://localhost:30000/v1` with maximum context length 256K tokens using tensor parallel on 4 GPUs.
|
| 113 |
-
```shell
|
| 114 |
-
python -m sglang.launch_server --model Qwen/Qwen3-Coder-Next --port 30000 --tp-size 2 --tool-call-parser qwen3_coder
|
| 115 |
-
```
|
| 116 |
-
|
| 117 |
-
> [!Note]
|
| 118 |
-
> The default context length is 256K. Consider reducing the context length to a smaller value, e.g., `32768`, if the server fails to start.
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
### vLLM
|
| 122 |
-
|
| 123 |
-
[vLLM](https://github.com/vllm-project/vllm) is a high-throughput and memory-efficient inference and serving engine for LLMs.
|
| 124 |
-
vLLM could be used to launch a server with OpenAI-compatible API service.
|
| 125 |
-
|
| 126 |
-
`vllm>=0.15.0` is required for Qwen3-Coder-Next, which can be installed using:
|
| 127 |
-
```shell
|
| 128 |
-
pip install 'vllm>=0.15.0'
|
| 129 |
-
```
|
| 130 |
-
See [its documentation](https://docs.vllm.ai/en/stable/getting_started/installation/index.html) for more details.
|
| 131 |
-
|
| 132 |
-
The following command can be used to create an API endpoint at `http://localhost:8000/v1` with maximum context length 256K tokens using tensor parallel on 4 GPUs.
|
| 133 |
-
```shell
|
| 134 |
-
vllm serve Qwen/Qwen3-Coder-Next --port 8000 --tensor-parallel-size 2 --enable-auto-tool-choice --tool-call-parser qwen3_coder
|
| 135 |
-
```
|
| 136 |
-
|
| 137 |
-
> [!Note]
|
| 138 |
-
> The default context length is 256K. Consider reducing the context length to a smaller value, e.g., `32768`, if the server fails to start.
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
## Agentic Coding
|
| 142 |
-
|
| 143 |
-
Qwen3-Coder-Next excels in tool calling capabilities.
|
| 144 |
-
|
| 145 |
-
You can simply define or use any tools as following example.
|
| 146 |
-
```python
|
| 147 |
-
# Your tool implementation
|
| 148 |
-
def square_the_number(num: float) -> dict:
|
| 149 |
-
return num ** 2
|
| 150 |
-
|
| 151 |
-
# Define Tools
|
| 152 |
-
tools=[
|
| 153 |
-
{
|
| 154 |
-
"type":"function",
|
| 155 |
-
"function":{
|
| 156 |
-
"name": "square_the_number",
|
| 157 |
-
"description": "output the square of the number.",
|
| 158 |
-
"parameters": {
|
| 159 |
-
"type": "object",
|
| 160 |
-
"required": ["input_num"],
|
| 161 |
-
"properties": {
|
| 162 |
-
'input_num': {
|
| 163 |
-
'type': 'number',
|
| 164 |
-
'description': 'input_num is a number that will be squared'
|
| 165 |
-
}
|
| 166 |
-
},
|
| 167 |
-
}
|
| 168 |
-
}
|
| 169 |
-
}
|
| 170 |
-
]
|
| 171 |
-
|
| 172 |
-
from openai import OpenAI
|
| 173 |
-
# Define LLM
|
| 174 |
-
client = OpenAI(
|
| 175 |
-
# Use a custom endpoint compatible with OpenAI API
|
| 176 |
-
base_url='http://localhost:8000/v1', # api_base
|
| 177 |
-
api_key="EMPTY"
|
| 178 |
-
)
|
| 179 |
-
|
| 180 |
-
messages = [{'role': 'user', 'content': 'square the number 1024'}]
|
| 181 |
-
|
| 182 |
-
completion = client.chat.completions.create(
|
| 183 |
-
messages=messages,
|
| 184 |
-
model="Qwen3-Coder-Next",
|
| 185 |
-
max_tokens=65536,
|
| 186 |
-
tools=tools,
|
| 187 |
-
)
|
| 188 |
-
|
| 189 |
-
print(completion.choices[0])
|
| 190 |
-
```
|
| 191 |
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
To achieve optimal performance, we recommend the following sampling parameters: `temperature=1.0`, `top_p=0.95`, `top_k=40`.
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
## Citation
|
| 198 |
-
|
| 199 |
-
If you find our work helpful, feel free to give us a cite.
|
| 200 |
-
|
| 201 |
-
```
|
| 202 |
-
@techreport{qwen_qwen3_coder_next_tech_report,
|
| 203 |
-
title = {Qwen3-Coder-Next Technical Report},
|
| 204 |
-
author = {{Qwen Team}},
|
| 205 |
-
url = {https://github.com/QwenLM/Qwen3-Coder/blob/main/qwen3_coder_next_tech_report.pdf},
|
| 206 |
-
note = {Accessed: 2026-02-03}
|
| 207 |
-
}
|
| 208 |
-
```
|
|
|
|
| 5 |
pipeline_tag: text-generation
|
| 6 |
---
|
| 7 |
|
| 8 |
+
# 🐈⬛ Caracat Code
|
| 9 |
|
| 10 |
+
**Caracat Code** is an AI coding model based on **Qwen3-Coder-Next**.
|
| 11 |
|
| 12 |
+
The goal of Caracat Code is to create a powerful and flexible coding model for software development, code generation, debugging, code analysis, and AI coding agents.
|
| 13 |
|
| 14 |
+
## 🚀 Features
|
|
|
|
|
|
|
| 15 |
|
| 16 |
+
- 💻 Code generation
|
| 17 |
+
- 🧠 Code understanding and analysis
|
| 18 |
+
- 🐛 Debugging and error fixing
|
| 19 |
+
- 🔧 Code refactoring and optimization
|
| 20 |
+
- 🤖 Support for coding-agent workflows
|
| 21 |
+
- 📚 Fine-tuning and further development
|
| 22 |
|
| 23 |
+
## 🧬 Base Model
|
| 24 |
|
| 25 |
+
Caracat Code is based on:
|
| 26 |
|
| 27 |
+
**Qwen3-Coder-Next**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
|
| 29 |
+
The original model is provided by Qwen and is licensed under **Apache 2.0**.
|
| 30 |
|
| 31 |
+
## 🛠️ Development
|
| 32 |
|
| 33 |
+
Caracat Code is an ongoing project. The model may be further trained, fine-tuned, optimized, and modified over time.
|
| 34 |
|
| 35 |
+
## 📜 License
|
| 36 |
|
| 37 |
+
Caracat Code follows the licensing requirements of its base model and its own modifications.
|
| 38 |
|
| 39 |
+
For the original Qwen3-Coder-Next model, see the original model repository and its Apache 2.0 license.
|
|
|
|
|
|
|
| 40 |
|
| 41 |
+
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
|
| 43 |
+
🐈⬛ **Caracat Code — Coding, reimagined.**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|