# AWS Routes Bedrock Coding Agents With NeMo Switchyard

*Updated on November 14, 2026*

Amazon Web Services (`AWS`) has open-sourced a complete reference architecture and AWS CDK deployment stack for dynamically routing autonomous coding-agent turns (`Claude Code`, `OpenAI Codex CLI`, and custom harnesses) across **Amazon Bedrock** using **NVIDIA `NeMo Switchyard`** (`switchyard-server 0.3.0`) embedded inside **`LiteLLM` (`v1.102.0`)** on AWS Fargate.

Authored by AWS engineers Aswath Ram A Srinivasan, Anshika Saxena, Curt Lockhart, Ian Cairns, Kevon Mayers, and Aris Tsakpinis, the release reframes enterprise coding-agent economics around a single metric that platform teams routinely miscalculate: **cost per solved task** (`Total_Run_Spend / Tasks_Passing_Tests`), rather than raw price per million tokens. Because you pay for every failed retry and every 40-turn context replay on tasks that never pass CI, routing 100% of turns to a cheap model can actually *increase* cost per solved task if pass rates crater, while routing 100% of turns to `Claude Opus 5.5` wastes frontier compute on trivial `ls`, `grep`, and file-read turns.

Unlike earlier LLM routers that burn `200–600ms` of extra latency and tokens calling an intermediate "judge/classifier LLM" before every single turn, `NeMo Switchyard`'s **Stage routing** strategy operates with **zero judge-model calls**. By deterministically inspecting recent tool-call activity and tool outputs in the conversation history, Switchyard routes complex planning and failure-recovery turns to **`Claude Opus 5.5`** (`global.anthropic.claude-opus-5-5`) while offloading routine mid-loop execution turns to **`NVIDIA Nemotron 3 Super 120B`** (`nvidia.nemotron-super-3-120b`) over private Bedrock VPC endpoints.

While AWS ships production-grade security scaffolding around the gateway (`AWS WAF`, IPv4 CIDR allowlists, locked-down ALB path routing returning `404` on LiteLLM admin routes, and IAM roles via VPC PrivateLink), platform architects should note that NVIDIA marks `switchyard-server 0.3.0` as an experimental evaluation component whose TOML configuration may evolve between minor releases.

<a aria-hidden="true" id="executive-fast-facts"></a>  Fast Facts

