---
url: "https://www.reddit.com/r/Qwen_AI/comments/1voz9jy/fixed_jinja_chat_template_for_qwen_35_36_and_the/"
title: Fixed Jinja chat template for Qwen 3.5, 3.6, and the new 3.8 release
source_kind: reddit
subreddit: Qwen_AI
author: ex-arman68
score: 60
captured: "2026-08-17T00:43:56+00:00"
comment_tree: false
topics: [llm-frontend]
summary: A fixed Jinja chat template for Qwen 3.5/3.6/3.8 adds reasoning effort control, safe defaults, and universal tool parsing to prevent crashes and token burn.
status: ok
---

UPDATE (v22.1): Community reports highlighted an important issue with the official Qwen 3.8 chat template: the default xhigh effort prompt can burn 20,000+ tokens on coding tasks exploring alternatives until it hits max_tokens , returning empty content. v22.1 sets the default baseline to medium and adds inline chat tags ( <|think_low|> , <|think_xhigh|> , etc.) to steer the reasoning effort directly inside chats.
Qwen just released their first 3.8 model.
The main addition in 3.8 is prompt-steered reasoning effort. You can tell the model how deeply to think by setting reasoning_effort to xhigh , medium , or low .
However, the official template still has some serious problems:
- You cannot disable thinking. If you pass enable_thinking=false , it 3.8 crashes with a hard exception.
- Chat history gets poisoned. In multi-turn chats, the official template injects blank <think></think> tags before real thoughts.
- Tool calling crashes. If your client passes arguments as JSON strings (the standard OpenAI API format), the official template crashes.
- Agent stalls. The official template often drops mid-dialogue system messages and wedges multi-step tool loops.
I maintain a single, drop-in fixed Jinja template that works across all Qwen 3.5, 3.6, and 3.8 models:
https://huggingface.co/froggeric/Qwen-Fixed-Chat-Templates

# What this template does:

- Full 3.8 reasoning effort support: Steer reasoning depth via reasoning_effort kwargs or directly in chat prompts with <|think_low|> , <|think_medium|> , and <|think_xhigh|> .
- Safe medium default: Prevents the runaway token-burn on coding tasks while keeping 100% KV cache parity.
- Restores the thinking toggle: Turn off reasoning whenever you want fast answers, either via kwargs or by typing <|think_off|> in your prompt.
- 100% KV Cache hits: Keeps past thoughts intact by default so your prefix cache stays warm across turns.
- llama.cpp support: Native support for the new --reasoning-preserve flag.
- Universal tool parsing: Handles both Python dicts and JSON strings. Works on llama.cpp, vLLM, LM Studio, and MLX.

# Recommended llama-server launch command:

```
llama-server -m your_model.gguf --jinja --chat-template-file chat_template.jinja --reasoning-format deepseek

```

(The --reasoning-format deepseek flag separates thinking into the OpenAI reasoning_content field so OpenCode, Claude Code, and other harnesses do not stall on raw tokens).