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
{{ message }}
Repository navigation
Deepseek models: deepseek-ai/deepseek-v4-flash, deepseek-ai/deepseek-v4-pro for Nvidia Nim provider not working #341
jcode cannot connect to NVIDIA NIM DeepSeek V4 models (deepseek-ai/deepseek-v4-flash and deepseek-ai/deepseek-v4-pro) because the OpenAI-compatible provider does not send the required chat_template_kwargs parameters.
Symptoms
deepseek-ai/deepseek-v4-flash → Request hangs indefinitely, eventually times out
deepseek-ai/deepseek-v4-pro → 404 Not Found (or hangs, depending on model availability)
Root Cause
NVIDIA NIM requires non-standard chat_template_kwargs for DeepSeek V4 reasoning models. Without these parameters, the API does not respond — it hangs rather than returning an error.
changed the title [-]Deepseek models (flash and pro) for Nvidia Nim provider not working[/-][+]Deepseek models: deepseek-ai/deepseek-v4-flash, deepseek-ai/deepseek-v4-pro for Nvidia Nim provider not working[/+]on Jun 8, 2026
Triage: confirmed (feature gap). NVIDIA NIM is wired as an OpenAI-compatible profile (NVIDIA_NIM_PROFILE, api_base: https://integrate.api.nvidia.com/v1, crates/jcode-provider-metadata/src/catalog.rs), and that path builds a standard chat/completions body. There is no mechanism to inject non-standard request fields: searched the tree and chat_template_kwargs and extra_body both have zero matches. So DeepSeek-V4 NIM models that require chat_template_kwargs: { thinking, reasoning_effort } cannot be driven, matching the reported hang (NIM holds the connection open with no response when the required kwargs are absent).
The reporters suggested fix (in the comment) is reasonable and matches what Id propose:
A generic extra_body passthrough on OpenAI-compatible providers (config-driven JSON merged into the request body) -- the clean, model-agnostic solution.
Optionally, auto-injecting chat_template_kwargs when the profile is NVIDIA NIM and the model id contains deepseek-v4 -- convenient but brittle; the generic passthrough should land first.
Note: the deepseek-v4-pro 404 is likely just model availability on the account/region and separate from the kwargs hang. Labeling enhancement / priority: medium / triage: needs-decision (the generic extra_body design is the open decision).
Update: reproduced and fixed (the chat_template_kwargs passthrough; the v4-pro hang is a separate NVIDIA-side issue, see below).
Reproduction (live, against integrate.api.nvidia.com)
Both models exist on the account: deepseek-ai/deepseek-v4-flash and deepseek-ai/deepseek-v4-pro.
deepseek-v4-flash: basic, streaming, and streaming+tools requests all succeed without kwargs. But chat_template_kwargs: {thinking: true, reasoning_effort: high} is exactly what turns reasoning on - with it the response includes reasoning_content, without it none. jcode had no way to send these (extra_body/chat_template_kwargs = 0 matches in the tree), so reasoning was simply unreachable.
deepseek-v4-pro: hangs server-side (60s, zero bytes) with or without kwargs. That is a NVIDIA capacity/availability problem on that model, not something jcode can fix; the 404/hang you saw on pro is upstream.
Fix (committed)
Added a generic, model-agnostic extra_body passthrough for the OpenAI-compatible / OpenRouter provider path (this is the reporter-suggested option 1, done cleanly so it is not NIM-specific):
extra_body is merged last into the chat/completions body, so it can satisfy or override jcode-generated fields (env wins over config on key collisions). Invalid input is logged and ignored, never fatal.
Verification
Live A/B against nvidia-nim deepseek-v4-flash: withextra_body the model streams reasoning (💭), without it there is none.
8 unit tests added: resolver sources/precedence, invalid-input handling, named-profile threading, and the documented nested-table TOML config path. All green; full openrouter suite (74 tests) passes.
Documented both paths in the README ("Extra request-body fields").
I auto-labeled enhancement / triage: reproducible (downgrading the earlier needs-decision since the design is now implemented). This will land in the next release.
Activity
[-]Deepseek models (flash and pro) for Nvidia Nim provider not working[/-][+]Deepseek models: deepseek-ai/deepseek-v4-flash, deepseek-ai/deepseek-v4-pro for Nvidia Nim provider not working[/+]bitno2u commentedon Jun 8, 2026
Suggested Fix:
Add support for one of the following:
1jehuang commentedon Jun 9, 2026
Triage: confirmed (feature gap). NVIDIA NIM is wired as an OpenAI-compatible profile (
NVIDIA_NIM_PROFILE,api_base: https://integrate.api.nvidia.com/v1,crates/jcode-provider-metadata/src/catalog.rs), and that path builds a standard chat/completions body. There is no mechanism to inject non-standard request fields: searched the tree andchat_template_kwargsandextra_bodyboth have zero matches. So DeepSeek-V4 NIM models that requirechat_template_kwargs: { thinking, reasoning_effort }cannot be driven, matching the reported hang (NIM holds the connection open with no response when the required kwargs are absent).The reporter
s suggested fix (in the comment) is reasonable and matches what Id propose:extra_bodypassthrough on OpenAI-compatible providers (config-driven JSON merged into the request body) -- the clean, model-agnostic solution.chat_template_kwargswhen the profile is NVIDIA NIM and the model id containsdeepseek-v4-- convenient but brittle; the generic passthrough should land first.Note: the
deepseek-v4-pro404 is likely just model availability on the account/region and separate from the kwargs hang. Labeling enhancement / priority: medium / triage: needs-decision (the genericextra_bodydesign is the open decision).1jehuang commentedon Jun 9, 2026
Update: reproduced and fixed (the
chat_template_kwargspassthrough; thev4-prohang is a separate NVIDIA-side issue, see below).Reproduction (live, against
integrate.api.nvidia.com)deepseek-ai/deepseek-v4-flashanddeepseek-ai/deepseek-v4-pro.deepseek-v4-flash: basic, streaming, and streaming+tools requests all succeed without kwargs. Butchat_template_kwargs: {thinking: true, reasoning_effort: high}is exactly what turns reasoning on - with it the response includesreasoning_content, without it none. jcode had no way to send these (extra_body/chat_template_kwargs= 0 matches in the tree), so reasoning was simply unreachable.deepseek-v4-pro: hangs server-side (60s, zero bytes) with or without kwargs. That is a NVIDIA capacity/availability problem on that model, not something jcode can fix; the 404/hang you saw onprois upstream.Fix (committed)
Added a generic, model-agnostic
extra_bodypassthrough for the OpenAI-compatible / OpenRouter provider path (this is the reporter-suggested option 1, done cleanly so it is not NIM-specific):config.toml:nvidia-nimprofile (or any endpoint), via env var (also readable from~/.config/jcode/nvidia-nim.env):JCODE_OPENAI_EXTRA_BODY={"chat_template_kwargs":{"thinking":true,"reasoning_effort":"high"}}extra_bodyis merged last into the chat/completions body, so it can satisfy or override jcode-generated fields (env wins over config on key collisions). Invalid input is logged and ignored, never fatal.Verification
nvidia-nim deepseek-v4-flash: withextra_bodythe model streams reasoning (💭), without it there is none.I auto-labeled
enhancement/triage: reproducible(downgrading the earlierneeds-decisionsince the design is now implemented). This will land in the next release.feat(provider): add extra_body passthrough for OpenAI-compatible prov…
1jehuang commentedon Jun 10, 2026
Released in v0.25.0. Run
jcode updateto get it.feat(provider): add extra_body passthrough for OpenAI-compatible prov…
feat(provider): add extra_body passthrough for OpenAI-compatible prov…