Switchyard lets LLM applications route traffic across models and providers while preserving native OpenAI and Anthropic API compatibility - enabling flexible model selection, benchmarking, and cost/performance optimization.
Rust
docs(server): document stage_router as a supported route type (#208)
ryan-lempka400b3682ad97
diff --git a/crates/switchyard-server/README.md b/crates/switchyard-server/README.mdindex 34b93fac9..27c0bd3d2 100644--- a/crates/switchyard-server/README.md+++ b/crates/switchyard-server/README.md@@ -42,6 +42,14 @@ base_threshold = 0.5id = "switchyard/passthrough"type = "passthrough"target = "model_a"++[routes.stage]+id = "switchyard/stage"+type = "stage_router"+capable_target = "model_a"+efficient_target = "model_b"+picker = "efficient_first"+confidence_threshold = 0.5``````bash@@ -59,8 +67,8 @@ upstream, and a route's `id` is the model clients send to select that algorithm.Each target references an entry under `llm_clients`. All configured clients use`TranslatingLlmClient`; supported formats are `openai_chat`, `openai_responses`, and-`anthropic_messages`. Supported algorithms are `noop`, `random`, `passthrough`, and-`llm_classifier`. An `api_key_env` value names an environment variable; the TOML+`anthropic_messages`. Supported algorithms are `noop`, `random`, `passthrough`,+`llm_classifier`, and `stage_router`. An `api_key_env` value names an environment variable; the TOMLnever contains the secret itself. If omitted, the client sends no authentication.Target-level `extra_body` values are shallow-merged into the upstream request whenthe request does not already contain that key.@@ -87,6 +95,12 @@ fallback produced while the judge was unreachable. `message_hash_fallback` keyscontent rather than a session id, so unrelated callers sending identical text share oneassignment.+A `stage_router` route scores tool-result and agent-progress signals from recent turns to pick a+tier per turn, without an extra classifier call on every turn. `capable_target`,+`efficient_target`, `picker` (`efficient_first` or `capable_first`), and `confidence_threshold`+are required. Optional handoff notes, per-tier system prompts, and a capability-judge fallback are+documented in [Stage-Router Routing](../../docs/routing_algorithms/stage_router_routing.md).+## Metrics`GET /metrics` exposes Prometheus text from the server's process-wide OpenTelemetry provider.