{
  "video_id": "reddit_1vnm7le",
  "channel_slug": "LocalLLaMA",
  "channel_handle": "r/LocalLLaMA",
  "title": "Fixed Jinja chat template for Qwen 3.5, 3.6, and the new 3.8 release",
  "url": "https://www.reddit.com/r/LocalLLaMA/comments/1vnm7le/fixed_jinja_chat_template_for_qwen_35_36_and_the/",
  "external_url": null,
  "upload_date": "20260813",
  "published_at": "2026-08-13T20:22:56+00:00",
  "transcript": "Qwen just released their first 3.8 model.\n\nThe 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`.\n\nHowever, the official template still has some serious problems:\n\n* **You cannot disable thinking.** If you pass `enable_thinking=false`, it 3.8 crashes with a hard exception.\n* **Chat history gets poisoned.** In multi-turn chats, the official template injects blank `<think></think>` tags before real thoughts.\n* **Tool calling crashes.** If your client passes arguments as JSON strings (the standard OpenAI API format), the official template crashes.\n* **Agent stalls.** The official template often drops mid-dialogue system messages and wedges multi-step tool loops.\n\nI maintain a single, drop-in fixed Jinja template that works across all Qwen 3.5, 3.6, and 3.8 models:\n\n[https://huggingface.co/froggeric/Qwen-Fixed-Chat-Templates](https://huggingface.co/froggeric/Qwen-Fixed-Chat-Templates)\n\n# What this template does:\n\n* **Full 3.8 reasoning effort support:** Steer reasoning depth with `reasoning_effort` (`xhigh`, `high`, `low`, `medium`).\n* **Restores the thinking toggle:** Turn off reasoning whenever you want fast answers, either via kwargs or by typing `<|think_off|>` in your prompt.\n* **100% KV Cache hits:** Keeps past thoughts intact by default so your prefix cache stays warm across turns.\n* **llama.cpp support:** Native support for the new `--reasoning-preserve` flag.\n* **Universal tool parsing:** Handles both Python dicts and JSON strings. Works on llama.cpp, vLLM, LM Studio, and MLX.\n\n# Recommended llama-server launch command:\n\n    llama-server -m your_model.gguf --jinja --chat-template-file chat_template.jinja --reasoning-format deepseek\n\n*(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).*\n\n# Note on hardware:\n\nI cannot run a 2.4 trillion parameter model on my local rig. The template passes all 28 automated tests and tokenizer parity checks, but I would appreciate feedback from anyone testing it with Qwen 3.8.\n\n\n\n--- Top Comments ---\n\n\n[41 upvotes] Can someone explain why the Qwen team cannot get the template right in the first place? Don’t they QA test their own models?\n\n[6 upvotes] Cool, let's see how this plays out with the 27b, probably a bit more accessible to the normies (and me).",
  "transcript_chars": 2465,
  "ingested_at": "2026-08-14T01:30:04.312633+00:00",
  "source": "reddit",
  "yt_meta": {
    "score": 153,
    "upvote_ratio": 0.95,
    "num_comments": 38,
    "author": "ex-arman68",
    "is_self": true
  }
}