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
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Escalation-router deployment behind the Terminal-Bench 2.1 efficiency results
# (https://developer.nvidia.com/blog/route-ai-agent-workloads-across-models-with-nvidia-nemo-switchyard/).
#
# This is the configuration as benchmarked, with one change: the published runs were
# served through NVIDIA-internal inference endpoints, replaced here with OpenRouter
# equivalents so the deployment is publicly runnable. Routing-algorithm parameters
# are exactly as run; absolute solve rates may shift slightly across serving stacks.
# As run, the strong tier used Anthropic adaptive thinking with output effort `high`,
# the weak tier ran with reasoning effort `high`, and the judge ran with thinking
# disabled — mirrored below with OpenRouter's `reasoning` controls.
#
# Run with the current switchyard-server:
# switchyard-server --config benchmark/routing-profiles/tb21-escalation-opus-glm-deepseek.toml --port 4000
schema_version = 1
[llm_clients.openrouter]
format = "openai_chat"
base_url = "https://openrouter.ai/api/v1"
api_key_env = "OPENROUTER_API_KEY"
[targets.strong]
id = "anthropic/claude-opus-4.8"
llm_client = "openrouter"
[targets.strong.extra_body.reasoning]
effort = "high"
[targets.weak]
id = "z-ai/glm-5.2"
llm_client = "openrouter"
[targets.weak.extra_body.reasoning]
effort = "high"
[targets.judge]
id = "deepseek/deepseek-v4-flash"
llm_client = "openrouter"
[targets.judge.extra_body.reasoning]
enabled = false
# Every conversation starts on the weak tier. The judge reviews the trajectory each
# turn, and two consecutive escalate verdicts latch the session onto the strong tier.
[routes.switchyard]
id = "switchyard"
type = "llm_classifier"
classifier_target = "judge"
strong_target = "strong"
weak_target = "weak"
escalation = { confirmations = 2, recent_turn_window = 28, window_message_chars = 500 }