From d99c70b7eae08212f288a3e609cab262eae9b600 Mon Sep 17 00:00:00 2001 From: David-Wu1119 <133224895+David-Wu1119@users.noreply.github.com> Date: Thu, 13 Aug 2026 18:11:53 +0800 Subject: [PATCH] fix(vllm): repair the return annotation after the PEP 604 migration litellm_internal_staging moved this module to X | None and dropped Optional from its typing import, while this branch added a method annotated Optional["CostResponseTypes"]. The merge was textually clean but left the module raising NameError on import. Use the quoted PEP 604 form the rest of the file now uses, and record a mutable-ok reason for the request_data dict the base class signature fixes. --- litellm/llms/vllm/passthrough/transformation.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/litellm/llms/vllm/passthrough/transformation.py b/litellm/llms/vllm/passthrough/transformation.py index 2aced877f4a..6097f70913a 100644 --- a/litellm/llms/vllm/passthrough/transformation.py +++ b/litellm/llms/vllm/passthrough/transformation.py @@ -39,10 +39,10 @@ class VLLMPassthroughConfig(VLLMModelInfo, BasePassthroughConfig): model: str, custom_llm_provider: str, httpx_response: "Response", - request_data: dict, + request_data: dict, # mutable-ok: base class signature logging_obj: "LiteLLMLoggingObj", endpoint: str, - ) -> Optional["CostResponseTypes"]: + ) -> "CostResponseTypes | None": from litellm import encoding from litellm.llms.openai.chat.gpt_transformation import OpenAIGPTConfig from litellm.types.utils import EmbeddingResponse, ModelResponse, Usage