Skip to content

feat(inference)!: replace managed routes with providers - #3194

Open
varshaprasad96 wants to merge 3 commits into
NVIDIA:mainfrom
varshaprasad96:3172-remove-managed-inference-and-refactor-cli/varshaprasad96
Open

feat(inference)!: replace managed routes with providers#3194
varshaprasad96 wants to merge 3 commits into
NVIDIA:mainfrom
varshaprasad96:3172-remove-managed-inference-and-refactor-cli/varshaprasad96

Conversation

@varshaprasad96

@varshaprasad96 varshaprasad96 commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Remove the managed inference-route stack now that provider v2 supplies native provider endpoints, and fold the next service/settings CLI module extraction into the same clean replacement branch. This keeps the #2304 refactor aligned with the architecture established by #3172.

Related Issue

Closes #3172
Relates to #2304
Supersedes #3188

Changes

  • Remove the managed inference CLI, gRPC API, router crate, supervisor interception path, SDK clients, generated bindings, and obsolete examples/tests.
  • Add SQLite and PostgreSQL migrations that remove legacy inference-route objects while preserving all other stored objects.
  • Keep inference access provider-native, including provider type normalization and custom endpoint-bearing profiles, and document the upgrade path.
  • Make the built-in AWS Bedrock profile functional through regional runtime endpoints and proxy-side SigV4 signing.
  • Preserve OpenAI credential binding for the canonical /v1 base URL, correct provider attach and custom endpoint guidance, and remove stale managed-inference references.
  • Add Docker-backed E2E coverage for native OpenAI-compatible and Anthropic-compatible endpoints and the removal of inference.local.
  • Extract service and settings command implementations from the CLI run module into dedicated command modules.
  • Update architecture, published docs, man pages, agent skills, Go/Python SDK surfaces, and repository metadata.

Testing

  • mise run pre-commit passes
  • Unit tests added/updated
  • Focused Docker-backed provider-native inference E2E passes
  • mise run ci passes
  • mise run go:ci passes
  • Focused Python SDK and wheel tests pass (137 tests)
  • Full mise run e2e not run locally; the affected Docker-backed scenario passed

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)
  • Architecture docs updated (if applicable)

@copy-pr-bot

copy-pr-bot Bot commented Sep 4, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

Signed-off-by: Varsha Prasad Narsing <varshaprasad96@gmail.com>
Signed-off-by: Varsha Prasad Narsing <varshaprasad96@gmail.com>
Signed-off-by: Varsha Prasad Narsing <varshaprasad96@gmail.com>
@varshaprasad96
varshaprasad96 force-pushed the 3172-remove-managed-inference-and-refactor-cli/varshaprasad96 branch from d08ae8d to ead1b96 Compare September 8, 2026 18:30

@politerealism politerealism left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated code review (full diff review at high effort). Overall this is a well-executed refactor — the CLI service/settings module extraction, SigV4/provider-native inference logic, and the openshell-router crate removal all check out clean across independent verification passes (including a full dangling-reference sweep across Rust crates, proto, Go/TS/Python SDKs, docs, and skills). One finding below is a real policy/security regression that should be addressed before merge; the rest are minor.

Also flagging (no inline anchor, file fully deleted): e2e/python/test_inference_routing.py was deleted with no Python-side replacement — the new provider-native E2E coverage landed only in e2e/rust/tests/host_gateway_alias.rs. If that's the intended coverage split, worth a one-line note in the PR description; otherwise this is a coverage gap for the 'Docker-backed provider-native inference E2E' checklist item.

binaries: []
credentials: [aws_access_key_id, aws_secret_access_key, aws_session_token]
endpoints:
- host: "bedrock-runtime.*.amazonaws.com"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correctness/security — silently widens egress for existing aws-bedrock attachments.

The old aws-bedrock profile was intentionally non-egress-granting (endpoints: []) for bridge-fronted operators. This change gives it real, enforced Bedrock endpoints with read-write access. Because ProviderTypeProfile is resolved live from the compiled-in catalog rather than pinned per-provider at attach time (see provider_profile_endpoints_are_active in crates/openshell-server/src/grpc/provider.rs, which returns true unconditionally for any builtin profile other than openai/anthropic), any operator with a pre-existing aws-bedrock provider attachment will have their sandboxes' network policy silently widened the moment the gateway upgrades — no re-consent step, and it's not called out in the 'Migration from Managed Inference Routes' doc section.

Could this ship with an explicit migration note (and ideally a policy diff surfaced to the operator on upgrade) rather than a transparent widening?

Comment on lines +2983 to 2987
let (base_url_keys, default_base_url): (&[&str], &str) = match profile.id.as_str() {
"openai" => (&["OPENAI_BASE_URL"], "https://api.openai.com/v1"),
"anthropic" => (&["ANTHROPIC_BASE_URL"], "https://api.anthropic.com"),
_ => return true,
};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor maintainability nit: OPENAI_BASE_URL/ANTHROPIC_BASE_URL and their canonical default URLs are hardcoded here as inline literals rather than sourced from the profile's own YAML definition, and the fallback arm (_ => return true) is exactly what makes the aws-bedrock finding above possible — any builtin profile not explicitly listed here is always treated as 'active'. Worth deriving this from the profile data (or at least adding a comment noting new builtin profiles with real endpoints must be added here) so a future profile with real endpoints doesn't silently bypass this check the same way.

Comment on lines +195 to +204
if let Some(pos) = spec.rfind(':') {
let addr = &spec[..pos];
let port_str = &spec[pos + 1..];
if let Ok(port) = port_str.parse::<u16>() {
if addr.is_empty() {
return Err(miette::miette!("bind address is required before ':'"));
}
return Ok((addr.to_string(), port));
}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

parse_tcp_forward_spec splits on the last : to separate an optional bind address from the port but doesn't strip IPv6 brackets. openshell service forward --local '[::1]:9090' ... yields bind_addr = "[::1]" (brackets included), and TcpListener::bind(("[::1]", 9090)) fails because Rust's (&str, u16) tuple parser doesn't accept bracket-wrapped IPv6 literals — so IPv6 loopback/bind addresses can't be used with this flag today.

Suggested change
if let Some(pos) = spec.rfind(':') {
let addr = &spec[..pos];
let port_str = &spec[pos + 1..];
if let Ok(port) = port_str.parse::<u16>() {
if addr.is_empty() {
return Err(miette::miette!("bind address is required before ':'"));
}
return Ok((addr.to_string(), port));
}
}
if let Some(pos) = spec.rfind(':') {
let addr = &spec[..pos];
let port_str = &spec[pos + 1..];
if let Ok(port) = port_str.parse::<u16>() {
let addr = addr
.strip_prefix('[')
.and_then(|a| a.strip_suffix(']'))
.unwrap_or(addr);
if addr.is_empty() {
return Err(miette::miette!("bind address is required before ':'"));
}
return Ok((addr.to_string(), port));
}
}

@johntmyers

Copy link
Copy Markdown
Collaborator

Please coordinate with maintainers before picking up issues, this is a duplicate of #3195

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: remove managed inference routes in favor of providers v2

3 participants