Fixed/Improved Jinja Chat Template for Qwen 3.8: Reasoning & Tool Calls

Chromix_ · reddit · 2026-08-15

A deep dive into fixing and improving the Jinja chat template for Qwen 3.8. The author compared the original template with a recent modification, finding that while the original had issues with invalid reasoning effort and missing historical fields, the previous modification introduced deviations from the training format and new bugs. The new template maintains fidelity to the original training prompt format while fixing logic, such as aliasing high to xhigh, correctly handling JSON tool-call mode, and preventing Boolean argument regression. A detailed table compares the behavior of all three templates across various edge cases.

Original post →

More from coding & agent

coding & agent channel →