Switchyard¶
Switchyard helps an AI agent choose which model handles each request. Embed its Rust core, libsy, in your gateway or agent harness. Your application keeps its model clients, credentials, and service.
Choose where routing belongs in your application. Use an existing integration, or embed libsy and keep your current model clients.
Choose a Path¶
| Goal | Start here | What you own |
|---|---|---|
| Use routing through an inference provider | Switchyard on OpenRouter | Your API requests and provider account. Follow the provider's available algorithms and controls. |
| Add routing to your gateway | NeMo Relay or the experimental LiteLLM integration | Gateway deployment, credentials, and operation. Check each integration's limits. |
| Embed routing in a gateway, harness, or application | Rust quickstart, then Mechanics of Libsy | Model execution and application lifecycle. Python bindings use the same core. |
Try With a Local Agent¶
The reference server gives you a quick way to try routing with your own models. It demonstrates libsy, protocol conversion, and configured execution. It is for local demos and personal use, not a supported production deployment or a service to scale.
Use it with Claude Code or Codex, pi, or Oh My Pi.
Explore¶
- Benchmarks: compare Terminal-Bench 2.1 and DeepSWE results and open their routing configs
- Mechanics of Libsy: understand steps, calls, and outcomes
- Switchyard Protocols: connect your model data to libsy
- Routing Algorithms: choose how requests select a model
- Host Integration: connect your clients and application lifecycle
- Rust API: browse the core library, protocols, translation, clients, and runner
- Context-Window Handling: configure eviction and retry behavior
- Tuning: the loop from verifying routing to recording a result
- Troubleshooting: symptoms, silent misconfigurations, and fixes
Reference¶
switchyard-libsyAPI: embeddable routing algorithmsswitchyard-protocolAPI: provider-neutral model dataswitchyard-translationAPI: provider-format conversionswitchyard-llm-clientAPI: optional HTTP clients and execution helpersswitchyard-runnerAPI: configured route construction and executionswitchyard-nemo-relay-plugin: native plugin build and configuration- Dynamo / agentgateway: Switchyard PreProc integration example
- Component responsibilities: choose the crates your integration needs
- Demo server CLI: local server commands and options