From df07aecb0cf9e2566fa94f582f913e5e303559d3 Mon Sep 17 00:00:00 2001 From: biondizzle Date: Thu, 23 Apr 2026 00:44:59 +0000 Subject: [PATCH] actually invoke vllm this time --- vllm_shim_module.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/vllm_shim_module.py b/vllm_shim_module.py index c073219..c440782 100644 --- a/vllm_shim_module.py +++ b/vllm_shim_module.py @@ -267,9 +267,12 @@ def strip_shim_from_pythonpath(): def main(): args = sys.argv[1:] + # Determine which vllm module was actually invoked so we exec the real one + # (could be vllm.entrypoints.cli.main, vllm.entrypoints.openai.api_server, etc.) + invoked_module = __name__ # e.g. "vllm.entrypoints.cli.main" or "vllm.entrypoints.openai.api_server" log("=" * 50) log("vLLM Custom Weights Shim") - log(f" Invoked as: python -m {__name__} {' '.join(args)}") + log(f" Invoked as: python -m {invoked_module} {' '.join(args)}") log("=" * 50) # Intercept --model / positional model if it's a URL @@ -278,8 +281,8 @@ def main(): # Strip our shim from PYTHONPATH so the real vLLM resolves correctly strip_shim_from_pythonpath() - # Build the real vLLM command - vllm_cmd = [sys.executable, "-m", "vllm.entrypoints.openai.api_server"] + modified_args + # Build the real vLLM command using the same module that was invoked + vllm_cmd = [sys.executable, "-m", invoked_module] + modified_args log(f"Launching vLLM: {' '.join(vllm_cmd)}")