Skip to main content

NVIDIA NeMo Switchyard lets Codex use local models. Test the fallback first

4 min read

NVIDIA NeMo Switchyard routes Codex and Claude Code across local and cloud models. Here is what to test before the pre-alpha proxy touches a real repo.

NVIDIA NeMo Switchyard lets Codex use local models. Test the fallback first

NVIDIA’s Switchyard can make Codex or Claude Code speak to a local or alternate model without teaching the agent a new API. The repository also prints the warning that matters most: pre-alpha, experimental, not for production.

NVIDIA NeMo Switchyard is an open-source Rust proxy and routing library for LLM traffic. It accepts OpenAI Chat Completions, OpenAI Responses, and Anthropic Messages, chooses a configured backend, then translates the answer back into the format the client expects.

The practical promise is attractive: keep the coding-agent interface while changing the model behind it. The practical risk is equally clear: translation, routing, streaming, tools, sessions, and fallback now sit in a new critical layer.

What Switchyard puts between agent and model

LayerWhat the repository supportsWhat to verify
Client protocolsOpenAI Chat, OpenAI Responses, Anthropic MessagesTools, streaming events, errors, and usage fields survive translation
BackendsvLLM, NVIDIA NIM, Ollama, OpenAI-compatible endpointsAuthentication, context limits, model IDs, and cancellation
LaunchersClaude Code, Codex CLI, OpenClawEnvironment variables and local configuration do not leak
RoutingPassthrough, random, classifier, stage, escalation, customThe chosen route matches risk, latency, and tool capability
MetricsRequests, errors, latency, tokens, routing overheadCardinality, redaction, retention, and cost accuracy
Capabilities are documented by the project. Production reliability is not established; the README calls the software pre-alpha.

Protocol compatibility is not behavior compatibility

A translated request can be syntactically valid and still behave differently. Models disagree about tool selection, JSON discipline, parallel calls, stop conditions, reasoning fields, prompt hierarchy, and how much context they can use reliably.

For a coding agent, those differences reach the filesystem and shell. A fallback that produces fluent prose but drops a required tool call has failed. The router needs task-level checks alongside a healthy HTTP response.

Choose a routing strategy for one measurable reason

  • Passthrough is the safest first test because it proves translation without adding a routing decision.
  • Random routing is useful for controlled A/B traffic, provided sessions do not jump unpredictably between incompatible models.
  • Classifier routing adds another model decision before the worker model, so measure its accuracy and latency separately.
  • Stage routing uses signals already present in the conversation, such as tool results and errors, to choose a tier.
  • Escalation routing runs a weak tier first and asks a judge whether to retry on a stronger tier, which can improve coverage while increasing cost and latency.

Do not enable all of them during the first evaluation. Every additional branch makes a bad output harder to attribute.

The fallback test that matters

  1. Start with one client, one route, and one backend.
  2. Replay a fixed set of read-only tasks with streaming and tools enabled.
  3. Kill the backend during a streamed response and observe cancellation, retry, and duplicate tool behavior.
  4. Send a tool schema near the provider’s naming and size limits.
  5. Force context overflow, invalid credentials, rate limiting, and a malformed upstream response.
  6. Confirm that logs do not capture prompts, source code, secrets, or tool outputs unnecessarily.
  7. Require the fallback model to pass the same repository checks as the primary.

A router has failed if it returns an answer but loses the agent’s safety contract.

Treat the README warning as a deployment gate

The project says its API and algorithms may change significantly before version 1.0 and explicitly labels the software not for production use. That does not make it useless. It defines the correct setting: a disposable branch, a local benchmark harness, or an isolated evaluation environment.

Our article on Copilot Memory and Ollama controls shows why local models do not automatically create local privacy. Our AI agent security scorecard gives the permissions, secrets, logging, and rollback questions to ask before a proxy touches a real repository.

My verdict: a useful lab switch, not a production promise

Switchyard is interesting because it makes model routing inspectable. The protocols, targets, algorithms, and metrics live in an Apache-2.0 repository instead of behind a dashboard.

Use it to learn where your coding agent depends on a provider’s behavior. Start with passthrough, break the backend on purpose, and watch every consequential tool call. If the fallback has not survived that test, it is a demo route—not a resilience plan.

Read the repository

Checked August 12, 2026 against the repository’s main branch. Features and maturity labels are project-reported and may change quickly before version 1.0.

Leave a comment

Your email address will not be published. Required fields are marked *