> This page is for v0.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/nemoclaw/llms.txt.

# Set Up Adaptive Switchyard Routing

> Configure Classic Hermes Switchyard onboarding, check readiness, and return to single-model Hermes.

Classic Hermes can request adaptive routing through its native NeMo Relay runtime and the `nvidia.switchyard` plugin.
Routing is opt-in and disabled by default.

> **Warning**
>
> The complete supervised adaptive journey remains subject to [qualification in #13866](https://github.com/NVIDIA/NemoClaw/issues/13866).
> Successful onboarding, gateway health, or a direct provider request does not establish that qualification.

## Check Prerequisites

Use a released NemoClaw installation with the managed Classic Hermes image and an unused sandbox name.
Custom images and other agent runtimes are outside this procedure.
The packaged compatibility set is Hermes Agent 0.21.3, NeMo Relay 0.8.3, and Switchyard plugin 0.3.0.
The plugin bundles target Linux amd64 and arm64 sandbox images.
These package targets do not establish adaptive qualification for every host platform or provider.

The supported configuration shape contains one `llm-classifier` route named `switchyard`, with an efficient target, a capable target, and a resolved judge role.
Hermes owns the Relay runtime inside its supervised process; no separate Relay or Switchyard server is required.

Select accessible models from the approved fixed hosted profiles.
The accepted provider identifiers and their host credential variables are listed below.

| Provider Identifier | Host Credential Variable   |
| ------------------- | -------------------------- |
| `nvidia-prod`       | `NVIDIA_INFERENCE_API_KEY` |
| `openai-api`        | `OPENAI_API_KEY`           |
| `anthropic-prod`    | `ANTHROPIC_API_KEY`        |
| `gemini-api`        | `GEMINI_API_KEY`           |
| `openrouter-api`    | `OPENROUTER_API_KEY`       |

Make the required credentials available in the host environment before onboarding.
Use your credential manager rather than putting literal values in shell history or the routing file.
OpenShell stores provider credentials for the lifetime of the created providers.
The sandbox receives endpoint-scoped placeholders instead of raw credentials.
Removing the host environment variables after onboarding does not remove credentials stored in OpenShell.

Accepted profile identifiers do not establish that every model can serve as a target or judge.
The released model and provider combination must pass adaptive qualification before you rely on it.

## Create the Onboarding File

Save a regular UTF-8 JSON file named `switchyard.json`.
The following example illustrates the versioned input shape; its model pair is not a qualification claim.
Replace the model selections with models available to your accounts and covered by your qualification evidence.

```json
{
  "schemaVersion": 1,
  "efficient": { "provider": "nvidia-prod", "model": "nvidia/nemotron-nano" },
  "capable": { "provider": "openai-api", "model": "gpt-5.2" }
}
```

The efficient and capable model IDs must differ, including when they use different providers.
The file must not contain credentials, endpoints, a route override, or internal Relay or Switchyard configuration.
Unknown fields, duplicate fields, symbolic links, and files larger than 16 KiB are rejected.

By default, the capable target also serves as judge.
Gateway startup tests classification and separate routing and answer usage accounting before accepting traffic.
If the capable model cannot satisfy that contract, select a qualified dedicated judge with a different model ID from both targets.
Add a `judge` object alongside `efficient` and `capable` using the same `provider` and `model` fields.
A dedicated judge requires its provider credential on the host, even when neither answer target uses that provider.
There is no hidden replacement judge after qualification fails.

Refer to the [onboarding option reference](../../reference/commands#--switchyard-config-file) for the complete input and lifecycle constraints.

## Onboard a Fresh Sandbox

Onboarding creates and attaches fresh OpenShell providers and can make billable validation and judge requests.
It does not copy data from an existing sandbox.
Preserve any existing sandbox until you verify its replacement.

Run onboarding with the configuration file and an unused name.

```bash
nemohermes onboard --fresh --name routed-hermes --switchyard-config ./switchyard.json
```

NemoClaw generates the protected Relay activation and Switchyard deployment files from observed provider bindings.
The generated clients do not forward caller credentials or use `inference.local` as an adaptive target.
Each physical provider call has a 120-second deadline and zero automatic provider retries.
That deadline does not define a whole-turn deadline or response-byte limit.

Onboarding supports fresh provider creation, not reuse, mutation, or credential rotation of published routing bindings.
To change selections, onboard with a new name.
Neither `--resume` nor `--recreate-sandbox` turns a published routed sandbox into a reusable provider configuration.

If onboarding reports incomplete provider cleanup or an unconfirmed provider creation, preserve its bounded diagnostics.
Resolve the owned-provider state before retrying.
Do not delete providers without confirmed ownership.

## Verify the Routing State

Inspect the named sandbox after onboarding.
Status can make a capable-provider request, so it can incur provider charges.

```bash
nemohermes routed-hermes status
```

Interpret each observation according to its boundary.

| Observation                            | What It Establishes                                                                                                                        |
| -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| An accepted onboarding file            | Routing was requested with valid high-level selections.                                                                                    |
| A healthy gateway                      | The gateway responds; this alone does not establish routing readiness.                                                                     |
| Fresh routing preflight                | Recorded provider identities, policy, package, protected configuration, credential references, and gateway observations remain consistent. |
| Successful startup judge qualification | The startup probe classified a request and produced separate routing and answer usage evidence.                                            |
| A successful capable-provider request  | That provider answered while preflight remained current; it does not prove an adaptive Hermes turn.                                        |
| Correlated canonical routing events    | They can identify the judge role and target for a turn when captured through a qualified evidence procedure.                               |

Missing or changed preflight evidence blocks verification.
Do not treat an unavailable observation as a passing result.

### Per-Turn Target Evidence

When verified Switchyard routing is active, gateway logs can contain bounded `[switchyard-evidence]` JSON records.
The records include UUID ancestry, turn boundaries, classifier decisions, judge or answer roles, and hashes of the selected models.
They omit prompts, answers, private reasoning, arbitrary metadata, provider errors, credentials, and token metrics.
Capture stops after 4,096 records and writes a truncation marker.
A missing, failed, truncated, or uncorrelated capture does not prove adaptive routing.

The operator procedure for inspecting canonical events without sandbox-internal inspection remains pending in [#13866](https://github.com/NVIDIA/NemoClaw/issues/13866).
Do not infer the selected target from the configured capable model, a health check, or the answer text.
Private classifier reasoning, prompts, provider response bodies, and credential values must not enter shared evidence.

Seeded `weighted-random` tests establish only smoke coverage of target reachability.
They do not establish the adaptive `llm-classifier` outcome.

## Troubleshoot a Failed Check

Use the bounded failure category and gateway diagnostics to locate the failing boundary.
Logs can contain conversation content; inspect them locally and redact private content before sharing an excerpt.
Do not dump provider credentials, environment variables, or protected routing files into an issue.

Read a bounded gateway log excerpt with the named sandbox command.

```bash
nemohermes routed-hermes logs --tail 80
```

Use the following checks without editing sandbox internals.

| Boundary            | Check and Recovery                                                                                                                                                                                                |
| ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Input               | Check the JSON schema version, provider identifiers, distinct model IDs, regular-file requirement, and absence of extra fields. Correct the host file before retrying.                                            |
| Plugin or package   | Check that onboarding used the managed Hermes image and the compatible packaged versions. For an integrity mismatch, preserve the sandbox and create a fresh sandbox from released artifacts.                     |
| Deployment or route | Check the original onboarding file and the bounded configuration/runtime error. Do not repair protected files manually. Preserve the failed sandbox and onboard a new name when inputs cannot be restored safely. |
| Judge               | Check model access and the startup qualification error. Select a qualified dedicated judge in the host file and onboard a new name when capable reuse fails.                                                      |
| Provider            | Check access to each selected model and any reported identity or revision mismatch. Changed or missing bindings require recovery review; do not silently substitute another provider.                             |
| Placeholder         | Check for the credential-reference failure in the bounded diagnostics. Do not replace placeholders with raw keys. Preserve the failed sandbox and recreate from host onboarding inputs under a new name.          |
| Policy              | Check policy denials for the selected provider path. Restore the intended reviewed policy rather than enabling direct provider egress.                                                                            |
| Changed evidence    | Stop concurrent provider, policy, or sandbox changes. Rerun status only after the intended state is stable.                                                                                                       |

Relay 0.8.x can omit upstream error details for unmatched model routes.
The generated Hermes model uses the `switchyard` route, and readiness rejects invalid or inconsistent routing state.
Do not override the model to an unmatched route or treat it as a fallback path.
When upstream details are unavailable, retain that classification instead of reconstructing them from provider bodies.
Current qualification does not establish universal interception of every Hermes request.

## Restart and Recheck

For an ordinary process failure, correct its cause before restarting the sandbox.
A restart interrupts active work and does not change the recorded routing selections.

Stop the named sandbox first.

```bash
nemohermes routed-hermes stop
```

Start it again after the stop completes.

```bash
nemohermes routed-hermes start
```

Rerun `nemohermes routed-hermes status` after startup.
Startup must pass protected configuration and judge checks again.
The proof that real adaptive turns retain their route across restart remains part of #13866.
For unresolved integrity or provider changes, use a fresh sandbox instead of retrying indefinitely.

## Return to Ordinary Hermes

There is no supported in-place routing toggle for a published routed sandbox.
While routing is configured, `inference set` refuses changes.
Preserve data with an independently maintained backup before replacing or deleting a sandbox.
Do not restore protected routing configuration into the replacement.

Create a replacement with an unused name and omit `--switchyard-config`.
Choose the ordinary single-model provider in the wizard.

```bash
nemohermes onboard --fresh --name ordinary-hermes
```

Verify the replacement before retiring the routed sandbox.

```bash
nemohermes ordinary-hermes status
```

Confirm that ordinary Hermes can complete your required task.
The new sandbox does not automatically inherit the previous workspace, provider selections, or routing state.
If verification fails, preserve the routed sandbox and resolve the replacement failure before cleanup.

> **Warning**
>
> Destroy removes the selected sandbox and its workspace.
> Complete data recovery and verify your replacement before running this command.

Retire the old sandbox only when you no longer need it.

```bash
nemohermes routed-hermes destroy
```

Cleanup checks recorded Switchyard provider identities and revisions before removing their OpenShell registrations.
Changed identities or cleanup errors can leave residual providers and credentials.
Resolve those errors through the [destroy command guidance](../../reference/commands#nemohermes-name-destroy); do not delete unrelated providers.
Destroying the old sandbox does not clear credentials from your host credential manager or shell environment.
Do not treat cleanup errors as confirmation that routing providers and their credentials were removed.

## Related Topics

* [Switchyard Onboarding Reference](../../reference/commands#--switchyard-config-file) owns the input and lifecycle contract.
* [Sandbox Recovery](../../manage-sandboxes/operate-sandboxes/recover-and-rebuild-sandboxes) describes recovery boundaries.
* [Optimization Blueprint #8501](https://github.com/NVIDIA/NemoClaw/issues/8501) owns benchmark and cost-saving claims, which this procedure does not make.