Downloads · 30 days
0
AibSu/qwen3-enhanced-chat-template
qwen3-enhanced-chat-template is a machine learning model from AibSu. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
Based on froggeric/Qwen-Fixed-Chat-Templates with additional hardening.
Downloads · 30 days
0
Access
Public
Updated May 12, 2026
Repo size
—
Likes
1
Public
Click a slice to open those files.
.jinja11.1 KB · 71%
From the Hugging Face model README
Based on froggeric/Qwen-Fixed-Chat-Templates with additional hardening.
Drop-in Jinja2 template that fixes 9 bugs from the official Qwen3.6 template and adds dynamic thinking toggle and defensive type checking.
| # | Bug | Impact |
|---|---|---|
| 1 | No item is not mapping guard | C++ engines (llama.cpp/LM Studio) crash |
| 2 | add_vision_id undefined access | Strict engines crash |
| 3 | developer role rejected | OpenAI-compatible API fails |
| 4 | Missing video_url key | Video input ignored |
| 5 | raise_exception on tool-only chains | Agent frameworks crash (LangChain/AutoGen/Claude Code) |
| 6 | Solo <think tag not handled | Parsing errors |
| 7 | Empty thinking blocks rendered | Wastes context tokens |
| 8 | Tool call missing name check | Malformed output |
| 9 | Tool call arguments not validated | Silent corruption |
<|think_on|> / <|think_off|> in any message to switch per-turnns_flags.enable_thinking persists across all messagesdeveloper role support: Fully compatible with OpenAI APIvideo_url support: Video inputs via video_url key detectedchat_template: /path/to/qwen3.6/chat_template.jinja
Place chat_template.jinja alongside your model files.
messages = [
{"role": "system", "content": "You are helpful. <|think_off|>"},
{"role": "user", "content": "What is 2+2?"}, # no thinking
{"role": "assistant", "content": "4"},
{"role": "user", "content": "<|think_on|> Prove Fermat's theorem"} # thinking ON
]
response = client.chat.completions.create(
model="Qwen3.6-27B-FP8",
messages=messages,
extra_body={
"chat_template_kwargs": {
"enable_thinking": False, # disable thinking
"preserve_thinking": True # keep thinking blocks in history
}
}
)
| Engine | Status |
|---|---|
| vLLM >= 0.6 | Tested (primary) |
| llama.cpp | Compatible |
| LM Studio | Compatible |
| Ollama | Compatible |
| SGLang | Compatible |