[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-94650":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":8,"htmlUrl":9,"language":10,"languages":8,"totalLinesOfCode":8,"stars":11,"forks":12,"watchers":13,"openIssues":13,"contributorsCount":8,"subscribersCount":13,"size":13,"stars1d":13,"stars7d":13,"stars30d":13,"stars90d":13,"forks30d":13,"starsTrendScore":13,"compositeScore":14,"rankGlobal":8,"rankLanguage":8,"license":8,"archived":15,"fork":15,"defaultBranch":16,"hasWiki":15,"hasPages":15,"topics":8,"createdAt":8,"pushedAt":8,"updatedAt":17,"readmeContent":18,"aiSummary":19,"trendingCount":13,"starSnapshotCount":13,"syncStatus":20,"lastSyncTime":8,"discoverSource":21},94650,"Switchyard","NVIDIA-NeMo\u002FSwitchyard","NVIDIA-NeMo",null,"https:\u002F\u002Fgithub.com\u002FNVIDIA-NeMo\u002FSwitchyard","Rust",603,70,0,43.55,false,"main","2026-08-24 04:01:22","\u003Cp align=\"center\">\n  \u003Cimg src=\"assets\u002Flogo.png\" alt=\"Switchyard\" width=\"800\">\n\u003C\u002Fp>\n\n# Switchyard\n\nSwitchyard is a Rust proxy and library for LLM traffic. It routes requests\nacross providers, translates between OpenAI and Anthropic APIs, records\noperational metrics, and provides typed, composable routing algorithms.\n\n**Why Switchyard?** Point a coding agent such as Claude Code or Codex at an\nopen-source model. Switchyard translates between the OpenAI Chat, Anthropic\nMessages, and OpenAI Responses formats, so the agent keeps speaking its native\nAPI while the request is served by vLLM, NVIDIA NIM, Ollama, or any\nOpenAI-compatible endpoint. The same proxy can spread traffic across several\nmodels for A\u002FB benchmarking, apply signal-driven stage routing, or run a custom\nalgorithm you write yourself.\n\n## Features\n\n- **Protocol Translation**: convert between OpenAI Chat, Anthropic Messages, and OpenAI Responses formats\n- **Multi-Backend Routing**: random routing, LLM-as-classifier routing, signal-driven stage-router, or your own algorithm\n- **Operational Metrics**: Prometheus metrics cover requests, errors, latency, tokens, and routing overhead\n\n## Maturity\n\nSwitchyard is pre-alpha software that is evolving rapidly. The API and algorithms are expected to change significantly before we reach v1.0.\n\n> [!WARNING]\n> Experimental software. Not for production use.\n\n## Quick Start\n\nChoose the launcher path to run Claude Code, Codex CLI, or OpenClaw through\nSwitchyard. Choose the server path to run Switchyard as a standalone proxy.\nChoose the library path to embed routing in your own Rust application.\n\n### Launcher Path\n\nInstall [`uv`](https:\u002F\u002Fdocs.astral.sh\u002Fuv\u002Fgetting-started\u002Finstallation\u002F) if it is\nnot already available, then install the published Switchyard tool:\n\n```bash\ncurl -LsSf https:\u002F\u002Fastral.sh\u002Fuv\u002Finstall.sh | sh\nsource \"$HOME\u002F.local\u002Fbin\u002Fenv\"\nuv tool install --python 3.10 \"nemo-switchyard[cli]\"\n```\n\nThe coding agent you launch must also be installed and on your `PATH`. This does\nnot install the standalone `switchyard-server` binary; use the Server Path for\nthat.\n\nSet an OpenRouter key and launch against the packaged deployment:\n\n```bash\nexport OPENROUTER_API_KEY=\"your-openrouter-key\"  # pragma: allowlist secret\nswitchyard launch claude --model switchyard\nswitchyard launch codex --model switchyard\nswitchyard launch openclaw --model switchyard\n```\n\nTo use your own native TOML deployment, pass its route ID and configuration:\n\n```bash\nswitchyard launch claude --model my-route --config routes.toml\n```\n\n### Server Path\n\nUse this path to install and run the standalone Rust proxy. Install\n[Rust with Cargo](https:\u002F\u002Frust-lang.org\u002Ftools\u002Finstall\u002F), then install the\npublished binary:\n\n```bash\ncargo install --locked switchyard-server\nswitchyard-server --help\n```\n\nCargo builds the release binary and installs it into `~\u002F.cargo\u002Fbin` by default.\n\nCreate `routes.toml` using the\n[Getting Started guide](docs\u002Fgetting_started.md#server-path), then validate it\nand start the server:\n\n```bash\nexport OPENROUTER_API_KEY=\"your-openrouter-key\"  # pragma: allowlist secret\nswitchyard-server --config routes.toml --dry-run\nswitchyard-server --config routes.toml --host 127.0.0.1 --port 4000\n```\n\nVerify the proxy in another terminal:\n\n```bash\ncurl http:\u002F\u002Flocalhost:4000\u002Fhealth\n```\n\nFor a complete configuration and a test request, follow\n[Getting Started](docs\u002Fgetting_started.md).\n\n### Library Path\n\n`switchyard-libsy` embeds the routing algorithms in your own Rust application.\nIt never calls a model itself: an algorithm decides which target to use and\nhands every model call back to you, so it drops into an existing proxy, gateway,\nor agent runtime without owning an HTTP stack. Pair it with\n`switchyard-llm-client` when you want the calls made for you.\n\n```toml\n[dependencies]\nswitchyard-libsy = { git = \"https:\u002F\u002Fgithub.com\u002FNVIDIA-NeMo\u002FSwitchyard.git\" }\nswitchyard-protocol = { git = \"https:\u002F\u002Fgithub.com\u002FNVIDIA-NeMo\u002FSwitchyard.git\" }\n```\n\nSee [Getting Started](docs\u002Fgetting_started.md#library-path) for setup and the\nalgorithm list, or the [`switchyard-libsy`](crates\u002Flibsy\u002FREADME.md) crate docs.\n\n## Routing Strategies\n\n| Strategy | Use it when | Route `type` |\n|---|---|---|\n| [LLM Classifier](docs\u002Frouting_algorithms\u002Fllm_classifier_routing.md) | Request content should decide whether a turn needs the weak or strong tier. | `llm_classifier` |\n| [Stage Router](docs\u002Frouting_algorithms\u002Fstage_router_routing.md) | Signals already in the conversation, such as tool results and errors, should route most turns without an extra model call. | `stage_router` |\n| [Escalation Router](docs\u002Frouting_algorithms\u002Fescalation_router_routing.md) | Every turn runs on the weak tier first, and a judge reads that answer to decide whether to send the same request to the strong tier. | `llm_classifier` with `mode = \"escalation\"` |\n| [Random](docs\u002Frouting_algorithms\u002Frandom_routing.md) | You need a fixed traffic split for A\u002FB tests, baselines, or cost experiments. | `random` |\n\nA `passthrough` route registers one target under one model ID with no routing\ndecision. See the [Routing Overview](docs\u002Frouting_algorithms\u002Foverview.md) for\nthe common route shape and self-hosted targets.\n\n## Architecture\n\n```mermaid\nflowchart LR\n    clients[\"Clients\"]\n    switchyard[\"Switchyard\u003Cbr\u002F>routing · translation · fallback\"]\n    backends[\"Model backends\"]\n\n    clients -->|\"OpenAI \u002F Anthropic API\"| switchyard\n    switchyard -->|\"provider-native format\"| backends\n```\n\nClients keep their native OpenAI or Anthropic API format. Switchyard picks a\nconfigured backend, forwards the request in that backend's own format, and\ntranslates the response back into the shape the client expects. The server\naccepts OpenAI Chat Completions, OpenAI Responses, and Anthropic Messages. Each\nconfigured LLM client selects one upstream format.\n\n## Documentation\n\n- **[Getting Started](docs\u002Fgetting_started.md)**: complete launcher and standalone server walkthroughs\n- **[Core Concepts](docs\u002Fcore_concepts.md)**: LLM clients, targets, routes, model IDs, and routing algorithms\n- **[Routing Overview](docs\u002Frouting_algorithms\u002Foverview.md)**: choose and configure a routing algorithm\n- **[`switchyard-server`](crates\u002Fswitchyard-server\u002FREADME.md)**: server configuration, routing algorithms, and metrics\n- **[`switchyard-libsy`](crates\u002Flibsy\u002FREADME.md)**: embed routing algorithms in a Rust application\n- **[`switchyard-protocol`](crates\u002Fprotocol\u002FREADME.md)**: provider-neutral request, response, and streaming types\n- **[`switchyard-translation`](crates\u002Fswitchyard-translation\u002FREADME.md)**: request, response, and stream translation\n\n## Community\n\n- **Issues**: [GitHub Issues](https:\u002F\u002Fgithub.com\u002FNVIDIA-NeMo\u002FSwitchyard\u002Fissues)\n- **Code of Conduct**: [Code of Conduct](CODE_OF_CONDUCT.md)\n\n## License\n\n[Apache 2.0 License](LICENSE). Copyright NVIDIA Corporation.\n","Switchyard 是一个用 Rust 编写的 LLM 流量代理与库，用于在不同大语言模型后端间路由请求并实现 API 协议转换。其核心功能包括 OpenAI 与 Anthropic 接口格式的双向翻译、支持随机路由、LLM 分类路由、信号驱动分阶段路由等可组合算法，以及基于 Prometheus 的细粒度运营指标采集（如请求量、延迟、token 数、路由开销）。适用于本地开发调试、多模型 A\u002FB 对比测试、编码智能体（如 Claude Code）对接开源模型服务（vLLM\u002FNVIDIA NIM\u002FOllama）等场景，目前为预 Alpha 阶段实验性工具，不建议生产环境使用。",2,"trending"]