Repository navigation
feat: remove managed inference routes in favor of providers v2 #3172
Description
User Story
As an OpenShell operator, I want profile-backed providers to be the single way that sandboxes receive model-provider access, so that provider credentials, endpoint policy, and sandbox attachment lifecycle are configured through one consistent workflow.
Problem Statement
OpenShell currently exposes https://inference.local inside every sandbox and manages its upstream through a separate workspace-level inference route. It also carries a second sandbox-system route intended for supervisor-internal platform inference. Providers v2 now supports authoritative provider profiles, per-sandbox provider attachment, provider-owned network policy, and endpoint-bound credential injection. Keeping these managed inference routes duplicates that provider model with gateway-managed route state, separate openshell inference configuration, model pinning, and route-bundle delivery.
Remove both inference.local and sandbox-system, including the managed inference configuration and bundle-delivery surface, and make profile-backed providers the supported path for model-provider access. No production code currently calls the sandbox-system in-process API; it exists only in its implementation and tests.
Impact / Why This Matters
Today users must understand and maintain two overlapping abstractions: provider records/attachments for direct provider access and a workspace-global inference route for inference.local. The latter applies one provider and model across all sandboxes in a workspace, while provider attachments are scoped to individual sandboxes. This creates ambiguous ownership, prevents provider attachment from being the complete access contract, constrains clients to the proxy's supported API patterns, and expands the CLI, API, policy, routing, documentation, and test surface.
Users can already attach a provider and call its native endpoint, but current documentation presents that path alongside inference.local and still auto-allows the virtual host. Maintaining both paths adds operational and security-review cost without a distinct sandbox use case now that provider profiles own endpoints, L7 policy, and credential binding.
Proposed Design
Make profile-backed providers the only user-facing mechanism for granting a sandbox access to an inference provider:
- Users create or select a provider profile and provider instance.
- Users attach that provider when creating a sandbox or with
openshell sandbox provider attach. - Code in the sandbox calls the provider's native endpoint and uses the provider-defined environment/config contract. OpenShell continues to enforce the profile-derived network policy and inject credentials only at authorized endpoints.
- Detaching the provider revokes its policy and credential access for that sandbox.
Stop exposing, resolving, documenting, or implicitly allowing inference.local for sandbox workloads. Remove sandbox-system and its unused in-process supervisor API as well. Remove the managed inference CLI commands, gRPC configuration and bundle-delivery API, persisted route state, and supervisor route refresh/partitioning behavior. Existing installations should receive clear upgrade guidance that maps inference.local configurations to provider attachment and native endpoint usage rather than silently preserving the old feature. If a concrete platform-level inference consumer is introduced later, it should get an explicit provider-backed design based on that consumer's identity, policy, credential, and lifecycle requirements rather than retaining a speculative shared route.
Acceptance Criteria
- New and upgraded sandboxes do not resolve, trust, implicitly allow, or route requests to
inference.local. - The gateway no longer persists or delivers
inference.localorsandbox-systemroutes, and removes the managed inference route/bundle API surface. - The
openshell inference set|get|update|deletecommand surface is removed. - Attaching an inference-capable provider grants only that sandbox the profile-defined native endpoints, policy, and endpoint-bound credentials; detaching it revokes that access according to the provider lifecycle contract.
- Built-in inference provider profiles contain the endpoint, protocol, credential, and configuration metadata required for supported clients to call their native APIs without
inference.local. - OpenAI-compatible, Anthropic-compatible, and other supported inference-provider paths have end-to-end coverage through provider attachment and native endpoints.
- Existing
inference.localroute state has deterministic upgrade behavior and the release notes provide a concrete migration from inference-route configuration to provider attachment. - README, published documentation, tutorials, architecture docs, CLI help, and public/internal agent skills no longer present
inference.localas a sandbox feature. - Protobuf comments, generated SDK surfaces, policy defaults, certificates/DNS handling, router configuration, logging, and tests no longer carry sandbox-facing
inference.localassumptions. - The
sandbox-systemroute, supervisor route cache, and in-processsystem_inference()API are removed, with tests confirming no platform functionality depends on them. - The replacement preserves OpenShell's credential non-disclosure, endpoint binding, policy enforcement, hot-refresh, and OCSF logging guarantees.
Alternatives Considered
Keep inference.local alongside providers v2. This preserves compatibility but leaves users and maintainers with two overlapping ways to grant model access and retains workspace-global behavior that conflicts with per-sandbox provider attachment.
Automatically create an inference.local route when an inference-capable provider is attached. This makes attachment more convenient but preserves the virtual endpoint, model-routing abstraction, and duplicate routing/credential path that this proposal removes.
Deprecate inference.local indefinitely. A short, documented migration window may be appropriate, but maintaining both mechanisms as supported features would defer rather than eliminate the ambiguity and maintenance burden.
Retain sandbox-system for future platform functions. The route was introduced for a possible embedded agent harness such as policy analysis, but there is no production caller today. Keeping it would preserve much of the managed inference configuration, bundle, route-cache, and router machinery for a speculative consumer whose actual authorization and provider-lifecycle requirements are not yet defined.
Agent Investigation
- Providers v2 is now the only provider system after feat(providers): make Providers v2 the only provider system #1988 and provider profiles were made authoritative in feat(providers): make profiles authoritative #2962.
docs/providers/profiles.mdxdocuments per-sandbox attach/detach, just-in-time provider policy composition, and endpoint-bound credential injection. It still lists inference mounting from attached providers as a roadmap item and points users to the separateinference.localmodel.docs/sandboxes/inference-routing.mdxdocumentsinference.localas one workspace-level provider/model route shared by every sandbox, configured withopenshell inference.proto/inference.protoandcrates/openshell-server/src/inference.rsdefault empty route names toinference.localwhile also carrying the distinctsandbox-systemroute.sandbox-systemwas introduced by feat: add sandbox.inference.local endpoint for system-level inference #207/feat(inference): add sandbox-system inference route for platform-level inference #209 for possible platform functions such as an embedded policy-analysis harness. The currentsystem_inference()API has no production call sites; only its implementation and integration tests reference it.- The current tree contains
inference.localreferences across 54 files, including CLI/server/router/policy code, protobuf and generated SDKs, e2e tests, README, architecture docs, published docs, and public/internal skills. - No open issue was found whose purpose is to remove the sandbox-facing feature. Related history includes the original introduction in Simplify inference routing: introduce inference.local and remove implicit catch-all #133 and the provider-v2 roadmap in Enhanced Provider Management #896.
Checklist
- I've reviewed existing issues and the architecture docs
- This is a design proposal, not a "please build this" request
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
0.1.0#2565johntmyers commentedon Sep 4, 2026
Implementation Plan
Issue type:
refactorComplexity: High
Confidence: Medium — the end state is clear, but removal crosses the runtime, control plane, public APIs, SDKs, tests, and documentation.
Summary
Remove the managed inference feature set:
inference.local,sandbox-system, workspace-scoped inference routes, route-bundle delivery, theopenshell inferencecommand/API/SDK surfaces, and the sandbox-local request-shaping router. Attached Providers v2 become the only supported mechanism for inference access.This is an intentional breaking change before the public re-release. No mixed-version compatibility, deprecation shim, route conversion, or automatic provider attachment is required. Legacy route rows will be purged, and the upgrade procedure will require existing sandboxes/supervisors to be recreated.
This issue lands before the separate removal of automatically available Providers v2 profiles. Those profiles may remain temporarily as scaffolding, but replacement tests in this issue must explicitly import profile fixtures to prove the final
profile import → provider create → sandbox attach → native endpointworkflow. Keepinference_capableas informational metadata for potential future observability; it must not imply current routing or policy behavior.Expected effort is approximately 8–12 engineer-days, preferably delivered as three focused PRs: dependency/control-plane cleanup, data-plane removal and replacement tests, then SDK/docs/skills cleanup.
Scope
proto/inference.proto,crates/openshell-server/src/inference.rs,crates/openshell-server/src/multiplex.rs, and server auth tables: remove managed inference RPCs, route resolution, bundle delivery, and authorization plumbing.crates/openshell-core/src/grpc_client.rs,crates/openshell-core/src/metadata.rs,crates/openshell-server/src/grpc/workspace.rs, and new SQLite/PostgreSQL migrations: remove route clients/object metadata/cascade logic and delete persistedobject_type = 'inference_route'rows.crates/openshell-supervisor-network/src/{proxy.rs,inference_routes.rs,l7/inference.rs,run.rs}andcrates/openshell-supervisor-network/tests/system_inference.rs: remove the privilegedinference.localinterception, custom HTTP parser/request matcher, route cache/refresh loop,system_inference()API, and associated OCSF inference-routing events.crates/openshell-sandbox/src/{main.rs,lib.rs}: remove--inference-routes/OPENSHELL_INFERENCE_ROUTESstandalone configuration and route wiring.crates/openshell-router/**plus server/supervisor/package dependencies: delete the inference-only router and its provider-specific header, path, model, body, timeout, retry, probe, and streaming behavior.crates/openshell-core/src/inference.rs,crates/openshell-providers/src/{lib.rs,discovery.rs}, andcrates/openshell-server/src/grpc/provider.rs: remove the old hard-coded managed-inference provider registry after relocating or deleting the small Providers v2 helpers that still depend on it. Do not remove the Providers v2 YAML profiles in this issue.crates/openshell-cli/src/{main.rs,run.rs,tls.rs}: removeopenshell inference set|get|update|deleteand inference-only client setup.scripts/keycloak-realm.json, OIDC tests, and API authorization docs: remove inference-specific scopes and method mappings.README.md, published docs, architecture docs, examples, and public/internal skills: removeinference.localas a supported feature and document the native-provider UX and breaking upgrade.Implementation Steps
Decouple Providers v2 from the old inference registry.
crates/openshell-core/src/inference.rs.crates/openshell-server/src/grpc/provider.rs; custom endpoints are expressed by explicitly imported profiles instead.inference_capablein the profile schema and document it as informational metadata only.Remove the managed inference control plane.
proto/inference.protoand stop registering or calling the service.inference_routeobject rows; leave historical migrations unchanged.Remove the managed inference data plane.
CONNECT inference.local:443branch and its implicit trust/policy behavior.system_inference(), request-shape matching, model/path/body/header rewriting, and inference-specific streaming/probe behavior.--inference-routesfrom standalone sandbox/supervisor configuration.openshell-routerafter its last consumers are gone and clean Cargo/package references.Remove public SDK surfaces and regenerate.
InferenceRouteClientexports/tests/generated modules.Inference()client interfaces, types, converters, fakes, examples, generated bindings, and codegen mappings.Replace tests with explicit imported-profile coverage.
sandbox-system, andinference.localsuccess-path suites.inference.localregression.Update documentation, architecture, examples, and skills.
sync-agent-infraconsistency workflow because this removes a crate and changes CLI/skill coverage.Test Plan
Unit tests
inferencecommand group is absent.inference_capableround-trips as metadata without affecting routing or policy.Integration tests
inference_routerows while preserving provider records and attachments.E2E tests
inference.localno longer resolves, receives special trust, bypasses ordinary policy, or routes requests.sandbox-system.Verification
mise run pre-commitmise run testmise run e2e:dockerfor the modified provider/sandbox E2E pathsmise run cibefore the final PRRisks & Open Questions
inference.localremoval by broadening credential scope. Native credential substitution must remain profile endpoint/path-bound and default-deny elsewhere.API:INFERENCEmodel/token-aware events disappear with the request parser. Native traffic continues to emit ordinary network/HTTP and credential-binding OCSF events.inference_capableis retained so deeper observation can be designed separately later./proc, exec, or process-identity behavior. Replacement E2E tests should use the existing provider/sandbox harness rather than add label-sensitive fork/exec probes.Documentation Impact
docs/reference/gateway-config.mdx: no expected change; this issue does not add, remove, or rename gateway TOML or compute-driver configuration.docs/reference/sandbox-compute-drivers.mdx: no expected change unless implementation uncovers a driver-specific workaround.docs/sandboxes/inference-routing.mdx, update provider profiles and Google Vertex guidance, rewrite local inference tutorials, and update policy, security, gateway-auth, how-it-works, supported-agents, and observability pages.architecture/README.md,architecture/gateway.md,architecture/sandbox.md,architecture/security-policy.md,architecture/google-vertex-ai-provider.md, and relevant limits documentation.examples/local-inference/,skills/debug-inference,skills/openshell-cli, policy-generation guidance, and thesync-agent-inframaintenance map.UX Now / After
Hosted provider
Now
After
The attachment is the complete access contract for this sandbox. The environment value remains an OpenShell placeholder and resolves only at profile-authorized endpoints.
Local or custom OpenAI-compatible provider
Now
openshell provider create \ --name ollama \ --type openai \ --credential OPENAI_API_KEY=unused \ --config OPENAI_BASE_URL=http://host.openshell.internal:11434/v1 openshell inference set --provider ollama --model qwen3.5:0.8bThe application calls
https://inference.local/v1; the router rewrites the request to the configured host endpoint and forces the model.After
The application calls the native endpoint and supplies the real model. OpenShell enforces only the imported profile’s endpoint, path, binary, and credential contract.
Upgrade behavior
Existing managed route rows are not migrated. The supported breaking upgrade is: upgrade the gateway, purge route state through the schema migration, recreate all sandboxes, import/edit the required profiles, create providers, attach them to intended sandboxes, and update clients to native endpoints.
Revision 1 — initial plan
refactor(inference): remove managed inference routes
johntmyers commentedon Sep 4, 2026
Implementation Complete
PR: #3195
What was built
Removed the managed inference route control plane,
inference.localproxy path, request-shape matching, built-in router crate, and inference SDK surfaces. Inference now uses explicitly imported provider profiles attached to sandboxes and provider-native endpoints;inference_capableremains informational.Tests
mise run testandmise run ciDocs updated
The issue will auto-close when the PR is merged.
refactor(inference): remove managed inference routes
refactor(inference): remove managed inference routes
refactor(inference): remove managed inference routes
refactor(inference): remove managed inference routes
refactor(inference): remove managed inference routes (NVIDIA#3195)