@@ -70,6 +70,29 @@ def should_register_model_ignore_weights(config: Config) -> bool:
7070 return uses_modelexpress_load_format (config )
7171
7272
73+ def _register_model_source_path (config : Config , vllm_config : VllmConfig ) -> str :
74+ """Pick the path passed to `register_model` for MDC construction.
75+
76+ When `--model` is an object-storage URI (`s3://...`, `gs://...`, `az://...`),
77+ vLLM's `maybe_pull_model_tokenizer_for_runai` (vllm/config/model.py) pulls
78+ metadata files to a local temp dir and rewrites `vllm_config.model_config`:
79+
80+ - `.model_weights = <original URI>` (used by runai-streamer / mx plugin)
81+ - `.model = <local temp dir>` (contains config.json, tokenizer, …)
82+
83+ Dynamo's `register_model` would otherwise try to resolve the raw URI via
84+ `hub.rs` → ModelExpress, which has no S3 provider and 404s. Returning the
85+ local dir lets `register_model` take its `fs::exists` shortcut.
86+
87+ Temporary vLLM-only workaround until `hub.rs` learns object-storage routing.
88+ Falls back to `config.model` whenever vLLM did not pull (HF id, local path,
89+ or older vLLM without `model_weights`).
90+ """
91+ if getattr (vllm_config .model_config , "model_weights" , "" ):
92+ return vllm_config .model_config .model
93+ return config .model
94+
95+
7396def build_headless_namespace (config : Config ) -> argparse .Namespace :
7497 """Build an argparse Namespace from engine_args for vLLM's run_headless().
7598
@@ -490,14 +513,6 @@ def setup_vllm_engine(
490513 # Prevents deadlock during TP>1 failover.
491514 configure_gms_lock_mode (engine_args )
492515
493- # ModelExpress uses vLLM's plugin path with --load-format=modelexpress.
494- # Dynamo does not register loaders or set a custom worker class here.
495-
496- # Load default sampling params from `generation_config.json`
497- default_sampling_params = (
498- engine_args .create_model_config ().get_diff_sampling_param ()
499- )
500-
501516 # Configure ec_both mode with DynamoMultimodalEmbeddingCacheConnector.
502517 # Must happen BEFORE engine setup so vLLM sees ec_transfer_config.
503518 if (
@@ -527,6 +542,7 @@ def setup_vllm_engine(
527542 # Taken from build_async_engine_client_from_engine_args()
528543 usage_context = UsageContext .OPENAI_API_SERVER
529544 vllm_config = engine_args .create_engine_config (usage_context = usage_context )
545+ default_sampling_params = vllm_config .model_config .get_diff_sampling_param ()
530546
531547 # Set up consolidator endpoints if KVBM (DynamoConnector) is enabled
532548 consolidator_endpoints = None
@@ -680,7 +696,7 @@ async def register_vllm_model(
680696 model_input ,
681697 model_type ,
682698 generate_endpoint ,
683- config . model ,
699+ _register_model_source_path ( config , vllm_config ) ,
684700 config .served_model_name ,
685701 context_length = vllm_config .model_config .max_model_len ,
686702 kv_cache_block_size = runtime_values ["kv_event_block_size" ],
0 commit comments