Skip to content

fix(switchyard_model): match vllm_model for reasoning models; pin nemo-switchyard 0.3.0 - #3664

Merged
marcromeyn merged 4 commits into
NVIDIA-NeMo:mainfrom
linj-glitch:linj/switchyard-model-faithful-proxy
Nov 6, 2026
Merged

marcromeyn merged 4 commits into
NVIDIA-NeMo:mainfrom
linj-glitch:linj/switchyard-model-faithful-proxy

Conversation

@linj-glitch

@linj-glitch linj-glitch commented Sep 23, 2026 •

Copy link
Copy Markdown
Collaborator

When a reasoning model is routed through switchyard_model, this change preserves vLLM-style reasoning replay and configured sampling pins: caller parameters cannot override the pins, and historical reasoning is restored or omitted according to uses_interleaved_reasoning.

With reasoning parsing or non-empty sampling overrides enabled, supported Responses inputs use Gym's shared Chat converter and Responses-only inputs return HTTP 422. With both options disabled, native Responses forwarding stays transparent. The dependency and managed lockfile pin nemo-switchyard==0.3.0; the dependency comment distinguishes that exact pin from the 0.2.0 minimum needed for Responses usage fields.

Rebased onto main 4f2e9678a906d5f9eaeda3537fffc66828fdbfb7, preserving the reviewer fixes and native integration tests from the earlier merge commit. Uses the current public package imports and ChatCompletionsConverter. This is a focused follow-up to the Switchyard model integration in #2141; no separate issue is needed. README and configuration documentation cover the opt-in behavior.

Validation with Python 3.13.14, uv 0.13.7, native Switchyard 0.3.0, and imports verified against this checkout:

  • uv lock --check --project responses_api_models/switchyard_model and uv sync --locked --project responses_api_models/switchyard_model passed.
  • gym env test +entrypoint=responses_api_models/switchyard_model +should_validate_data=true passed: 64 tests.
  • python -m pytest -q -o addopts= responses_api_models/switchyard_model/tests tests/unit_tests/models/test_chat_completions_converter.py tests/unit_tests/test_public_api_facades.py passed on the final rebased head: 1,075 tests.
  • pre-commit run --all-files, PR-diff whitespace checks, and DCO sign-off verification for all four commits passed.

The previously recorded real Qwen3-1.7B/vLLM 0.29.0 transport smoke returned 4 then 12 across two turns with both interleaving settings, preserved or omitted reasoning as configured, and sent all four requests with pinned max_tokens=192, top_k=5, and temperature 0 despite caller max_output_tokens=384. It was not an agent benchmark. No new model rollout was run for this rebase: the reviewer-fixed behavior is preserved, with native proxy integration tests covering the migration and lockfile update. Current-head CI and GitHub review gates remain separate from the local validation.

@linj-glitch
linj-glitch requested a review from a team as a code owner September 23, 2026 18:02
@copy-pr-bot

copy-pr-bot Bot commented Sep 23, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@yaoyu-33 yaoyu-33 added area:model Model servers, inference providers, and model adapters bug Something isn't working complexity:medium Single-domain change with interacting parts or a moderate review surface needs-review PR is ready for code review and waiting on a reviewer labels Sep 23, 2026
@github-actions github-actions Bot added the sla:triage-overdue Review assignment is over the one-business-day SLA label Sep 24, 2026
@github-actions github-actions Bot added sla:review-overdue Review response is over the one-business-day SLA and removed sla:triage-overdue Review assignment is over the one-business-day SLA labels Sep 25, 2026
@linj-glitch
linj-glitch marked this pull request as draft October 5, 2026 06:12
@github-actions github-actions Bot removed the sla:review-overdue Review response is over the one-business-day SLA label Oct 5, 2026
@linj-glitch
linj-glitch force-pushed the linj/switchyard-model-faithful-proxy branch 2 times, most recently from 1a74fe6 to f835d1a Compare October 8, 2026 00:20
@linj-glitch
linj-glitch marked this pull request as ready for review October 13, 2026 23:27
@github-actions github-actions Bot added the sla:review-overdue Review response is over the one-business-day SLA label Oct 14, 2026
@yaoyu-33

Copy link
Copy Markdown
Contributor

/ok to test 24c3cee

yaoyu-33
yaoyu-33 previously approved these changes Oct 23, 2026

@yaoyu-33 yaoyu-33 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM at 24c3cee.

@yaoyu-33 yaoyu-33 added the ready-to-merge PR is approved, current, and waiting for final CI or merge label Oct 23, 2026
@weijiac0619

Copy link
Copy Markdown
Contributor

Hi @ko3n1g, @linj-glitch has updated the docstring per your comment and the required CI is green. Could you take another look?

