Skip to content

docs: rewrite Switchyard model-server page for brevity and accuracy - #3170

Merged
yaoyu-33 merged 3 commits into
mainfrom
docs/switchyard-page-rewrite
Sep 10, 2026
Merged

yaoyu-33 merged 3 commits into
mainfrom
docs/switchyard-page-rewrite

Conversation

@itayzit

@itayzit itayzit commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

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

  • I have read the contributing guidelines.
  • The change is focused; unrelated "drive-by" edits are tracked as separate issues/PRs.
  • Tests added or updated and pass locally, or N/A for docs-only / non-code changes (so CI unit/server checks pass when applicable).
  • Pre-commit checks pass locally (pre-commit run --all-files) (so CI lint/format/copyright pass).
  • All commits have DCO sign-off (git commit -s) (so the DCO check passes).

🤖 Generated with Claude Code

@copy-pr-bot

copy-pr-bot Bot commented Sep 8, 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.

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

@yaoyu-33 yaoyu-33 added area:model Model servers, inference providers, and model adapters docs Documentation-only updates or documentation debt needs-review PR is ready for code review and waiting on a reviewer labels Sep 8, 2026
yaoyu-33
yaoyu-33 previously approved these changes Sep 8, 2026
@yaoyu-33 yaoyu-33 added ready-to-merge PR is approved, current, and waiting for final CI or merge and removed needs-review PR is ready for code review and waiting on a reviewer labels Sep 8, 2026
@yaoyu-33

Copy link
Copy Markdown
Contributor

/ok to test 9a4f05d

@yaoyu-33
yaoyu-33 enabled auto-merge (squash) September 10, 2026 05:14
@yaoyu-33
yaoyu-33 merged commit 4d62c62 into main Sep 10, 2026
39 checks passed
@yaoyu-33
yaoyu-33 deleted the docs/switchyard-page-rewrite branch September 10, 2026 05:25
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

1 inactive deployment
public — 9a4f05d5 Deployed Sep 10, 2026 by copy-pr-bot[bot] via release / finalize / notify #2741
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 docs Documentation-only updates or documentation debt ready-to-merge PR is approved, current, and waiting for final CI or merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants