Artificial Intelligence1 min read

Route coding agent requests to the right model on Amazon Bedrock with NVIDIA NeMo Switchyard

By · Published by Everything Blog

In short

NVIDIA NeMo Switchyard is an open-source library that directs AI coding agent requests across designated models to optimize the cost per solved task. The tool integrates with the LiteLLM gateway, which now features a built-in auto-router supporting both traffic-splitting random routing and context-aware stage routing. The underlying architecture operates within an Amazon Elastic Container Service container run on AWS Fargate, utilizing an Application Load Balancer and AWS WAF for secure request handling. This sample infrastructure enables developers to benchmark multi-model routing groups against single-model baselines using the AWS Cloud Development Kit.

Key points

  • Expenses from automated coding agents depend on factors such as replayed history and retr…: Expenses from automated coding agents depend on factors such as replayed history and retry volumes rather than simple token costs.
  • Integrating NeMo Switchyard with the LiteLLM open-source gateway enables automated traffi…: Integrating NeMo Switchyard with the LiteLLM open-source gateway enables automated traffic splitting and targeted model routing.
  • The reference architecture allows teams to benchmark routed multi-model setups against si…: The reference architecture allows teams to benchmark routed multi-model setups against single-model options in non-production environments.

Sources checked by our analysis pipeline: 1

Artificial Intelligence

Route coding agent requests to the right model on Amazon Bedrock with NVIDIA NeMo Switchyard

Coding agents such as Claude Code and OpenAI Codex CLI work in tasks. A developer asks for a change, and the agent reads files, edits code, and runs tests until the work is done. One task can take a few model calls or dozens. What the developer pays for is the task, not one call.

The price per token alone doesn’t tell you what a whole task costs. The total depends on how many turns a model needs, how much history each turn replays, and how often a task has to be retried or never finishes. You pay for every attempt, including attempts on tasks that never finish. So when you route a coding agent’s requests between models, judge the routing by cost per solved task: the total cost of your runs divided by the number of runs whose tests pass.

NVIDIA NeMo Switchyard is an open source library that helps an AI agent choose which model handles each request. You define the…

Artificial Intelligence