Copy link
Copy Markdown
Contributor

I'll watch this ready-to-merge PR and report substantive progress. Running on nim-gpt-6-1-sol.

Copy link
Copy Markdown
Contributor

💬 I can’t verify the PR’s latest checks or label state: both workstation launch attempts were denied by the shared memory quota. Can an operator free workstation quota and confirm when access is restored? The PR watch remains armed.

Copy link
Copy Markdown
Contributor

💬 Access is restored. GitHub reports that the PR is still open at 2fa810cb and has merge conflicts. I’m collecting the check details before deciding whether a CI retry or a staged merge resolution is warranted.

Copy link
Copy Markdown
Contributor

💬 I couldn’t retrieve the failing job logs: both read attempts returned HTTP 503 because the broker’s native Git authority is unavailable. I haven’t retried CI or changed the PR. Can an operator restore native Git authority and confirm when it’s ready? The PR watch remains active.

ko3n1g
ko3n1g previously approved these changes Nov 5, 2026
linj-glitch and others added 4 commits November 5, 2026 11:18
Three gaps kept switchyard_model from standing in for vllm_model when a
reasoning model sits behind the proxy. Measured on SWE-bench Verified with
Nemotron 3 Nano (500 tasks, k=3): 30.9% resolved through vllm_model, 17.5%
through this server with the same weights, tools and sampling. Switchyard
forwards the body byte-for-byte; the gap was in what this server handed it.

Reasoning on the way back: the server returned the upstream's separate
reasoning field verbatim. Agents replay the assistant turn on the next call
and Gym's chat request schema forbids reasoning_content there, so every
multi-turn rollout died on its second call. Fold it into <think> tags as
vllm_model does, behind the same uses_reasoning_parser flag.

Reasoning on the way out: vllm_model moves a replayed turn's <think> block
back into reasoning_content/reasoning before forwarding; this server sent the
tags inline. The chat template renders the two forms differently and the
model treats the inline form as a stop cue: replaying six real failing
requests four times each, 6/24 turns ended empty after the think block with
the inline form and 0/24 with the rewrite. Mirror the rewrite under
uses_interleaved_reasoning, default on.

Sampling: no way to state it, so a proxied arm ran on checkpoint defaults
while a vllm_model arm pinned its own. Add sampling_overrides with
vllm_model's semantics; the route id is set last and is not pinnable.

Pin nemo-switchyard 0.3.0, the current release; its hosted Server API and
request forwarding were verified identical to 0.2.0 for this use. With the
change the proxied arm scores 33.5% against 30.9% direct, within one
standard error, with matching turn counts.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Lin Jia <linj@nvidia.com>
Signed-off-by: Lin Jia <linj@nvidia.com>
Retain the reviewer fixes carried by the earlier merge commit, use the renamed ChatCompletionsConverter public API, and lock nemo-switchyard to the configured 0.3.0 version.

Signed-off-by: Lin Jia <linj@nvidia.com>
@ko3n1g

ko3n1g commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

/resolve-conflict

@linj-glitch
linj-glitch force-pushed the linj/switchyard-model-faithful-proxy branch from 2fa810c to 655d4c9 Compare November 5, 2026 19:19

Copy link
Copy Markdown
Contributor

💬 Head 655d4c95 is conflict-free, and all six reported checks passed. Full Gym CI hasn’t run on this head: the approved upstream mirror still points to 2fa810cb. The new head needs maintainer CI authorization and a fresh review. I’ll keep watching.

Copy link
Copy Markdown
Contributor

💬 GitHub now reports approval for 655d4c95. The PR remains open and blocked, with no full Gym CI result on that head.

@adil-a

adil-a commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

/ok to test 655d4c9

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/42162668264

Copy link
Copy Markdown
Contributor

✅ CI is green on nvidia-nemo/gym PR #3664 at 655d4c954c71 — still watching.

Merged via the queue into NVIDIA-NeMo:main with commit bd6f5f0 Nov 6, 2026
107 of 110 checks passed

Copy link
Copy Markdown
Contributor

The PR is no longer an open ready-to-merge PR targeting main.

Copy link
Copy Markdown
Contributor

The PR is no longer an open ready-to-merge PR targeting main.

This branch was previously deployed

1 inactive deployment
public — 655d4c95 Deployed Nov 6, 2026 by copy-pr-bot[bot] via release / finalize / notify #10578
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:model Model servers, inference providers, and model adapters bug Something isn't working complexity:medium Single-domain change with interacting parts or a moderate review surface ready-to-merge PR is approved, current, and waiting for final CI or merge sla:review-overdue Review response is over the one-business-day SLA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants