From 95bfaff6dd9711da01447af4f1ef75347e4cacf3 Mon Sep 17 00:00:00 2001 From: Simo Lin Date: Wed, 25 Feb 2026 00:56:47 -0800 Subject: [PATCH 1/3] Revert "feat: add --served-model-name support for model aliasing (#521)" This reverts commit ae1f82edf81302e7a487fa06878027fb2fcee598. The --served-model-name feature should be implemented upstream in TensorRT-LLM rather than worked around in the gateway. A proper upstream implementation allows the served name to flow through both gRPC and HTTP server paths natively. Signed-off-by: Simo Lin --- bindings/python/src/lib.rs | 5 -- bindings/python/src/smg/router_args.py | 13 --- model_gateway/src/config/builder.rs | 11 --- model_gateway/src/config/types.rs | 4 - .../core/steps/worker/local/create_worker.rs | 25 +----- .../worker/local/submit_tokenizer_job.rs | 52 ++++++----- model_gateway/src/core/worker.rs | 10 --- model_gateway/src/core/worker_registry.rs | 90 ++++++++----------- model_gateway/src/main.rs | 5 -- .../routers/grpc/common/responses/utils.rs | 7 +- 10 files changed, 67 insertions(+), 155 deletions(-) diff --git a/bindings/python/src/lib.rs b/bindings/python/src/lib.rs index a82d5f0058..01e5aadc95 100644 --- a/bindings/python/src/lib.rs +++ b/bindings/python/src/lib.rs @@ -428,7 +428,6 @@ struct Router { model_path: Option, tokenizer_path: Option, chat_template: Option, - served_model_name: Option, tokenizer_cache_enable_l0: bool, tokenizer_cache_l0_max_entries: usize, tokenizer_cache_enable_l1: bool, @@ -658,7 +657,6 @@ impl Router { .maybe_model_path(self.model_path.as_ref()) .maybe_tokenizer_path(self.tokenizer_path.as_ref()) .maybe_chat_template(self.chat_template.as_ref()) - .maybe_served_model_name(self.served_model_name.as_ref()) .maybe_oracle(oracle) .maybe_postgres(postgres_config) .maybe_redis(redis_config) @@ -751,7 +749,6 @@ impl Router { model_path = None, tokenizer_path = None, chat_template = None, - served_model_name = None, tokenizer_cache_enable_l0 = false, tokenizer_cache_l0_max_entries = 10000, tokenizer_cache_enable_l1 = false, @@ -844,7 +841,6 @@ impl Router { model_path: Option, tokenizer_path: Option, chat_template: Option, - served_model_name: Option, tokenizer_cache_enable_l0: bool, tokenizer_cache_l0_max_entries: usize, tokenizer_cache_enable_l1: bool, @@ -947,7 +943,6 @@ impl Router { model_path, tokenizer_path, chat_template, - served_model_name, tokenizer_cache_enable_l0, tokenizer_cache_l0_max_entries, tokenizer_cache_enable_l1, diff --git a/bindings/python/src/smg/router_args.py b/bindings/python/src/smg/router_args.py index 6cf210964e..75b5c10fc3 100644 --- a/bindings/python/src/smg/router_args.py +++ b/bindings/python/src/smg/router_args.py @@ -97,8 +97,6 @@ class RouterArgs: model_path: str | None = None tokenizer_path: str | None = None chat_template: str | None = None - # Override/alias the model name exposed to clients (while backend loads from model_path) - served_model_name: str | None = None # Tokenizer cache configuration tokenizer_cache_enable_l0: bool = False tokenizer_cache_l0_max_entries: int = 10000 @@ -686,17 +684,6 @@ def add_cli_args( default=None, help="Chat template path (optional)", ) - tokenizer_group.add_argument( - f"--{prefix}served-model-name", - type=str, - default=None, - help=( - "Override the model name exposed to clients. When set, requests using this " - "name are routed to the worker even though the backend was loaded from " - "model_path. Both the original name (from backend discovery) and this alias " - "will be accepted." - ), - ) tokenizer_group.add_argument( f"--{prefix}tokenizer-cache-enable-l0", action="store_true", diff --git a/model_gateway/src/config/builder.rs b/model_gateway/src/config/builder.rs index 4e5adf73d6..bddd91fda2 100644 --- a/model_gateway/src/config/builder.rs +++ b/model_gateway/src/config/builder.rs @@ -531,17 +531,6 @@ impl RouterConfigBuilder { self } - pub fn served_model_name>(mut self, name: S) -> Self { - self.config.served_model_name = Some(name.into()); - self - } - - /// Set served_model_name if Some, clear if None. - pub fn maybe_served_model_name(mut self, name: Option>) -> Self { - self.config.served_model_name = name.map(|n| n.into()); - self - } - pub fn maybe_oracle(mut self, oracle: Option) -> Self { if let Some(cfg) = oracle { self.config.history_backend = HistoryBackend::Oracle; diff --git a/model_gateway/src/config/types.rs b/model_gateway/src/config/types.rs index 90e5afd7c2..55164dace7 100644 --- a/model_gateway/src/config/types.rs +++ b/model_gateway/src/config/types.rs @@ -52,9 +52,6 @@ pub struct RouterConfig { /// Overrides model_path tokenizer if provided pub tokenizer_path: Option, pub chat_template: Option, - /// Client-facing model name override; both this and the backend-reported name are accepted. - #[serde(default, skip_serializing_if = "Option::is_none")] - pub served_model_name: Option, #[serde(default = "default_history_backend")] pub history_backend: HistoryBackend, /// Required when history_backend = "oracle" @@ -531,7 +528,6 @@ impl Default for RouterConfig { model_path: None, tokenizer_path: None, chat_template: None, - served_model_name: None, history_backend: default_history_backend(), oracle: None, postgres: None, diff --git a/model_gateway/src/core/steps/worker/local/create_worker.rs b/model_gateway/src/core/steps/worker/local/create_worker.rs index 80782e8ddd..dbd9f0d028 100644 --- a/model_gateway/src/core/steps/worker/local/create_worker.rs +++ b/model_gateway/src/core/steps/worker/local/create_worker.rs @@ -54,9 +54,8 @@ impl StepExecutor for CreateLocalWorkerStep { let kv_connector = labels.remove("kv_connector"); let kv_role = labels.remove("kv_role"); - // Determine backend-reported model_id: - // config.models > discovered labels["served_model_name"] > labels["model_id"] > labels["model_path"] - let backend_model_id = config + // Determine model_id: config.models > discovered labels > UNKNOWN_MODEL_ID + let model_id = config .models .primary() .map(|m| m.id.clone()) @@ -65,25 +64,7 @@ impl StepExecutor for CreateLocalWorkerStep { .or_else(|| labels.get("model_path").cloned()) .unwrap_or_else(|| UNKNOWN_MODEL_ID.to_string()); - // Build the card from backend_model_id so any user-configured metadata - // (context_length, tokenizer_path, model_type, …) keyed by the backend ID is preserved. - let mut model_card = build_model_card(&backend_model_id, config, &labels); - - // Apply router-level served_model_name: rename the card's primary ID and keep - // the backend-reported name as an alias so both names continue to work. - // Skip aliasing UNKNOWN_MODEL_ID to avoid a meaningless "unknown" alias. - match app_context.router_config.served_model_name.as_deref() { - Some(sname) - if !sname.is_empty() - && sname != backend_model_id - && backend_model_id != UNKNOWN_MODEL_ID => - { - model_card.aliases.push(backend_model_id); - model_card.aliases.retain(|a| a != sname); - model_card.id = sname.to_string(); - } - _ => {} - }; + let model_card = build_model_card(&model_id, config, &labels); let runtime_type = match context.data.detected_runtime_type.as_deref() { Some(s) => s.parse::().unwrap_or(config.runtime_type), diff --git a/model_gateway/src/core/steps/worker/local/submit_tokenizer_job.rs b/model_gateway/src/core/steps/worker/local/submit_tokenizer_job.rs index 0495899110..4e6dc2e757 100644 --- a/model_gateway/src/core/steps/worker/local/submit_tokenizer_job.rs +++ b/model_gateway/src/core/steps/worker/local/submit_tokenizer_job.rs @@ -63,9 +63,6 @@ impl StepExecutor for SubmitTokenizerJobStep { for worker in workers { let model_id = worker.model_id().to_string(); - // Register tokenizer under primary name and all aliases. - let all_names = worker.model_names(); - // Get tokenizer path with fallback chain: // 1. Worker labels: tokenizer_path // 2. Worker labels: model_path @@ -99,31 +96,32 @@ impl StepExecutor for SubmitTokenizerJobStep { // The registry.load() handles deduplication gracefully (returns AlreadyExists). // This simplifies the code and ensures consistent behavior. - for name in all_names { - info!( - "Submitting tokenizer registration job for model '{}' (source: {})", - name, tokenizer_path - ); - - // Create tokenizer config request - let config = TokenizerConfigRequest { - id: TokenizerRegistry::generate_id(), - name: name.clone(), - source: tokenizer_path.clone(), - chat_template_path: chat_template.clone(), - cache_config: cache_config.clone(), - fail_on_duplicate: false, - }; + info!( + "Submitting tokenizer registration job for model {} from {}", + model_id, tokenizer_path + ); + + // Create tokenizer config request + let config = TokenizerConfigRequest { + id: TokenizerRegistry::generate_id(), + name: model_id.clone(), + source: tokenizer_path, + chat_template_path: chat_template.clone(), + cache_config: cache_config.clone(), + fail_on_duplicate: false, + }; - // Submit job (fire-and-forget, don't wait for completion) - if let Err(e) = job_queue - .submit(Job::AddTokenizer { - config: Box::new(config), - }) - .await - { - warn!("Failed to submit tokenizer job for model '{}': {}", name, e); - } + // Submit job (fire-and-forget, don't wait for completion) + if let Err(e) = job_queue + .submit(Job::AddTokenizer { + config: Box::new(config), + }) + .await + { + warn!( + "Failed to submit tokenizer job for model {}: {}", + model_id, e + ); } } diff --git a/model_gateway/src/core/worker.rs b/model_gateway/src/core/worker.rs index d6b500fbb7..e790ba04ab 100644 --- a/model_gateway/src/core/worker.rs +++ b/model_gateway/src/core/worker.rs @@ -256,16 +256,6 @@ pub trait Worker: Send + Sync + fmt::Debug { .unwrap_or(UNKNOWN_MODEL_ID) } - /// All names (primary model ID + aliases) this worker should be indexed/registered under. - fn model_names(&self) -> std::collections::HashSet { - let primary = self.model_id().to_string(); - let mut names = std::collections::HashSet::from([primary.clone()]); - if let Some(card) = self.metadata().spec.models.primary() { - names.extend(card.aliases.iter().cloned()); - } - names - } - /// Get the priority of this worker (higher value = higher priority) fn priority(&self) -> u32 { self.metadata().spec.priority diff --git a/model_gateway/src/core/worker_registry.rs b/model_gateway/src/core/worker_registry.rs index f57dd2b83e..298bf43621 100644 --- a/model_gateway/src/core/worker_registry.rs +++ b/model_gateway/src/core/worker_registry.rs @@ -261,20 +261,19 @@ impl WorkerRegistry { // Update model index for O(1) lookups using copy-on-write // This creates a new immutable snapshot with the added worker - // Index primary model ID + all aliases for O(1) lookup by any name. - let all_names = worker.model_names(); - - for name in &all_names { - self.model_index - .entry(name.clone()) - .and_modify(|existing| { - let mut new_workers: Vec> = existing.iter().cloned().collect(); - new_workers.push(worker.clone()); - *existing = Arc::from(new_workers.into_boxed_slice()); - }) - .or_insert_with(|| Arc::from(vec![worker.clone()].into_boxed_slice())); - self.rebuild_hash_ring(name); - } + let model_id = worker.model_id().to_string(); + self.model_index + .entry(model_id.clone()) + .and_modify(|existing| { + // Create new snapshot with the additional worker + let mut new_workers: Vec> = existing.iter().cloned().collect(); + new_workers.push(worker.clone()); + *existing = Arc::from(new_workers.into_boxed_slice()); + }) + .or_insert_with(|| Arc::from(vec![worker.clone()].into_boxed_slice())); + + // Rebuild hash ring for this model + self.rebuild_hash_ring(&model_id); // Update type index (clone needed for DashMap key ownership) self.type_workers @@ -330,31 +329,19 @@ impl WorkerRegistry { // Remove from model index using copy-on-write // Create new snapshot without the removed worker let worker_url = worker.url(); - - // Clean up primary model ID + all aliases from model_index. - let all_names = worker.model_names(); - - for name in &all_names { - let mut remove_entry = false; - if let Some(mut entry) = self.model_index.get_mut(name) { - let new_workers: Vec> = entry - .iter() - .filter(|w| w.url() != worker_url) - .cloned() - .collect(); - if new_workers.is_empty() { - remove_entry = true; - } else { - *entry = Arc::from(new_workers.into_boxed_slice()); - } - } - if remove_entry { - self.model_index.remove(name); - } - // Rebuild hash ring for each name - self.rebuild_hash_ring(name); + let model_id = worker.model_id().to_string(); + if let Some(mut entry) = self.model_index.get_mut(&model_id) { + let new_workers: Vec> = entry + .iter() + .filter(|w| w.url() != worker_url) + .cloned() + .collect(); + *entry = Arc::from(new_workers.into_boxed_slice()); } + // Rebuild hash ring for this model + self.rebuild_hash_ring(&model_id); + // Remove from type index if let Some(mut type_workers) = self.type_workers.get_mut(worker.worker_type()) { type_workers.retain(|id| id != worker_id); @@ -519,15 +506,13 @@ impl WorkerRegistry { .collect() } - /// Get primary model IDs with workers (lock-free). - /// Returns only the canonical model ID for each worker (not aliases), so the - /// list matches what clients should see on `/v1/models`. + /// Get all model IDs with workers (lock-free) pub fn get_models(&self) -> Vec { - let mut seen = std::collections::HashSet::new(); - self.workers.iter().for_each(|entry| { - seen.insert(entry.value().model_id().to_string()); - }); - seen.into_iter().collect() + self.model_index + .iter() + .filter(|entry| !entry.value().is_empty()) + .map(|entry| entry.key().clone()) + .collect() } /// Get workers filtered by multiple criteria @@ -592,15 +577,12 @@ impl WorkerRegistry { /// Get worker statistics (lock-free) pub fn stats(&self) -> WorkerRegistryStats { let total_workers = self.workers.len(); - // Count distinct primary model IDs (not aliases) so metrics reflect - // the number of unique models served to clients, not index entries. - let total_models = { - let mut seen = std::collections::HashSet::new(); - self.workers.iter().for_each(|entry| { - seen.insert(entry.value().model_id().to_string()); - }); - seen.len() - }; + // Count models directly instead of allocating Vec via get_models() (lock-free) + let total_models = self + .model_index + .iter() + .filter(|entry| !entry.value().is_empty()) + .count(); let mut healthy_count = 0; let mut total_load = 0; diff --git a/model_gateway/src/main.rs b/model_gateway/src/main.rs index af321e0802..747872a071 100644 --- a/model_gateway/src/main.rs +++ b/model_gateway/src/main.rs @@ -399,10 +399,6 @@ struct CliArgs { #[arg(long, help_heading = "Tokenizer")] chat_template: Option, - /// Client-facing model name override; both this and the backend-reported name are accepted. - #[arg(long, help_heading = "Tokenizer")] - served_model_name: Option, - /// Enable L0 (exact match) tokenizer cache #[arg(long, default_value_t = false, help_heading = "Tokenizer")] tokenizer_cache_enable_l0: bool, @@ -1066,7 +1062,6 @@ impl CliArgs { .maybe_model_path(self.model_path.as_ref()) .maybe_tokenizer_path(self.tokenizer_path.as_ref()) .maybe_chat_template(self.chat_template.as_ref()) - .maybe_served_model_name(self.served_model_name.as_ref()) .maybe_oracle(oracle) .maybe_postgres(postgres) .maybe_redis(redis) diff --git a/model_gateway/src/routers/grpc/common/responses/utils.rs b/model_gateway/src/routers/grpc/common/responses/utils.rs index a3fccdf85b..df4ffa81dc 100644 --- a/model_gateway/src/routers/grpc/common/responses/utils.rs +++ b/model_gateway/src/routers/grpc/common/responses/utils.rs @@ -88,10 +88,9 @@ pub(crate) fn validate_worker_availability( worker_registry: &Arc, model: &str, ) -> Option { - // Use model_index directly so aliases are accepted as valid routing targets, - // while get_models() (client-facing) only exposes primary model IDs. - if worker_registry.get_by_model(model).is_empty() { - let available_models = worker_registry.get_models(); + let available_models = worker_registry.get_models(); + + if !available_models.contains(&model.to_string()) { return Some(error::service_unavailable( "no_available_workers", format!( From 2def7aa430bb7ab350b12f6b355f60d9af1641f4 Mon Sep 17 00:00:00 2001 From: Simo Lin Date: Wed, 25 Feb 2026 00:58:49 -0800 Subject: [PATCH 2/3] fix: unify --model and --model-path CLI args for trtllm tokenizer registration Three related fixes for TensorRT-LLM backend support: 1. Unify --model and --model-path: trtllm uses --model while sglang uses --model-path, but both refer to the same thing. Map trtllm's --model to dest=model_path so it populates the same namespace key as sglang, allowing RouterArgs.from_cli_args to find it via the standard fallback. 2. Fix from_cli_args prefix fallback: when use_router_prefix=True, the prefixed key (e.g. router_model_path) always exists in the namespace with default=None, which blocked the fallback to the unprefixed key (model_path) even when the user didn't pass --router-model-path. Now only prefer the prefixed version when it is explicitly set. 3. Add --model as alias for --model-path in the Rust CLI (smg launch) and Python RouterArgs for consistency across backends. Signed-off-by: Simo Lin --- bindings/python/src/smg/router_args.py | 12 +++++++++--- bindings/python/src/smg/serve.py | 14 +++++++++++--- model_gateway/src/main.rs | 2 +- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/bindings/python/src/smg/router_args.py b/bindings/python/src/smg/router_args.py index 75b5c10fc3..0e6ef5fa30 100644 --- a/bindings/python/src/smg/router_args.py +++ b/bindings/python/src/smg/router_args.py @@ -668,6 +668,7 @@ def add_cli_args( # Tokenizer configuration tokenizer_group.add_argument( f"--{prefix}model-path", + f"--{prefix}model", type=str, default=None, help="Model path for loading tokenizer (HuggingFace model ID or local path)", @@ -975,9 +976,14 @@ def from_cli_args(cls, args: argparse.Namespace, use_router_prefix: bool = False args_dict = {} for attr in dataclasses.fields(cls): - # Auto strip prefix from args - if f"{prefix}{attr.name}" in cli_args_dict: - args_dict[attr.name] = cli_args_dict[f"{prefix}{attr.name}"] + # Auto strip prefix from args. + # Prefer the prefixed version (e.g. --router-model-path) when + # explicitly set, but fall back to the unprefixed version + # (e.g. --model-path from the backend) when the prefixed key + # exists but is None (argparse default). + prefixed_key = f"{prefix}{attr.name}" + if prefixed_key in cli_args_dict and cli_args_dict[prefixed_key] is not None: + args_dict[attr.name] = cli_args_dict[prefixed_key] elif attr.name in cli_args_dict: args_dict[attr.name] = cli_args_dict[attr.name] diff --git a/bindings/python/src/smg/serve.py b/bindings/python/src/smg/serve.py index 1f64c42a34..03febb269f 100644 --- a/bindings/python/src/smg/serve.py +++ b/bindings/python/src/smg/serve.py @@ -223,7 +223,7 @@ def build_command( sys.executable, "-m", "tensorrt_llm.commands.serve", - getattr(args, "model", ""), + getattr(args, "model_path", ""), "--grpc", "--host", host, @@ -232,7 +232,9 @@ def build_command( ] # Add optional config file - cmd.extend(self._filter_backend_args(backend_args, ["--model", "--host", "--port"])) + cmd.extend( + self._filter_backend_args(backend_args, ["--model", "--model-path", "--host", "--port"]) + ) return cmd @@ -372,7 +374,13 @@ def _add_trtllm_stub_args(parser: argparse.ArgumentParser) -> None: TP size is read from the config file, not passed as CLI argument. """ group = parser.add_argument_group("TensorRT-LLM Options") - group.add_argument("--model", type=str, help="Model path (HuggingFace ID or local path)") + group.add_argument( + "--model", + "--model-path", + dest="model_path", + type=str, + help="Model path (HuggingFace ID or local path)", + ) group.add_argument("--tp_size", type=int, help="Tensor parallel size (overrides config file)") diff --git a/model_gateway/src/main.rs b/model_gateway/src/main.rs index 747872a071..af1eea1e3a 100644 --- a/model_gateway/src/main.rs +++ b/model_gateway/src/main.rs @@ -388,7 +388,7 @@ struct CliArgs { // ==================== Tokenizer ==================== /// Model path for loading tokenizer (HuggingFace ID or local path) - #[arg(long, help_heading = "Tokenizer")] + #[arg(long, alias = "model", help_heading = "Tokenizer")] model_path: Option, /// Explicit tokenizer path (overrides model_path) From 74606eee05adfa6c4a1b9d3d03124e0fab82c302 Mon Sep 17 00:00:00 2001 From: Simo Lin Date: Wed, 25 Feb 2026 09:01:53 -0800 Subject: [PATCH 3/3] fix: normalize trtllm backend args from hyphens to underscores TRT-LLM Click options use underscores (e.g. --tensor_parallel_size) while SGLang/vLLM use hyphens. Normalize backend args passed to TRT-LLM so users can use either form consistently across backends. Signed-off-by: Simo Lin --- bindings/python/src/smg/serve.py | 7 ++++++- bindings/python/tests/test_serve.py | 16 ++++++++-------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/bindings/python/src/smg/serve.py b/bindings/python/src/smg/serve.py index 03febb269f..a721c472c9 100644 --- a/bindings/python/src/smg/serve.py +++ b/bindings/python/src/smg/serve.py @@ -232,8 +232,13 @@ def build_command( ] # Add optional config file + # TRT-LLM Click options use underscores (e.g. --tensor_parallel_size) + # while SGLang/vLLM use hyphens. Normalize so users can pass either form. + normalized = [ + "--" + a[2:].replace("-", "_") if a.startswith("--") else a for a in backend_args + ] cmd.extend( - self._filter_backend_args(backend_args, ["--model", "--model-path", "--host", "--port"]) + self._filter_backend_args(normalized, ["--model", "--model_path", "--host", "--port"]) ) return cmd diff --git a/bindings/python/tests/test_serve.py b/bindings/python/tests/test_serve.py index ee4e3db08e..a9c455f2bf 100644 --- a/bindings/python/tests/test_serve.py +++ b/bindings/python/tests/test_serve.py @@ -173,7 +173,7 @@ def test_trtllm_adds_model_arg(self): args, backend_args = parser.parse_known_args( ["--model", "/path/to/model", "--config", "/path/to/config.yml"] ) - assert args.model == "/path/to/model" + assert args.model_path == "/path/to/model" assert "--config" in backend_args assert "/path/to/config.yml" in backend_args @@ -199,13 +199,13 @@ def test_adds_model_arg(self): parser = argparse.ArgumentParser() _add_trtllm_stub_args(parser) args = parser.parse_args(["--model", "/tmp/model"]) - assert args.model == "/tmp/model" + assert args.model_path == "/tmp/model" def test_model_default_is_none(self): parser = argparse.ArgumentParser() _add_trtllm_stub_args(parser) args = parser.parse_args([]) - assert args.model is None + assert args.model_path is None class TestParseServeArgs: @@ -217,7 +217,7 @@ def test_trtllm_basic(self): ) assert backend == "trtllm" assert args.backend == "trtllm" - assert args.model == "/tmp/m" + assert args.model_path == "/tmp/m" assert "--config" in backend_args # config should be in backend_args assert "/tmp/config.yml" in backend_args @@ -314,7 +314,7 @@ def test_two_pass_extracts_backend_first(self): ] ) assert backend == "trtllm" - assert args.model == "/some/path" + assert args.model_path == "/some/path" def test_unknown_arg_rejected_in_pass2(self): """Unknown args should be rejected by the full parser in pass 2.""" @@ -533,7 +533,7 @@ def test_health_check_delegates_to_grpc(self): def test_build_command_http_mode(self): """When connection_mode is http, --grpc-mode should not be present.""" launcher = VllmWorkerLauncher() - args = argparse.Namespace(model="/tmp/model", connection_mode="http") + args = argparse.Namespace(model_path="/tmp/model", connection_mode="http") backend_args = ["--trust-remote-code"] cmd = launcher.build_command(args, backend_args, "127.0.0.1", 31000) assert "vllm.entrypoints.openai.api_server" in cmd @@ -563,7 +563,7 @@ class TestTrtllmWorkerLauncher: def test_build_command(self): launcher = TrtllmWorkerLauncher() - args = argparse.Namespace(model="/tmp/model", connection_mode="grpc") + args = argparse.Namespace(model_path="/tmp/model", connection_mode="grpc") backend_args = ["--config", "/tmp/config.yml"] cmd = launcher.build_command(args, backend_args, "0.0.0.0", 50051) assert "tensorrt_llm.commands.serve" in cmd @@ -578,7 +578,7 @@ def test_build_command(self): def test_build_command_rejects_http_mode(self): launcher = TrtllmWorkerLauncher() - args = argparse.Namespace(model="/tmp/model", connection_mode="http") + args = argparse.Namespace(model_path="/tmp/model", connection_mode="http") backend_args = ["--config", "/tmp/config.yml"] with pytest.raises(ValueError, match="TensorRT-LLM backend only supports grpc"): launcher.build_command(args, backend_args, "0.0.0.0", 50051)