How to Implement Passthrough Routes for Direct Model Access in Switchyard
Set type = "noop" in your route configuration to bypass all routing logic and forward requests directly to your target LLM endpoint.
Switchyard's routing architecture is built around algorithms that determine how incoming requests map to concrete LLM endpoints. For scenarios where you need direct, unfiltered access to a model—without classification, A/B testing, or health-aware routing—the framework provides a dedicated passthrough mechanism. This guide shows how to implement passthrough routes using the noop algorithm in NVIDIA's Switchyard.
Understanding Passthrough Routing in Switchyard
Switchyard ships with three built-in algorithms in switchyard.libsy.algorithms:
| Algorithm | Purpose |
|---|---|
llm_task_classifier |
Routes requests based on a classifier that selects "strong", "weak", or "classifier" targets |
stage_router |
Routes based on staged configuration for A/B testing and health-aware routing |
noop |
Passthrough – forwards requests directly to the specified target with zero routing logic |
The noop algorithm is the key to implementing passthrough routes. When enabled, Switchyard skips all decision-making and invokes the downstream model client immediately.
How Passthrough Routes Work Internally
The request flow through a passthrough route follows three stages:
-
Configuration parsing –
switchyard/cli/launch_command.pyreads the TOML file supplied with--config -
Algorithm selection – the
typefield of a[routes.*]table is matched against symbols exported byswitchyard/libsy/algorithms.py -
noopexecution – the Rust implementation incrates/libsy/src/noop.rsreturns the target identifier unchanged, allowing direct model invocation
Because noop requires no configurable parameters, your route definition needs only the target reference and the algorithm type.
Step-by-Step: Creating a Passthrough Route
Step 1: Define Your LLM Client
First, configure the backend client that will handle requests:
# my_routes.toml
schema_version = 1
[llm_clients.openrouter]
format = "openai_chat"
base_url = "https://openrouter.ai/api/v1"
api_key_env = "OPENROUTER_API_KEY"
Step 2: Create the Target
Map a target name to a specific model and client:
[targets.claude]
id = "anthropic/claude-opus-4.7"
llm_client = "openrouter"
Step 3: Add the Passthrough Route
Define a route with type = "noop" to bypass routing logic:
[routes.claude_passthrough]
id = "claude_passthrough"
type = "noop" # ← enables direct model access
target = "claude" # references the target above
Step 4: Launch with Your Route
Activate the passthrough route using the Switchyard CLI:
export OPENROUTER_API_KEY="sk-..."
switchyard launch claude \
--config my_routes.toml \
--route claude_passthrough
The launcher at switchyard/cli/launchers/claude.py will use your passthrough route, sending all requests directly to Anthropic's Claude without intermediate routing decisions.
Complete Configuration Example
Here's a production-ready passthrough configuration:
# production_passthrough.toml
schema_version = 1
[llm_clients.nvidia_nim]
format = "openai_chat"
base_url = "https://integrate.api.nvidia.com/v1"
api_key_env = "NVIDIA_API_KEY"
[targets.mixtral_8x22b]
id = "nvidia/mixtral-8x22b-instruct-v0.1"
llm_client = "nvidia_nim"
[routes.direct_mixtral]
id = "direct_mixtral"
type = "noop"
target = "mixtral_8x22b"
Launch with any compatible launcher:
export NVIDIA_API_KEY="nvapi-..."
switchyard launch openclaw \
--config production_passthrough.toml \
--route direct_mixtral
Key Source Files for Passthrough Implementation
| File | Purpose |
|---|---|
switchyard/libsy/algorithms.py |
Exports the three built-in algorithms including noop |
switchyard/cli/launch_command.py |
Parses TOML config and selects algorithms for routes |
crates/libsy/src/noop.rs |
Rust implementation that returns target unchanged |
switchyard/cli/launchers/*.py |
Launcher entry points (Claude, Codex, OpenClaw, etc.) |
switchyard/cli/defaults/openrouter.toml |
Reference configuration with routing examples |
When to Use Passthrough Routes
Passthrough routes are ideal when:
- You need raw, unmodified access to a specific model
- You're testing model behavior without routing interference
- You're building a proxy layer and want Switchyard's CLI, logging, and health monitoring without intelligent routing
- You have dedicated hardware or endpoints that shouldn't participate in load balancing
Avoid passthrough routes when you need:
- Automatic failover between model providers
- Request classification and adaptive routing
- A/B testing or gradual rollout capabilities
Summary
- Passthrough routes use
type = "noop"in your TOML route configuration - The
noopalgorithm is implemented incrates/libsy/src/noop.rsand simply returns the target identifier unchanged - Configure
targets, then reference them in[routes.*]tables withtype = "noop"and atargetfield - Launch with
switchyard launch <launcher> --config <file> --route <route_id> - Passthrough preserves Switchyard's infrastructure benefits (CLI, logging, health checks) while eliminating routing logic
Frequently Asked Questions
What is the difference between noop and other routing algorithms in Switchyard?
The noop algorithm performs zero decision-making—it immediately forwards requests to the configured target. In contrast, llm_task_classifier analyzes requests to route between strong and weak models, and stage_router evaluates health signals and A/B test configurations. Use noop when you want direct model access; use other algorithms when you need intelligent request distribution.
Can I have multiple passthrough routes in one configuration file?
Yes. Define separate [routes.*] tables for each passthrough endpoint, each with type = "noop" and pointing to different targets. Reference the desired route at launch time with the --route flag. This pattern lets you expose multiple models directly while maintaining a single configuration file.
Does passthrough mode disable Switchyard's logging and monitoring?
No. Passthrough routes disable only the routing decision layer. You retain all infrastructure benefits including request/response logging, metrics collection, health check reporting, and CLI tooling. The noop algorithm bypasses classification and selection logic—it does not bypass the observability stack.
Which Switchyard launchers support passthrough routes?
All launchers in switchyard/cli/launchers/ support passthrough routes because routing is configured at the configuration layer, not the launcher layer. Whether using claude, codex, openclaw, or custom launchers, pass --route <passthrough_route_id> to activate direct model access.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →