You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Root cause and fix for inconsistent streaming and missing reasoning traces when running NIM backed reasoning models (deepseek-ai/deepseek-v4-pro, z-ai/glm-5.2) through OpenClaude.
Symptom: response text arrives in irregular bursts, sometimes near instant, sometimes stalling for a second or more, and the reasoning or thinking block that NIM is capable of streaming never renders in the CLI, even on models where it should.
I reverse engineered the shipped bundle (@gitlawb/openclaude, dist/cli.mjs, npm build dated Jul 7 2026, 21MB minified) rather than guessing. chat_template_kwargs and enable_thinking have zero occurrences anywhere in that file. Both wire formats that cover NIM routed models, deepseek_compatible and zai_compatible, only ever populate body.thinking or body.reasoning_effort in the OpenAI compatible request shim. Neither path ever sets chat_template_kwargs, which is the parameter the NIM template layer actually reads to gate bounded, streamed reasoning_content. Absent that signal, the upstream model still reasons, just without a budget or streaming contract on the NIM side, which lines up exactly with the erratic delivery and the silent drop of the reasoning trace.
The fix is a single conditional inserted immediately after the existing reasoning_effort handling in both wire format branches: when request.baseUrl contains integrate.api.nvidia.com, set body.chat_template_kwargs equal to thinking true and enable_thinking true, before the request is dispatched. Verified against deepseek-ai/deepseek-v4-pro on NIM: streaming is now continuous and the reasoning trace renders correctly, matching the documented contract for the DeepSeek and GLM builds on NIM.
This is currently a runtime patch against the minified dist bundle only, since the npm package ships without the matching TypeScript source for the provider shim. It needs to land in the actual openai-compat shim source to survive the next release. The exact patch, anchor string and injected snippet, is ready to hand off if a maintainer wants to take it from here.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Root cause and fix for inconsistent streaming and missing reasoning traces when running NIM backed reasoning models (deepseek-ai/deepseek-v4-pro, z-ai/glm-5.2) through OpenClaude.
Symptom: response text arrives in irregular bursts, sometimes near instant, sometimes stalling for a second or more, and the reasoning or thinking block that NIM is capable of streaming never renders in the CLI, even on models where it should.
I reverse engineered the shipped bundle (@gitlawb/openclaude, dist/cli.mjs, npm build dated Jul 7 2026, 21MB minified) rather than guessing. chat_template_kwargs and enable_thinking have zero occurrences anywhere in that file. Both wire formats that cover NIM routed models, deepseek_compatible and zai_compatible, only ever populate body.thinking or body.reasoning_effort in the OpenAI compatible request shim. Neither path ever sets chat_template_kwargs, which is the parameter the NIM template layer actually reads to gate bounded, streamed reasoning_content. Absent that signal, the upstream model still reasons, just without a budget or streaming contract on the NIM side, which lines up exactly with the erratic delivery and the silent drop of the reasoning trace.
The fix is a single conditional inserted immediately after the existing reasoning_effort handling in both wire format branches: when request.baseUrl contains integrate.api.nvidia.com, set body.chat_template_kwargs equal to thinking true and enable_thinking true, before the request is dispatched. Verified against deepseek-ai/deepseek-v4-pro on NIM: streaming is now continuous and the reasoning trace renders correctly, matching the documented contract for the DeepSeek and GLM builds on NIM.
This is currently a runtime patch against the minified dist bundle only, since the npm package ships without the matching TypeScript source for the provider shim. It needs to land in the actual openai-compat shim source to survive the next release. The exact patch, anchor string and injected snippet, is ready to hand off if a maintainer wants to take it from here.
All reactions