[model-gateway] change rust package name to sgl-model-gateway instead (#14283)

This commit is contained in:
Simo Lin
2025-12-02 00:06:54 -08:00
committed by GitHub
parent 64092c8b55
commit 51a86ce69e
56 changed files with 167 additions and 160 deletions
+1 -1
View File
@@ -90,7 +90,7 @@ impl std::fmt::Display for ProviderType {
/// # Example
///
/// ```
/// use sglang_router_rs::core::{ModelCard, ModelType, ProviderType};
/// use sgl_model_gateway::core::{ModelCard, ModelType, ProviderType};
///
/// let card = ModelCard::new("meta-llama/Llama-3.1-8B-Instruct")
/// .with_display_name("Llama 3.1 8B Instruct")
+2 -2
View File
@@ -28,7 +28,7 @@ impl Default for LoggingConfig {
log_dir: None,
colorize: true,
log_file_name: "sgl-router".to_string(),
log_targets: Some(vec!["sglang_router_rs".to_string()]),
log_targets: Some(vec!["sgl_model_gateway".to_string()]),
}
}
}
@@ -63,7 +63,7 @@ pub fn init_logging(config: LoggingConfig) -> LogGuard {
})
.collect::<String>()
} else {
format!("sglang_router_rs={}", level_filter)
format!("sgl_model_gateway={}", level_filter)
};
EnvFilter::new(filter_string)
+1 -1
View File
@@ -1,7 +1,7 @@
use std::collections::HashMap;
use clap::{ArgAction, Parser, Subcommand, ValueEnum};
use sglang_router_rs::{
use sgl_model_gateway::{
config::{
CircuitBreakerConfig, ConfigError, ConfigResult, DiscoveryConfig, HealthCheckConfig,
HistoryBackend, MetricsConfig, OracleConfig, PolicyConfig, PostgresConfig, RetryConfig,
+7 -7
View File
@@ -222,7 +222,7 @@ impl<B> OnRequest<B> for RequestLogger {
// Log the request start
info!(
target: "sglang_router_rs::request",
target: "sgl_model_gateway::request",
"started processing request"
);
}
@@ -254,17 +254,17 @@ impl<B> OnResponse<B> for ResponseLogger {
let _enter = span.enter();
if status.is_server_error() {
error!(
target: "sglang_router_rs::response",
target: "sgl_model_gateway::response",
"request failed with server error"
);
} else if status.is_client_error() {
warn!(
target: "sglang_router_rs::response",
target: "sgl_model_gateway::response",
"request failed with client error"
);
} else {
info!(
target: "sglang_router_rs::response",
target: "sgl_model_gateway::response",
"finished processing request"
);
}
@@ -303,7 +303,7 @@ pub struct RequestLogEntry {
pub fn log_request(entry: RequestLogEntry) {
if entry.status >= 500 {
tracing::error!(
target: "sglang_router_rs::http",
target: "sgl_model_gateway::http",
request_id = %entry.request_id,
method = %entry.method,
uri = %entry.uri,
@@ -316,7 +316,7 @@ pub fn log_request(entry: RequestLogEntry) {
);
} else if entry.status >= 400 {
tracing::warn!(
target: "sglang_router_rs::http",
target: "sgl_model_gateway::http",
request_id = %entry.request_id,
method = %entry.method,
uri = %entry.uri,
@@ -328,7 +328,7 @@ pub fn log_request(entry: RequestLogEntry) {
);
} else {
tracing::info!(
target: "sglang_router_rs::http",
target: "sgl_model_gateway::http",
request_id = %entry.request_id,
method = %entry.method,
uri = %entry.uri,
+1 -1
View File
@@ -18,7 +18,7 @@
//! ## Usage
//!
//! ```ignore
//! use sglang_router_rs::routers::grpc::harmony::{HarmonyDetector, HarmonyBuilder};
//! use sgl_model_gateway::routers::grpc::harmony::{HarmonyDetector, HarmonyBuilder};
//!
//! // Detect if model supports Harmony
//! if HarmonyDetector::is_harmony_model("gpt-4o") {
+2 -2
View File
@@ -138,7 +138,7 @@ as of `sgl-router/src/tokenizer/*`.
## Usage Examples
```rust
use std::sync::Arc;
use sglang_router_rs::tokenizer::{
use sgl_model_gateway::tokenizer::{
create_tokenizer, SequenceDecoderOutput, StopSequenceDecoderBuilder, Tokenizer,
};
@@ -172,7 +172,7 @@ for &token in encoding.token_ids() {
```rust
// Apply a chat template when one is bundled with the tokenizer
use sglang_router_rs::tokenizer::{chat_template::ChatTemplateParams, HuggingFaceTokenizer};
use sgl_model_gateway::tokenizer::{chat_template::ChatTemplateParams, HuggingFaceTokenizer};
let mut hf = HuggingFaceTokenizer::from_file_with_chat_template(
"./tokenizer.json",