21-fix chat template — addresses tool calling crash (discussion #4) and other open bugs

#56
by deleted - opened
deleted

Hi Qwen team,

I've been running Qwen 3.5 models extensively and encountered several bugs in the official chat template. I've implemented 21 fixes and am sharing the template for anyone who needs it.

Bugs fixed that are still open:

  • Tool calling crash from arguments | items (discussion #4 in this repo)
  • Parallel tool calls not separated properly
  • <tool_call> leaking into <think> blocks when tools are active
  • Deep agent loops crashing after 5+ tool hops
  • Unknown roles (planner, critic) causing hard crashes
  • Streaming parsers failing on XML tag boundaries

Template: https://huggingface.co/barubary/qwen3.5-barubary-attuned-chat-template

All 21 fixes are documented inline with FIX tags and in the README. The template is Apache 2.0, same as yours. Happy to submit a PR if you'd prefer to merge these upstream.

Tested on: llama.cpp, Open WebUI, vLLM, Ollama, LM Studio, Text Generation WebUI.

Where is the template ?

Where is the template ?

Ok, I see it has been updated to model files. The current template present in model files seems to have fixed issues.

The poster delete thier account?

Sign up or log in to comment