Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions src/lib/inference/vllm-models.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ describe("vllm model registry", () => {
expect(qwen35b!.gated).toBe(false);
});

it("builds the NVFP4 serve command from the DGX Spark model-card recipe", () => {
it("builds the NVFP4 serve command from the DGX Spark model-card recipe (#6457)", () => {
const qwen35b = VLLM_MODELS.find((m) => m.envValue === "qwen3.6-35b-a3b-nvfp4");
const cmd = buildVllmServeCommand(qwen35b!);
// The current NVIDIA model card no longer needs Spark-specific env exports.
Expand All @@ -227,7 +227,11 @@ describe("vllm model registry", () => {
expect(cmd).toContain("--attention-backend flashinfer");
expect(cmd).toContain("--moe-backend marlin");
expect(cmd).toContain("--enable-auto-tool-choice");
expect(cmd).toContain("--tool-call-parser qwen3_xml");
// #6457: `qwen3_coder` (not `qwen3_xml`) is the validated tool-call parser
// for this Spark checkpoint; `qwen3_xml` mis-parses its tool-call frames and
// breaks Deep Agents Code tool calls with HTTP 400.
expect(cmd).toContain("--tool-call-parser qwen3_coder");
expect(cmd).not.toContain("qwen3_xml");
expect(cmd).toContain("--reasoning-parser qwen3");
expect(cmd).toContain("--max-model-len 262144");
expect(cmd).toContain(
Expand All @@ -240,6 +244,22 @@ describe("vllm model registry", () => {
expect(cmd).toContain("--data-parallel-size 1");
expect(cmd).not.toContain("--gpu-memory-utilization 0.7");
});

it("does not regress the Spark tool-call parser to qwen3_xml (#6457)", () => {
// #6457: served with `qwen3_xml`, this checkpoint's tool-call frames do not
// round-trip — vLLM logs `qwen3xml_tool_parser.py:303 Error when parsing XML
// elements: not well-formed` and emits truncated/extra-`}` arguments, so
// Deep Agents Code (`dcode -n`) tool calls fail with HTTP 400 and exit 1.
// Validated end-to-end on real DGX Spark (GB10): pre-fix 3/4 runs hit HTTP
// 400, post-fix (qwen3_coder) 5/5 runs completed with 0 parser errors.
const qwen35b = VLLM_MODELS.find((m) => m.envValue === "qwen3.6-35b-a3b-nvfp4");
const cmd = buildVllmServeCommand(qwen35b!);
expect(cmd).toContain("--enable-auto-tool-choice");
expect(cmd).toContain("--tool-call-parser qwen3_coder");
expect(cmd).not.toContain("qwen3_xml");
// Exactly one tool-call parser is configured for the Spark recipe.
expect(cmd.match(/--tool-call-parser/g)).toHaveLength(1);
});
});

describe("modelsForPlatform", () => {
Expand Down
15 changes: 14 additions & 1 deletion src/lib/inference/vllm-models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,21 @@ export const VLLM_MODELS: readonly VllmModelDef[] = [
"--async-scheduling",
"--enable-prefix-caching",
"--enable-auto-tool-choice",
// `qwen3_coder`, not `qwen3_xml` (#6457). On DGX Spark this checkpoint's
// tool-call frames do not round-trip through vLLM's `qwen3_xml` parser:
// it logs `qwen3xml_tool_parser.py:303 Error when parsing XML elements:
// not well-formed (invalid token)` and emits truncated/extra-`}` tool
// arguments, so Deep Agents Code headless (`dcode -n`) tool calls fail
// intermittently with `POST /v1/chat/completions 400 Bad Request`
// (`json.decoder.JSONDecodeError: Extra data`) and `dcode` exits 1. The
// `qwen3_coder` parser matches this Qwen3.6-family checkpoint's emitted
// tool-call format — the same parser the other Qwen3.6 recipes in this
// registry already use (Qwen3.6-27B-FP8, Nemotron-3-Nano-4B) — and was
// validated end-to-end on real DGX Spark (GB10) hardware: 5/5 `dcode -n`
// runs completed with 0 parse errors and 0 HTTP 400s, versus HTTP 400 on
// 3/4 runs with `qwen3_xml`.
"--tool-call-parser",
"qwen3_xml",
"qwen3_coder",
"--reasoning-parser",
"qwen3",
"--speculative-config",
Expand Down
Loading