MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / gateway_inference_get

Function gateway_inference_get

crates/openshell-cli/src/run.rs:5882–5917  ·  view source on GitHub ↗
(
    server: &str,
    route_name: Option<&str>,
    tls: &TlsOptions,
)

Source from the content-addressed store, hash-verified

5880}
5881
5882pub async fn gateway_inference_get(
5883 server: &str,
5884 route_name: Option<&str>,
5885 tls: &TlsOptions,
5886) -> Result<()> {
5887 let mut client = grpc_inference_client(server, tls).await?;
5888
5889 if let Some(name) = route_name {
5890 // Show a single route (--system was specified).
5891 let response = client
5892 .get_cluster_inference(GetClusterInferenceRequest {
5893 route_name: name.to_string(),
5894 })
5895 .await
5896 .into_diagnostic()?;
5897
5898 let configured = response.into_inner();
5899 let label = if name == "sandbox-system" {
5900 "System inference:"
5901 } else {
5902 "Gateway inference:"
5903 };
5904 println!("{}", label.cyan().bold());
5905 println!();
5906 println!(" {} {}", "Provider:".dimmed(), configured.provider_name);
5907 println!(" {} {}", "Model:".dimmed(), configured.model_id);
5908 println!(" {} {}", "Version:".dimmed(), configured.version);
5909 print_timeout(configured.timeout_secs);
5910 } else {
5911 // Show both routes by default.
5912 print_inference_route(&mut client, "Gateway inference", "").await;
5913 println!();
5914 print_inference_route(&mut client, "System inference", "sandbox-system").await;
5915 }
5916 Ok(())
5917}
5918
5919async fn print_inference_route(
5920 client: &mut crate::tls::GrpcInferenceClient,

Callers 1

mainFunction · 0.85

Calls 4

grpc_inference_clientFunction · 0.85
print_timeoutFunction · 0.85
print_inference_routeFunction · 0.85
get_cluster_inferenceMethod · 0.80

Tested by

no test coverage detected