Switchyard is a Rust proxy and library for routing LLM traffic across models and providers while maintaining native OpenAI and Anthropic API compatibility.
Switchyard solves the problem of directing requests to different language models and providers without forcing applications to change their API calls. It translates between OpenAI Chat, Anthropic Messages, and OpenAI Responses formats, allowing a client written for one API to work transparently with backends using another. The tool provides three usage paths: as a launcher that wraps coding agents like Claude Code, as a standalone HTTP proxy server, or as an embedded library for Rust applications. It includes multiple routing strategies such as random routing, LLM-as-classifier routing, and signal-driven stage routing, along with Prometheus metrics covering requests, errors, latency, tokens, and routing overhead.
Switchyard suits teams running multiple LLM backends or wanting to benchmark models against each other without rewriting client code. It works well for scenarios where you need to spread traffic across providers for cost optimization, performance testing, or gradual migration between models. The project is explicitly pre-alpha and evolving rapidly, with the API and algorithms expected to change significantly before reaching version one, so it is not recommended for production use at this stage.
Development activity shows rapid iteration with frequent commits addressing core functionality and algorithm improvements. The project maintains active engagement with issues and pull requests, indicating responsiveness to user feedback. Documentation is being actively developed alongside the codebase, with guides covering all three usage paths. The codebase demonstrates a focus on composable, typed routing algorithms that allow both built-in strategies and custom implementations.