Vibeleaderboard
← All Intel
Intel / post

A chat template bug makes GLM-5.1 loop on tool calls

Source
x.com
Date
Z.ai@Zai_org

GLM-5.1 Tool Calling Issue Fix & Chat Template Update If you are running GLM-5.1 with vLLM/SGLang and using tool calling, please update your chat template. https://t.co/XyyCucws82 Issue When using tool calling, frameworks including vLLM automatically convert plain-text tool message content into an array of content parts (`[{"type": "text", "text": "..."}]`) before passing it to the chat template. The original template only supported string-formatted tool content, causing array-formatted tool outputs to render empty. As a result, the model does not receive tool results and repeatedly triggers the same tool call in a loop. Affected Models All GLM-5.1 variants deployed with vLLM or SGLang. Fix Simply replace your existing `chat_template.jinja` with the updated version from the repository.

Context

Z.ai traced a GLM-5.1 tool-call loop to a formatting mismatch that hid tool results from the model. Serving software could pass a tool's reply as a collection of text parts, while the original chat template expected a plain string. According to the bug notice, that mismatch rendered the result empty, causing the model to request the same tool again.

The prescribed fix was to replace chat_template.jinja for affected vLLM or SGLang deployments. The repository template handles both strings and text-part collections, preserving the information the model needs to continue after a tool responds.

More from Z.ai
Recommended reads
Comments

Checking sign-in…

Loading comments…