Skip to content

docs: correct AUTO probe order, extras, saved-bundle note, and stale API references#110

Open
elyasmnvidian wants to merge 1 commit into
mainfrom
emehtabuddin/qa-docs
Open

docs: correct AUTO probe order, extras, saved-bundle note, and stale API references#110
elyasmnvidian wants to merge 1 commit into
mainfrom
emehtabuddin/qa-docs

Conversation

@elyasmnvidian

@elyasmnvidian elyasmnvidian commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Docs and examples had several claims that no longer match the shipped package, so a new user copying from the README, INSTALLATION, or examples/ would hit an ImportError or a config that won't load. This PR corrects them.

What changed:

  • examples/route.yaml now loads. The type: deterministic (LLM-classifier) route was missing fallback_target_on_evict, which the route-bundle builder requires. Before this, building the table raised RouteBundleConfigError: llm-classifier.fallback_target_on_evict must be a non-empty string. Added fallback_target_on_evict: strong.
  • examples/minimal.py and the INSTALLATION library snippet use the current API. SwitchyardRecipes.passthrough_recipe(...) was removed from the package, so the old example fails at import. Replaced with ProfileSwitchyard(PassthroughProfileConfig(...).build()). switchyard.call() now returns the response body directly, so the example reads response['choices'][0]['message']['content'] instead of response.body[...].
  • CHANGELOG "Python library" bullet now names ProfileSwitchyard and the typed profile configs (PassthroughProfileConfig, RandomRoutingProfileConfig, StageRouterProfileConfig) instead of the removed SwitchyardRecipes.
  • DEVELOPMENT.md points at switchyard/lib/profiles/ instead of the deleted recipes.py.
  • [all] extra described correctly in README and INSTALLATION: it pulls in server, cli, tracing, intake, affinity-redis (was "server, cli" / "tracing extras").
  • AUTO backend-format probe order in docs/cli_reference.md fixed to match the resolver: probe /v1/chat/completions first (use openai), then /v1/messages (anthropic), then /v1/responses (responses), then fall back to openai.
  • docs/cli_reference.md now notes that a saved routing-profile bundle keeps ${VAR} references literal — the env vars must be present at serve/launch time, or Switchyard aborts with missing environment variable(s): NAME.

How to try it:

  • python examples/minimal.py with OPENAI_API_KEY set now imports and runs; against the current package the old file raised ImportError: cannot import name 'SwitchyardRecipes'.
  • Loading examples/route.yaml through the route-bundle builder no longer raises on the llm-classifier route.
    Audit follow-up in this push: the CHANGELOG packaging line listed a [gpu] extra that pyproject.toml does not define and omitted [tracing]/[intake]/[affinity-redis]; the README [all] comment named redis-affinity (the real extra is affinity-redis); and CONTRIBUTING.md still pointed at the removed switchyard/lib/recipes.py (now switchyard/lib/profiles/).

@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1

🚀 View preview at
https://NVIDIA-NeMo.github.io/Switchyard/pr-preview/pr-110/

Built to branch gh-pages at 2026-07-21 21:52 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

Changes

Profile API and routing updates

Layer / File(s) Summary
Profile-based library usage
CHANGELOG.md, DEVELOPMENT.md, INSTALLATION.md, examples/minimal.py
Documentation and examples now use ProfileSwitchyard with typed profile configurations and dictionary-style responses.
Installation extras documentation
INSTALLATION.md, README.md
Installation descriptions now include tracing, intake, and Redis-affinity extras.
CLI probing and route fallback
docs/cli_reference.md, examples/route.yaml
Automatic backend probing prioritizes chat completions, runtime ${VAR} requirements are documented, and classifier eviction fallback targets strong.

Estimated code review effort: 2 (Simple) | ~10 minutes

Poem

I’m a bunny with profiles tucked neat,
Typed configs make the path complete.
Chat responses hop by key,
Routes retry beneath the sky,
While docs and extras grow their feet.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main documentation updates and reflects the changed areas in the PR.

Comment @coderabbitai help to get the list of available commands.

…API references

Signed-off-by: Elyas Mehtabuddin <emehtabuddin@nvidia.com>
(cherry picked from commit 72f448e)
Signed-off-by: Elyas Mehtabuddin <emehtabuddin@nvidia.com>
@elyasmnvidian
elyasmnvidian force-pushed the emehtabuddin/qa-docs branch from fcf1a85 to 0ba243a Compare July 21, 2026 21:52
@elyasmnvidian

Copy link
Copy Markdown
Contributor Author

Live before/after — the shipped example loads, and the extras match pyproject

examples/route.yaml — building the route bundle from the shipped example (OPENROUTER_API_KEY set to a dummy so env interpolation passes):

# main — the example fails to build
RouteBundleConfigError: llm-classifier.fallback_target_on_evict must be a non-empty string

# this branch — passes that validation and proceeds to build backends
passed the fallback validation — reached backend construction

The type: deterministic (llm-classifier) route requires fallback_target_on_evict; the example was missing it. Added fallback_target_on_evict: strong.

Extras[all] in pyproject.toml resolves to [server, cli, tracing, intake, affinity-redis]. Confirmed and matched the docs:

  • CHANGELOG listed a non-existent [gpu] extra and omitted [tracing]/[intake]/[affinity-redis] — now lists the real ones.
  • README named redis-affinity; the actual extra is affinity-redis — fixed.
  • CONTRIBUTING pointed at the removed switchyard/lib/recipes.py — now switchyard/lib/profiles/.

The AUTO probe-order correction and the SwitchyardRecipes removals are text/example-only (no runtime behavior to A/B).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant