[model-gateway] Replace tokenizer with tokenizer registry for dynamic tokenizer loading in gRPC router (#12968)

This commit is contained in:
Arthur Cheng
2025-12-23 07:58:47 -08:00
committed by GitHub
parent 53f974b973
commit dd620987d1
27 changed files with 793 additions and 155 deletions
+3 -1
View File
@@ -28,6 +28,7 @@ use sgl_model_gateway::{
policies::PolicyRegistry,
routers::RouterFactory,
server::{build_app, AppState},
tokenizer::TokenizerRegistry,
wasm::{
module::{
WasmModuleAddRequest, WasmModuleAddResponse, WasmModuleAttachPoint,
@@ -53,6 +54,7 @@ async fn create_test_context_with_wasm() -> Arc<AppContext> {
// Create AppContext with wasm_manager from the start
let client = reqwest::Client::new();
let tokenizer_registry = Arc::new(TokenizerRegistry::new());
let worker_registry = Arc::new(WorkerRegistry::new());
let policy_registry = Arc::new(PolicyRegistry::new(config.policy.clone()));
@@ -80,7 +82,7 @@ async fn create_test_context_with_wasm() -> Arc<AppContext> {
.router_config(config.clone())
.client(client)
.rate_limiter(None)
.tokenizer(None)
.tokenizer_registry(tokenizer_registry)
.reasoning_parser_factory(None)
.tool_parser_factory(None)
.worker_registry(worker_registry)