diff --git a/litellm/llms/vllm/common_utils.py b/litellm/llms/vllm/common_utils.py index 2da2269e1f9..f663ec7870a 100644 --- a/litellm/llms/vllm/common_utils.py +++ b/litellm/llms/vllm/common_utils.py @@ -47,9 +47,7 @@ class VLLMModelInfo(BaseLLMModelInfo): def get_api_base(api_base: str | None = None) -> str | None: api_base = api_base or get_secret_str("VLLM_API_BASE") if api_base is None: - raise ValueError( - "VLLM_API_BASE is not set. Please set the environment variable, to use VLLM's pass-through - `{LITELLM_API_BASE}/vllm/{endpoint}`." - ) + raise ValueError("VLLM_API_BASE is not set.") return api_base @staticmethod @@ -62,12 +60,7 @@ class VLLMModelInfo(BaseLLMModelInfo): def get_models(self, api_key: str | None = None, api_base: str | None = None) -> list[str]: api_base = VLLMModelInfo.get_api_base(api_base) - api_key = VLLMModelInfo.get_api_key(api_key) endpoint: Final = "/v1/models" - if api_base is None or api_key is None: - raise ValueError( - "VLLM_API_BASE or VLLM_API_KEY is not set. Please set the environment variable, to query VLLM's `/models` endpoint." - ) url: Final = _add_path_to_api_base(api_base, endpoint) response: Final = litellm.module_level_client.get( diff --git a/tests/test_litellm/proxy/auth/test_model_checks.py b/tests/test_litellm/proxy/auth/test_model_checks.py index f580df2dad6..451f4eac9a0 100644 --- a/tests/test_litellm/proxy/auth/test_model_checks.py +++ b/tests/test_litellm/proxy/auth/test_model_checks.py @@ -449,10 +449,6 @@ def test_get_known_models_from_wildcard_hosted_vllm_uses_provider_endpoint(): litellm.check_provider_endpoint = True # test-quality-ok: required to exercise provider endpoint discovery with ( patch("litellm.module_level_client.get", return_value=response), # test-quality-ok: required HTTP boundary - patch( # test-quality-ok: VLLM model listing has no injectable API key seam - "litellm.llms.vllm.common_utils.VLLMModelInfo.get_api_key", - return_value="test-key", - ), ): result = get_known_models_from_wildcard( "hosted_vllm/*",