mirror of
https://github.com/NVIDIA/OpenShell.git
synced 2026-10-16 05:20:22 +08:00
Closes #273 Verify inference endpoints synchronously on the server during set/update, expose a --no-verify escape hatch in the CLI and Python helper, and return actionable failures when validation does not pass.
115 lines
3.6 KiB
Protocol Buffer
115 lines
3.6 KiB
Protocol Buffer
// SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
syntax = "proto3";
|
|
|
|
package openshell.inference.v1;
|
|
|
|
option java_multiple_files = true;
|
|
option java_package = "com.anthropic.openshell.inference.v1";
|
|
|
|
// Inference service provides cluster inference configuration and bundle delivery.
|
|
service Inference {
|
|
// Return the resolved inference route bundle for sandbox-local execution.
|
|
rpc GetInferenceBundle(GetInferenceBundleRequest)
|
|
returns (GetInferenceBundleResponse);
|
|
|
|
// Set cluster-level inference configuration.
|
|
//
|
|
// This controls how requests sent to `inference.local` are routed.
|
|
rpc SetClusterInference(SetClusterInferenceRequest)
|
|
returns (SetClusterInferenceResponse);
|
|
|
|
// Get cluster-level inference configuration.
|
|
rpc GetClusterInference(GetClusterInferenceRequest)
|
|
returns (GetClusterInferenceResponse);
|
|
|
|
}
|
|
|
|
// Persisted cluster inference configuration.
|
|
//
|
|
// Only `provider_name` and `model_id` are stored; endpoint, protocols,
|
|
// credentials, and auth style are resolved from the provider at bundle time.
|
|
message ClusterInferenceConfig {
|
|
// Provider record name backing this route.
|
|
string provider_name = 1;
|
|
// Model identifier to force on generation calls.
|
|
string model_id = 2;
|
|
}
|
|
|
|
// Storage envelope for the managed cluster inference route.
|
|
message InferenceRoute {
|
|
string id = 1;
|
|
ClusterInferenceConfig config = 2;
|
|
// Object name ("inference.local" for the user-facing route,
|
|
// "sandbox-system" for the sandbox system-level route).
|
|
string name = 3;
|
|
// Monotonic version incremented on every update.
|
|
uint64 version = 4;
|
|
}
|
|
|
|
message SetClusterInferenceRequest {
|
|
// Provider record name to use for credentials + endpoint mapping.
|
|
string provider_name = 1;
|
|
// Model identifier to force on generation calls.
|
|
string model_id = 2;
|
|
// Route name to target. Empty string defaults to "inference.local" (user-facing).
|
|
// Use "sandbox-system" for the sandbox system-level inference route.
|
|
string route_name = 3;
|
|
// Verify the resolved upstream endpoint synchronously before persistence.
|
|
bool verify = 4;
|
|
// Skip synchronous endpoint validation before persistence.
|
|
bool no_verify = 5;
|
|
}
|
|
|
|
message ValidatedEndpoint {
|
|
string url = 1;
|
|
string protocol = 2;
|
|
}
|
|
|
|
message SetClusterInferenceResponse {
|
|
string provider_name = 1;
|
|
string model_id = 2;
|
|
uint64 version = 3;
|
|
// Route name that was configured.
|
|
string route_name = 4;
|
|
// Whether endpoint verification ran as part of this request.
|
|
bool validation_performed = 5;
|
|
// The concrete endpoints that were probed during validation, when available.
|
|
repeated ValidatedEndpoint validated_endpoints = 6;
|
|
}
|
|
|
|
message GetClusterInferenceRequest {
|
|
// Route name to query. Empty string defaults to "inference.local" (user-facing).
|
|
// Use "sandbox-system" for the sandbox system-level inference route.
|
|
string route_name = 1;
|
|
}
|
|
|
|
message GetClusterInferenceResponse {
|
|
string provider_name = 1;
|
|
string model_id = 2;
|
|
uint64 version = 3;
|
|
// Route name that was queried.
|
|
string route_name = 4;
|
|
}
|
|
|
|
message GetInferenceBundleRequest {}
|
|
|
|
// A single resolved route ready for sandbox-local execution.
|
|
message ResolvedRoute {
|
|
string name = 1;
|
|
string base_url = 2;
|
|
repeated string protocols = 3;
|
|
string api_key = 4;
|
|
string model_id = 5;
|
|
string provider_type = 6;
|
|
}
|
|
|
|
message GetInferenceBundleResponse {
|
|
repeated ResolvedRoute routes = 1;
|
|
// Opaque revision tag for cache freshness checks.
|
|
string revision = 2;
|
|
// Timestamp (epoch ms) when this bundle was generated.
|
|
int64 generated_at_ms = 3;
|
|
}
|