Now that GLM-4.5 has been merged into llama.cpp, h...
# dev-help
c
Now that GLM-4.5 has been merged into llama.cpp, how do we feel about merging the
reasoning_content
PR? https://github.com/All-Hands-AI/OpenHands/pull/9374
l
@nutritious-balloon-65098 make it so
n
I'm on it! Graham Neubig can track my progress here.
c
I actually just tested GLM-4.5 with open hands and I don't even think that PR is necessary. It appears to not be using
reasoning_content
at all. They may be turning off thinking mode when it is used in the
assistant
role.
c
Out of curiosity, what other role than
assistant
can it have?
c
mmm. good point. I must be reading it wrong. https://huggingface.co/zai-org/GLM-4.5/raw/main/chat_template.jinja
c
Interesting, thank you! Seems that •
enable_thinking
controls insertion of a
/nothink
tag at the end of the
user
messages (when false) • if enabled, then it converts
<think></think>
in the
assistant
messages to
reasoning_content
• it has system, user, tool and assistant roles; only assistant is LLM
l
I'm not sure whether that PR can cause issues with the Claude thought display codepath or something else, but when I tested it, it seemed to work. However, that light gray box doesn't really look great, especially since reasoning shouldn't be prominent in the UI. I think the empty message issue can be left for later, since it's unrelated to the UI. My quick reasoning patch worked in all cases because it moved everything from reasoning_content into the message content where OH could parse it, but I don't think it's a proper solution. Also, when the LLM writes a function inside the reasoning block, the reasoning block will end up truncated because OH tells the LLM server to treat </function> as a stop token. And when the reasoning block is truncated, LiteLLM will treat it as a normal message. That explains those random messages with a starting <think> tag. That will have to be worked out as well. So, when I commented on that PR, I was wrong about it being a DeepSeek-specific issue; it's OH itself causing that behavior (@creamy-angle-16764 I think you can close the issue on llama.cpp repo). So, to recap: • I suggest to fix up, test and merge the current reasoning PR, have it only display the reasoning • A decision has to be made on how to handle messages with all reasoning and no message • A decision should be made on the stop token (at least for reasoning LLMs)
👍 2
c
Ooh, I see, thank you, great summary! On the stop token, we can can skip it for reasoning LLMs. We are skipping it for some already (o1 and such)
c
I'd love it if we could figure out how to get R1-0528 to stop stopping. lol. Apparently it's still better at coding than every OSS model out there, according to this benchmark: https://aider.chat/docs/leaderboards/ Even GLM-4.5, Qwen3-Coder, and GPT-OSS don't come close. I can run the stupid thing too. It just tends to stop the conversation in Open Hands. sigh.