[router] add get server info and get model info in grpc server (#11303)
This commit is contained in:
@@ -97,6 +97,30 @@ impl SglangSchedulerClient {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Get model information
|
||||
pub async fn get_model_info(
|
||||
&mut self,
|
||||
) -> Result<proto::GetModelInfoResponse, Box<dyn std::error::Error + Send + Sync>> {
|
||||
debug!("Requesting model info");
|
||||
let request = Request::new(proto::GetModelInfoRequest {});
|
||||
|
||||
let response = self.client.get_model_info(request).await?;
|
||||
debug!("Model info response received");
|
||||
Ok(response.into_inner())
|
||||
}
|
||||
|
||||
/// Get server information
|
||||
pub async fn get_server_info(
|
||||
&mut self,
|
||||
) -> Result<proto::GetServerInfoResponse, Box<dyn std::error::Error + Send + Sync>> {
|
||||
debug!("Requesting server info");
|
||||
let request = Request::new(proto::GetServerInfoRequest {});
|
||||
|
||||
let response = self.client.get_server_info(request).await?;
|
||||
debug!("Server info response received");
|
||||
Ok(response.into_inner())
|
||||
}
|
||||
|
||||
/// Build a single SGLang GenerateRequest from OpenAI ChatCompletionRequest
|
||||
pub fn build_generate_request(
|
||||
&self,
|
||||
|
||||
Reference in New Issue
Block a user