- **Architecture &amp; Stack**: `LiteLLM v1.102.0` + `NVIDIA NeMo Switchyard` (`switchyard-server 0.3.0` Rust crate) deployed on **Amazon ECS on AWS Fargate** in private subnets via AWS CDK, detailed in the [AWS Machine Learning Blog NeMo Switchyard guide](https://aws.amazon.com/blogs/machine-learning/route-coding-agent-requests-to-the-right-model-on-amazon-bedrock-with-nvidia-nemo-switchyard/) and [aws-samples GitHub repository](https://github.com/aws-samples/sample-route-coding-agent-requests-Amazon-Bedrock-nemo-switchyard).
- **Reference Bedrock Model Pair**: Routes dynamically between **`Claude Opus 5.5`** (capable frontier model) and **`NVIDIA Nemotron 3 Super 120B`** (lower-cost efficient execution model) via the Bedrock `Converse` / `ConverseStream` API.
- **Zero-Judge Routing Strategies**: Supports **Stage routing** (inspects conversation tool-call history/results across 2 models with `0` judge LLM calls) and **Random weighted routing** (for clean A/B benchmarks); LiteLLM also recently added a native built-in Switchyard stage router.
- **North-Star Metric**: Evaluates model groups strictly on **cost per solved task** (`total spend across all attempts / runs where unit tests pass`).
- **Hardened Gateway Security**: `AWS WAF` + CIDR-restricted ALB forwarding strictly `/v1/chat/completions`, `/v1/models`, and `/health/liveliness` (blocking LiteLLM admin UI and key-management routes with `404`), plus Bedrock Runtime VPC Interface Endpoints.

## Routing Architecture Comparison: Static Single-Model vs. Judge Routers vs. Switchyard Stage

Why avoid classifier/judge-backed routers inside interactive `Claude Code` or `Codex CLI` terminal loops? A single repository refactor routinely fires 35 sequential tool calls; adding a 400ms judge-LLM hop before each call tacks 14 seconds of dead latency onto every task and breaks prompt-caching assumptions:

| Routing Pattern | Per-Turn Routing Latency | Extra Judge Token Cost | Context Awareness | Optimal Use Case |
|---|---|---|---|---|
| **100% Frontier (`Claude Opus 5.5`)** | 0 ms | $0 | Full | Hard greenfield architecture; highest bill |
| **100% Efficient (`Nemotron 3 120B`)** | 0 ms | $0 | Full | Bounded chores; risks retry loops on hard bugs |
| **LLM Judge / Classifier Router** | +250 ms to +700 ms / turn | Paid on every turn | Prompt snippet only | Single-turn customer chat triage |
| **NeMo Switchyard Stage Router** | **&lt;5 ms (In-process Rust)** | **$0 (Zero judge calls)** | **Full tool activity &amp; test result history** | **Multi-turn coding agents (`Cost / Solved Task`)** |

Notice one subtle client requirement for Stage routing to work accurately: **the coding agent must transmit the full conversation and tool-result history on each `/v1/chat/completions` call**, because Switchyard reads recent tool invocations and exit statuses (`pytest` pass vs. stack trace, file read vs. multi-file edit) to decide whether the current stage needs `Opus 5.5` or `Nemotron 3 Super 120B`. Transparent observability comes built in: while the JSON response body keeps `"model": "switchyard"` so strict CLI harnesses don't complain, LiteLLM injects `x-litellm-model-name` in the HTTP response headers so telemetry dashboards know exactly which Bedrock model answered each turn.

## Configuring Hardened LiteLLM + Switchyard Profiles on Bedrock

Even if you run LiteLLM on Kubernetes (`EKS`) rather than ECS Fargate, two patterns from AWS's reference repo are worth copying verbatim, pairing `Opus 5.5` + `Nemotron 3 Super 120B` behind one logical `switchyard` model group, and **blocking `/ui` and `/key/*` admin paths at the load balancer**:

```
# profiles/stage/litellm.yaml - Route coding turns across Bedrock Converse API
model_list:
- model_name: switchyard
 litellm_params:
   model: bedrock/converse/global.anthropic.claude-opus-5-5
   aws_region_name: os.environ/AWS_REGION
- model_name: switchyard
 litellm_params:
   model: bedrock/converse/nvidia.nemotron-super-3-120b
   aws_region_name: os.environ/AWS_REGION

# ALB Listener Rule: Expose ONLY inference paths; return 404 on /ui, /docs, /key/*
# Prevents LiteLLM admin-endpoint CVEs while keeping Bedrock traffic on VPC PrivateLink.
```

Keep three engineering caveats in view during evaluation:

- **Pin `switchyard-server` &amp; `LiteLLM` Versions in Staging First**: Because `switchyard-server 0.3.0` is documented by NVIDIA as an evolving evaluation crate (and LiteLLM also ships a native built-in Switchyard auto-router option), benchmark both inside a non-production AWS account (`us-east-1` where `Opus 5.5` and `Nemotron 3 Super 120B` tool-calling parity is verified) before rolling out org-wide.
- **Evaluate Prompt-Cache Hit Trade-Offs**: Switching between `Claude Opus 5.5` and `Nemotron 3 Super 120B` mid-session means warming separate provider prefix caches; verify via the sample repo's benchmark runner that lower `Nemotron` decode pricing outweighs any reduced `Opus` cache-read continuity on your specific repo size.
- **Never Measure Token Savings Without Test-Suite Pass Rates**: Always divide **total Bedrock billing (including failed/timed-out runs)** by **tasks passing CI** when comparing `switchyard` against your single-model `Opus 5.5` baseline.

  Next Steps

1. **Deploy the AWS CDK Benchmark Stack in `us-east-1`**: Clone `aws-samples/sample-route-coding-agent-requests-Amazon-Bedrock-nemo-switchyard` into a sandbox AWS account and run its built-in benchmark harness against 25 representative repository tasks.
2. **Copy the 3-Path ALB Allowlist Onto Existing `LiteLLM` Gateways**: Restrict public/VPN load balancers in front of internal `LiteLLM` containers strictly to `/v1/chat/completions`, `/v1/models`, and `/health/liveliness` (`404` everywhere else).
3. **Log `x-litellm-model-name` Per Turn in Agent Telemetry**: Track exact `Opus 5.5` vs. `Nemotron 3 Super 120B` turn splits and retry counts to tune Stage routing thresholds for minimum dollars per merged PR.