AWS has published a deployment guide that routes coding agent requests to different models on Amazon Bedrock using NVIDIA NeMo Switchyard. The method targets agents such as Claude Code and OpenAI Codex CLI, where one task can require from a few to dozens of model calls. The proposed metric is cost per solved task: total run cost divided by the number of runs whose tests pass. That framing matters for business because token price alone does not show what a completed development task costs.
How routing between Bedrock models works
The sample deploys LiteLLM, an open source gateway for large language models, with the Switchyard routing plugin inside the customer AWS account. LiteLLM calls models through Amazon Bedrock, and benchmark runners compare a routed model group against single-model baselines on the same workload. Configuration lives in deployment profiles that pair litellm. yaml with switchyard. toml. The sample installs switchyard-server 0.3.0 and runs the LiteLLM v1.102.0 image, described as sample code for non-production use.
The gateway runs in one container image on Amazon Elastic Container Service on AWS Fargate in private subnets. LiteLLM listens on port 4000 behind a load balancer, with an allowlist blocking admin UI, API docs, and key management routes. The image is stored in Amazon Elastic Container Registry, the gateway key is generated in AWS Secrets Manager, and logs go to one Amazon CloudWatch log group with 30-day retention. The VPC spans two Availability Zones with one NAT gateway for outbound access. The stack is deployed with AWS Cloud Development Kit, with local testing available through Docker Compose.
Switchyard selects the model for each request under LiteLLM integration. Stage routing reads recent tool activity and results from request history, then chooses between exactly two candidate models. Random routing selects from two or more configured models with optional weights for traffic splits and A/B comparisons. Classifier-backed Task and Composite strategies need intermediate model calls that this integration does not support. LiteLLM also offers a native built-in Switchyard stage router as an auto-router strategy.
What routed coding workloads mean for costs
For companies running coding agents, routing changes how model choice maps to completed work rather than individual calls. The guide defines a LiteLLM model group as one public name with one or more deployments behind it, so clients send "model": "switchyard" while Switchyard picks the candidate. The Stage profile lists a capable model first and an efficient model second, with order defining roles. Smaller teams can test the same gateway locally before deployment, while larger organizations can run routed and baseline groups side by side in one deployment.
The sample includes two single-model baselines, claude-opus-5-5 and nemotron-super-3-120b, alongside the routed switchyard group for direct comparison of cost and pass rate. Every model uses bedrock/converse/ identifiers through the Amazon Bedrock Converse API, and the LiteLLM request timeout of 600 seconds matches the load balancer idle timeout. The Random profile uses the same models with algorithm "random" and weights 0.5 and 0.5. This setup does not prove savings by itself, so teams should verify retry rates, unfinished tasks, and history replay on their own codebases.
A practical marker will be benchmark results for cost per solved task from the sample runners on internal repositories. If the routed group holds pass rates while lowering total spend versus each baseline, the approach merits wider rollout. Security and compliance review remains required before any production deployment, with testing in a non-production account. Global cross-Region inference profiles also deserve attention where request processing location matters.
