Skip to main content

openshell inference

Manage the gateway-level inference configuration. The inference route determines which provider and model are used when sandbox workloads call inference.local — the managed LLM endpoint injected by the policy engine. Inference configuration is scoped to the active gateway, not to individual sandboxes.

openshell inference set

Set the gateway-level inference provider and model. Overwrites the current configuration.
string
required
Provider name (must already exist — see openshell provider create). The provider’s credentials are used for all inference calls routed through inference.local.
string
required
Model identifier to use for generation calls (e.g., gpt-4o, claude-opus-4-5, meta/llama-3.1-70b-instruct).
boolean
Configure the system inference route instead of the user-facing route. The system route is used by platform functions (e.g., the agent harness) and is not accessible to user code.
boolean
Skip endpoint verification before saving the route. By default, the CLI makes a test request to confirm the provider and model are reachable.

Examples


openshell inference update

Partially update the gateway-level inference configuration. Only the flags you provide are changed; omitted flags leave the current values in place.
string
Provider name. Unchanged if omitted.
string
Model identifier. Unchanged if omitted.
boolean
Target the system inference route instead of the user-facing route.
boolean
Skip endpoint verification before saving.

Examples


openshell inference get

Show the current gateway-level inference configuration.
boolean
Show the system inference route instead of the user-facing route. When omitted, both routes are displayed.

Examples


How inference routing works

When a sandbox workload calls inference.local, the policy engine:
  1. Intercepts the outbound request.
  2. Strips the caller’s credentials.
  3. Injects the configured provider’s credentials.
  4. Forwards the request to the provider’s API.
This keeps model API credentials out of sandbox environments entirely — agents call a stable local endpoint and never see the underlying keys.
The inference route must reference a provider that exists on the gateway. Create one first with openshell provider create if you have not already.

Supported provider types

Any provider type registered with openshell provider create can be used as an inference provider, provided the underlying API is compatible with the OpenAI chat completions interface. The following types are tested and known to work: