From 42f6a91e5a8271774925a9efd70a3feaa71c04dd Mon Sep 17 00:00:00 2001 From: Yanyun Liao Date: Thu, 16 Jul 2026 11:57:42 +0800 Subject: [PATCH] fix(inference): serve managed Nemotron-3-Nano with its reasoning parser (#6915) Nemotron-3-Nano-4B-FP8 is a reasoning model that emits a ... trace, but the generic-Linux managed-vLLM profile served it without a reasoning parser. vLLM then left the trace inline in `content` -- including the bare marker the chat template does not pair with an opening tag -- and OpenClaw's streaming parser mishandles that orphan marker into an empty turn that wedges the session until reset. Add `--reasoning-parser nemotron_v3` to the Nano profile, matching the model card's vLLM launch recipe and the Ultra-550B managed profile, which already pins the same parser. `nemotron_v3` is a built-in parser in the pinned NGC vLLM image (it subclasses the DeepSeek-R1 parser), so no plugin file is required. Verified on a DGX Spark GB10 by serving the checkpoint with the profile's exact generated command: without the flag `content` carried the reasoning trace and an orphan ``; with it `content` is the clean final answer. Signed-off-by: Yanyun Liao --- src/lib/inference/vllm-models.test.ts | 16 ++++++++++++---- src/lib/inference/vllm-models.ts | 13 +++++++++++++ 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/src/lib/inference/vllm-models.test.ts b/src/lib/inference/vllm-models.test.ts index aa8d33a9e64..6db54eb9f05 100644 --- a/src/lib/inference/vllm-models.test.ts +++ b/src/lib/inference/vllm-models.test.ts @@ -223,7 +223,7 @@ describe("vllm model registry", () => { expect(cmd).not.toContain("--gpu-memory-utilization 0.7"); }); - it("builds the Nemotron-3-Nano-4B FP8 serve command with auto tool-choice enabled (#6314)", () => { + it("builds the Nemotron-3-Nano-4B FP8 serve command with auto tool-choice and reasoning parser (#6314, #6915)", () => { // #6314: the generic-Linux managed-vLLM default (`GENERIC_LINUX_PROFILE.defaultModel`) // used to omit `--enable-auto-tool-choice` and `--tool-call-parser`, so every agent // request with `tool_choice: "auto"` failed HTTP 400 out of the box on generic Linux. @@ -239,11 +239,19 @@ describe("vllm model registry", () => { expect(cmd).toContain("--load-format fastsafetensors"); expect(cmd).toContain("--enable-auto-tool-choice"); expect(cmd).toContain("--tool-call-parser qwen3_coder"); - // The tool-call flags must appear paired: the parser value comes as a single - // shell token immediately after `--tool-call-parser`, and each switch is listed - // only once. + // #6915: Nemotron-3-Nano is a reasoning model, so the serve command must + // also pin the reasoning parser from the model card. Without it, vLLM + // leaves the `…` trace (and the orphan `` marker the + // chat template does not pair with an opening tag) inline in `content`, + // which the agent's streaming parser mishandles into an empty turn that + // wedges the session. The Ultra-550B managed profile already pins the same + // `nemotron_v3` parser; this asserts the generic-Linux Nano default matches. + expect(cmd).toContain("--reasoning-parser nemotron_v3"); + // The parser flags must appear paired and exactly once each: the value is a + // single shell token immediately after its switch. expect(cmd.match(/--enable-auto-tool-choice/g)).toHaveLength(1); expect(cmd.match(/--tool-call-parser/g)).toHaveLength(1); + expect(cmd.match(/--reasoning-parser/g)).toHaveLength(1); }); it("registers the Qwen3.6-35B NVFP4 checkpoint for DGX Spark", () => { diff --git a/src/lib/inference/vllm-models.ts b/src/lib/inference/vllm-models.ts index e0b927e61e9..ae46263125b 100644 --- a/src/lib/inference/vllm-models.ts +++ b/src/lib/inference/vllm-models.ts @@ -148,9 +148,22 @@ export const VLLM_MODELS: readonly VllmModelDef[] = [ // --tool-call-parser to be set" (#6314) — which blocks every agent // tool-call flow on the generic-Linux managed vLLM default (Spark and // Station defaults already pin their own tool-call parser). + // + // `--reasoning-parser nemotron_v3` is likewise part of that same model + // card launch recipe: Nemotron-3-Nano is a reasoning model that emits a + // `…` trace. Without a reasoning parser vLLM leaves the + // trace — including the bare `` marker the chat template does not + // pair with an opening `` — inline in `content`, and the agent's + // streaming parser mishandles that orphan marker into an empty turn that + // wedges the session (#6915). `nemotron_v3` is a built-in parser in the + // pinned NGC vLLM image (it subclasses the DeepSeek-R1 parser) and moves + // the trace out of `content`, so no plugin file is required. The Spark and + // Station defaults already pin their own reasoning parser. modelArgs: [ "--gpu-memory-utilization", "0.7", + "--reasoning-parser", + "nemotron_v3", "--load-format", "fastsafetensors", "--enable-auto-tool-choice",