Repository navigation
docs: rewrite Switchyard model-server page for brevity and accuracy - #3170
Merged
Merged
Conversation
Signed-off-by: Itay Zitvar <[email protected]>
5 tasks done
Contributor
|
🌿 Preview your docs: https://nvidia-preview-docs-switchyard-page-rewrite.docs.buildwithfern.com/nemo/gym Here are the markdown pages you've updated: |
yaoyu-33
previously approved these changes
Sep 8, 2026
Signed-off-by: Itay Zitvar <[email protected]>
Signed-off-by: Itay Zitvar <[email protected]>
Contributor
|
/ok to test 9a4f05d |
yaoyu-33
enabled auto-merge (squash)
September 10, 2026 05:14
yaoyu-33
approved these changes
Sep 10, 2026
jkyi-nvidia
pushed a commit
that referenced
this pull request
Sep 11, 2026
…3170) ## What does this PR do? Rewrites the Switchyard model-server page. Feedback on the current page was that it is verbose and dense. Prose is about half the previous length, and the structure follows what a user does: quick start (write a deployment, run one route), compare routing strategies, see which model served each call, run the proxy yourself, configuration reference. Content changes: - Opens with what Switchyard does rather than "a routing proxy", and points at the other integration paths in the Switchyard README. - The example deployment uses the stage router and OpenRouter targets from the Switchyard README (Claude Opus 4.8 / GLM 5.2) instead of Llama 70B/8B on the NVIDIA API. - Drops the up-front mode table, the architecture paragraph, and the dependency-direction commentary. Attach mode is one section with three concrete reasons to use it. - Moves the comparison script and the per-session routing-log setup into `<Accordion>` blocks. - The configuration table matches sibling pages (Parameter / Type / Default / Description) and shows the env-var defaults. - `cargo install --locked switchyard-server` replaces build-from-source; 0.2.0 is on crates.io. - Fixes a bug in the previous comparison example: `condition_dir` is opened by the model-server process, so a relative path landed under `responses_api_models/switchyard_model/` instead of the user's working directory. The page now requires an absolute path and uses `$PWD`. Verification (macOS, this branch's Gym, `nemo-switchyard==0.2.0`, `switchyard-server 0.2.0`): - The example TOML passes `switchyard-server --dry-run`. - Hosted mode via `gym env start --model-type switchyard_model`: the proxy starts on loopback and `switchyard-condition.json` is written with route, hash, redacted TOML, and version. The `forward_session_id` warning appears without capture and disappears with `++observability_enabled=true`. - Attach mode against `switchyard-server --routing-log-file`: the manifest has `mode: attached`, `nemo_switchyard_version: null`, and the caller-supplied `proxy_provenance`. The `session_id_headers` list override parses, the rollout id reaches the proxy as its `session_id`, and a capture record is written. - `switchyard-stats.json` is written at shutdown with `scope` and `stats.classifier.total_tokens.total` when SIGINT reaches the server process. - `fern check` reports 0 errors. - Not exercised: a successful upstream model call (no OpenRouter credential in the test environment). Upstream auth failures surfaced through the proxy as expected. Observation, not addressed here and worth a separate issue: on macOS, `gym env start` shutdown sends SIGINT to the `/bin/bash -c` wrapper that launches each server. bash 3.2 does not forward it to `python app.py`, so every server is SIGKILLed after the 1s grace period, lifespan shutdown hooks (including this server's stats snapshot) never run, and `python app.py` processes are left orphaned. ## Checklist - [x] I have read the [contributing guidelines](https://docs.nvidia.com/nemo/gym/latest/contribute/development-setup). - [x] The change is focused; unrelated "drive-by" edits are tracked as separate issues/PRs. - [x] Tests added or updated and pass locally, or N/A for docs-only / non-code changes (so CI unit/server checks pass when applicable). - [x] Pre-commit checks pass locally (`pre-commit run --all-files`) (so CI lint/format/copyright pass). - [x] All commits have DCO sign-off (`git commit -s`) (so the DCO check passes). 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: Itay Zitvar <[email protected]> Signed-off-by: Junkeun Yi <[email protected]>
This branch was previously deployed
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 does this PR do?
Rewrites the Switchyard model-server page. Feedback on the current page was that it is verbose and dense. Prose is about half the previous length, and the structure follows what a user does: quick start (write a deployment, run one route), compare routing strategies, see which model served each call, run the proxy yourself, configuration reference.
Content changes:
<Accordion>blocks.cargo install --locked switchyard-serverreplaces build-from-source; 0.2.0 is on crates.io.condition_diris opened by the model-server process, so a relative path landed underresponses_api_models/switchyard_model/instead of the user's working directory. The page now requires an absolute path and uses$PWD.Verification (macOS, this branch's Gym,
nemo-switchyard==0.2.0,switchyard-server 0.2.0):switchyard-server --dry-run.gym env start --model-type switchyard_model: the proxy starts on loopback andswitchyard-condition.jsonis written with route, hash, redacted TOML, and version. Theforward_session_idwarning appears without capture and disappears with++observability_enabled=true.switchyard-server --routing-log-file: the manifest hasmode: attached,nemo_switchyard_version: null, and the caller-suppliedproxy_provenance. Thesession_id_headerslist override parses, the rollout id reaches the proxy as itssession_id, and a capture record is written.switchyard-stats.jsonis written at shutdown withscopeandstats.classifier.total_tokens.totalwhen SIGINT reaches the server process.fern checkreports 0 errors.Observation, not addressed here and worth a separate issue: on macOS,
gym env startshutdown sends SIGINT to the/bin/bash -cwrapper that launches each server. bash 3.2 does not forward it topython app.py, so every server is SIGKILLed after the 1s grace period, lifespan shutdown hooks (including this server's stats snapshot) never run, andpython app.pyprocesses are left orphaned.Checklist
pre-commit run --all-files) (so CI lint/format/copyright pass).git commit -s) (so the DCO check passes).🤖 Generated with Claude Code