Switchyard (Experimental)
Switchyard (Experimental)
Experimental: The Switchyard integration is an early-access feature. It is not enabled in default Relay builds, its configuration and contracts can change, and the current deployment requires a separately running Switchyard Decision API service.
NeMo Relay 0.6.0 architecture: This release uses the external Switchyard Decision API from the
topic/nemo-relay-integrationbranch.
Switchyard is an LLM routing decision engine. The nemo-relay-switchyard
plugin asks Switchyard which configured target should handle an LLM request.
Relay validates the decision and performs the authenticated provider request.
For example, a routing profile can send a simple prompt to a lower-cost model
and a complex prompt to a more capable model.
Architecture
The following diagram shows the NeMo Relay 0.6.0 service boundary:
The components divide responsibility as follows:
Relay does not start or supervise the Switchyard service. Start Switchyard
before Relay activates the plugin. Relay derives the service’s root /health
URL from decision_api_url and fails activation unless the endpoint returns
{"status":"ok"}.
Prerequisites
Install the following prerequisites before you start:
Keep the repositories in the following sibling layout. The validation script uses this layout by default:
Build and Run the Compatibility Test
Use the following procedure to clone and pin both repositories:
The Switchyard plugin is excluded from default Relay CLI builds. Build the CLI with the optional feature explicitly:
Run the real-service compatibility test from the NeMo Relay repository root:
The script prints the verified Switchyard revision and ends with the following line when routing succeeds:
The test starts these local processes:
The first request has no accumulated ATOF history and routes to
provider/weak. The script then sends session and tool events to Relay. Relay
exports those events to Switchyard’s ATOF accumulator, so the next buffered
request and the final streaming request route to provider/strong. The test
also validates the streamed response before reporting success.
Configuration Walkthrough
The compatibility test uses
real-e2e-plugins.toml
and
real-e2e-profiles.yaml.
The following settings establish the routing boundary:
For history-based routing, a local ATOF JSONL file is not sufficient.
Switchyard must receive events through the named HTTP sink at
/v1/atof/events so its accumulator can provide the history used by the
routing profile. Relay rejects a missing, duplicate, disabled, or invalid
named sink during startup validation.
For the complete option reference, refer to Switchyard Configuration.
Troubleshooting
Use the following table to diagnose common compatibility-test failures:
Capabilities
The integration provides the following capabilities:
enforceandobserve_onlyrouting modes.- OpenAI Chat Completions, OpenAI Responses, and Anthropic Messages inbound profiles.
- Buffered and streaming protocol translation through Switchyard’s
switchyard-translationlibrary. - Exact Relay-owned backend bindings and per-protocol trusted fallbacks.
- Bounded retries before the first streaming item.
- Canonical routing marks and shared LLM optimization accounting.
Pages
For more information, refer to the following pages:
- Switchyard Configuration provides the complete option and deployment reference. Review its experimental limitations before adopting the integration.
- Switchyard integration examples contains the versioned configuration and validation scripts used by this guide.