Optimizing Coding Agent Routing with NVIDIA NeMo Switchyard

AWS and NVIDIA have collaborated to release an open-source solution that routes coding agent requests to the optimal model based on task characteristics. Stage routing dynamically selects between high-performance and low-cost models by analyzing tool usage history, while Random routing supports weight-based A/B testing. It has been validated with the combination of Amazon Bedrock's Claude Opus 5.5 and Nemotron 3 Super 120B, and costs should be evaluated based on 'cost per solved task'.

A New Cost Equation for the Era of Coding Agents

Coding agents (Claude Code, OpenAI Codex CLI, etc.) operate not in a single prompt-response loop but on a task basis. When a developer makes a change request, the agent repeatedly reads files, edits code, and runs tests to complete the task. The number of model calls required for a single task can vary from a few to dozens. What developers pay for is not the 'number of calls' but the 'completed tasks'.

The total task cost cannot be determined solely by the price per token. The total cost depends on how many turns the model takes, how much history is resent at each turn, and how often the task is retried or left incomplete. Costs are incurred even for failed attempts.

Therefore, when evaluating routing strategies, the Cost per Solved Task metric should be used. This is the total execution cost divided by the number of successful executions that passed the tests.

NVIDIA NeMo Switchyard: Standardizing the Routing Layer

NVIDIA NeMo Switchyard is an open-source library that helps AI agents decide which model to send each request to. Users define the available model pool and routing strategies. Currently, it offers two strategies through LiteLLM integration.

StrategyNumber of Candidate ModelsOperating PrincipleUse Case
Stage RoutingExactly 2Reads results from recent tool activity and request history to choose between two candidatesComplexity-based dynamic routing
Random Routing2 or moreRandom selection from a weighted poolTraffic splitting, A/B comparison

Stage routing does not call a separate judging model (Judge Model). The agent must send the entire conversation history and analyze tool usage patterns to select either a Capable Model or an Efficient Model. Classifier-based Task/Composite routing requires intermediate model calls and is not supported in the current integration.

NVIDIA documents switchyard-server 0.3.0 as a demo and evaluation component, stating that settings and APIs may change between releases. This sample is an experimental integration and is not intended for production use.

Architecture: A Complete Gateway within a Private VPC

The sample is deployed using AWS CDK, and the main components are as follows.

  1. Coding Agent → ALB (WAF, IP Allowlist) → ECS Fargate (LiteLLM + Switchyard Plugin) → Bedrock Runtime VPC Endpoint → Claude Opus 5.5 / Nemotron 3 Super 120B

Validation Environment and Benchmark Methodology

The sample was tested with the following model pairs in the US East (N. Virginia) region.

ModelRoleNotes
Claude Opus 5.5High-performance model (Capable)Anthropic on Bedrock
Nemotron 3 Super 120BHigh-efficiency model (Efficient)NVIDIA on Bedrock

In other regions, model availability and tool calling support must be verified separately. The benchmark runner measures cost per solved task for both the routing model group and the single model baseline group to quantify routing effectiveness.

Deployment Prerequisites and Operational Considerations

So What: Tangible Value for Development Organizations

1. A New Axis of Cost Optimization: Provides a framework to measure and improve task completion unit economics beyond simple token price comparisons 2. Reduced Vendor Dependency: Abstracts multiple models into a single OpenAI-compatible endpoint through the LiteLLM gateway 3. Data Governance: Inference traffic does not traverse the public internet via VPC endpoints 4. Establishing an Experimental Culture: Native support for A/B testing at the infrastructure level through weighted splits in Random routing

However, currently, Stage routing is limited to 2 models, and advanced strategies based on Classifier are not supported. Since switchyard-server is an evaluation version (0.3.0), sufficient validation and monitoring systems must be established before production adoption.

Verified figures

Our take

Switchyard is a meaningful attempt to standardize model routing at the infrastructure level. Notably, the introduction of the practical metric 'cost per solved task' enhances the predictability of costs, a key challenge in the commercialization of coding agents. However, it currently remains limited to 2-model Stage routing, and securing production-grade stability along with Classifier-based multi-model routing will be crucial going forward.

Open questions

Models mentioned

ProviderInputOutputContext window
Anthropic: Claude Opus 5.5 · Anthropic$4$201,000,000
NVIDIA: Nemotron 3 Super · NVIDIA$0.075$0.4262,144

Source

Back to catalog