feat(plugin): add StageRouter support to the NeMo Relay plugin - #250
Draft
bbednarski9 wants to merge 53 commits into
Draft
feat(plugin): add StageRouter support to the NeMo Relay plugin#250bbednarski9 wants to merge 53 commits into
bbednarski9 wants to merge 53 commits into
Conversation
10 tasks
bbednarski9
force-pushed
the
feat/nemo-relay-stage-router-plugin
branch
7 times, most recently
from
August 3, 2026 17:29
dbbdadb to
283a2c9
Compare
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
…replay Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
…al event Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
Keep preservation on TranslationEngine, the API consumed by NVIDIA/NeMo-Relay#586, and remove the unused built-in convenience decoder. Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
Signed-off-by: Bryan Bednarski <bbednarski@nvidia.com>
bbednarski9
force-pushed
the
feat/nemo-relay-stage-router-plugin
branch
from
August 3, 2026 17:48
283a2c9 to
616506d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
StageRoutersupport to the external NeMo Relay dynamic plugin as an isolated draft follow-up to #220.The two follow-up commits after #220 are:
c90d06ff: invalidate exact same-format request replay after libsy mutates a normalized request, then re-encode the current request while retaining captured top-level provider extensions; and616506d0: add typed StageRouter configuration, capable/efficient targets, picker policy, tier prompts, handoff notes, an optional per-turn classifier fallback, schema/docs, and E2E coverage.The nested Stage classifier tracks libsy's current
max_output_tokenssetting. Relay still performs every provider call through the generic native API v2 LLM continuation from NVIDIA/NeMo-Relay#594; no Relay ABI or core-runtime change is required.Why
StageRouter can add a tier-specific system prompt or handoff note before dispatch. Replaying the originally preserved provider body after that mutation silently discards the new instructions. This draft makes the preservation lifecycle explicit: exact replay remains available while the neutral request is unchanged, and mutation forces re-encoding of the current request.
Keeping this separate from #220 lets reviewers evaluate the request-mutation and fidelity contract without expanding the initial Random/classifier PR.
Relates to #220 and #192.
How tested
uv run ruff checkclean for the modified E2E filesuv run mypy switchyardclean — N/A: no Python package changesuv run pytest tests/green — N/A: the changed contract is covered by Rust and process testsExact validation at
616506d0c1a444c7c92bb235f42c8bf9e42df45f, two commits on #220 headcda935c5360f85e5b87bb825fd51137c27183e0c:cargo test -p switchyard-nemo-relay-plugin: 22/22 passed;Checklist
snake_caseof the primary class. (N/A: Rust implementation.)switchyard/__init__.py.__all__if intended for downstream use. (N/A: no Python symbols.)--helpupdated if customer-facing surface changed.Signed-off-by: Your Name <email>) per the DCO.Notes for reviewers
This draft depends on #220. Until #220 merges, GitHub shows its cumulative base diff; the Stage-specific review range is
cda935c5..616506d0. The branch does not include escalation.It remains draft because mutation cannot reconstruct unknown provider fields nested inside messages or tool definitions and can canonicalize equivalent fields such as OpenAI
max_tokenstomax_completion_tokens. That does not yet satisfy the intended exact same-protocol preservation guarantee.Other current limits:
ContextWindowExceeded; andNo Relay API/ABI expansion is required for the tested Stage flow.