[FEATURE]: Add extra body for NVIDIA NIM support #9321

Open
opened 2026-02-16 18:12:10 -05:00 by yindo · 1 comment
Owner

Originally created by @andriixyz on GitHub (Feb 14, 2026).

Originally assigned to: @thdxr on GitHub.

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

From the official documentation for nvidia nim it is possible to set "enable_thinking":true,"clear_thinking":false inside the request

https://build.nvidia.com/z-ai/glm5/modelcard

Example of code:

import OpenAI from 'openai';

const openai = new OpenAI({
  apiKey: '$NVIDIA_API_KEY',
  baseURL: 'https://integrate.api.nvidia.com/v1',
})
 
async function main() {
  const completion = await openai.chat.completions.create({
    model: "z-ai/glm5",
    messages: [{"role":"user","content":""}],
    temperature: 1,
    top_p: 1,
    max_tokens: 16384,
    chat_template_kwargs: {"enable_thinking":true,"clear_thinking":false},
    stream: true
  })
   
  for await (const chunk of completion) {
        const reasoning = chunk.choices[0]?.delta?.reasoning_content;
    if (reasoning) process.stdout.write(reasoning);
        process.stdout.write(chunk.choices[0]?.delta?.content || '')
    
  }
  
}

main();
Originally created by @andriixyz on GitHub (Feb 14, 2026). Originally assigned to: @thdxr on GitHub. ### Feature hasn't been suggested before. - [x] I have verified this feature I'm about to request hasn't been suggested before. ### Describe the enhancement you want to request From the official documentation for nvidia nim it is possible to set `"enable_thinking":true,"clear_thinking":false ` inside the request https://build.nvidia.com/z-ai/glm5/modelcard Example of code: ``` import OpenAI from 'openai'; const openai = new OpenAI({ apiKey: '$NVIDIA_API_KEY', baseURL: 'https://integrate.api.nvidia.com/v1', }) async function main() { const completion = await openai.chat.completions.create({ model: "z-ai/glm5", messages: [{"role":"user","content":""}], temperature: 1, top_p: 1, max_tokens: 16384, chat_template_kwargs: {"enable_thinking":true,"clear_thinking":false}, stream: true }) for await (const chunk of completion) { const reasoning = chunk.choices[0]?.delta?.reasoning_content; if (reasoning) process.stdout.write(reasoning); process.stdout.write(chunk.choices[0]?.delta?.content || '') } } main();
yindo added the discussion label 2026-02-16 18:12:10 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Feb 14, 2026):

This issue might be related to existing feature requests for thinking/reasoning support on NVIDIA. Please check:

  • #12396: Add thinking/reasoning support for GLM-4.7, Kimi K2.5, and MiniMax M2.1 on Zen
  • #13515: Kimi 2.5 Reasoning Cutoff/Missing when using NVIDIA API

Consider whether your feature request overlaps with these existing issues, or if it addresses a separate use case.

@github-actions[bot] commented on GitHub (Feb 14, 2026): This issue might be related to existing feature requests for thinking/reasoning support on NVIDIA. Please check: - #12396: Add thinking/reasoning support for GLM-4.7, Kimi K2.5, and MiniMax M2.1 on Zen - #13515: Kimi 2.5 Reasoning Cutoff/Missing when using NVIDIA API Consider whether your feature request overlaps with these existing issues, or if it addresses a separate use case.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#9321