From e8bfab25b3c846f00b60c78fe6647f973b20d07a Mon Sep 17 00:00:00 2001 From: Sameer Kankute Date: Thu, 22 Jan 2026 18:07:00 +0530 Subject: [PATCH 1/9] Fix mypy error in litellm_staging_01_21_2026 --- litellm/types/utils.py | 1 + 1 file changed, 1 insertion(+) diff --git a/litellm/types/utils.py b/litellm/types/utils.py index 41a09bd391..8ea96d137f 100644 --- a/litellm/types/utils.py +++ b/litellm/types/utils.py @@ -114,6 +114,7 @@ class ProviderSpecificModelInfo(TypedDict, total=False): supports_web_search: Optional[bool] supports_reasoning: Optional[bool] supports_url_context: Optional[bool] + max_input_tokens: Optional[int] class SearchContextCostPerQuery(TypedDict, total=False): From caab7821bd6e08ebc6ec90f185711bf553507507 Mon Sep 17 00:00:00 2001 From: Sameer Kankute Date: Thu, 22 Jan 2026 18:24:59 +0530 Subject: [PATCH 2/9] Fix: imagegeneration@006 has been deprecated --- tests/image_gen_tests/test_image_generation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/image_gen_tests/test_image_generation.py b/tests/image_gen_tests/test_image_generation.py index 85f3ceef11..0567f60ecf 100644 --- a/tests/image_gen_tests/test_image_generation.py +++ b/tests/image_gen_tests/test_image_generation.py @@ -112,7 +112,7 @@ class TestVertexImageGeneration(BaseImageGenTest): litellm.in_memory_llm_clients_cache = InMemoryCache() return { - "model": "vertex_ai/imagegeneration@006", + "model": "vertex_ai/imagen-3.0-fast-generate-001", "vertex_ai_project": "pathrise-convert-1606954137718", "vertex_ai_location": "us-central1", "n": 1, From 110e2c69d4662fee9d4b3dd60e13a24f6984f618 Mon Sep 17 00:00:00 2001 From: Sameer Kankute Date: Thu, 22 Jan 2026 18:28:56 +0530 Subject: [PATCH 3/9] Fix : test_anthropic_via_responses_api --- tests/llm_translation/test_anthropic_completion.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/llm_translation/test_anthropic_completion.py b/tests/llm_translation/test_anthropic_completion.py index ab5709cd72..e9ab399836 100644 --- a/tests/llm_translation/test_anthropic_completion.py +++ b/tests/llm_translation/test_anthropic_completion.py @@ -1594,7 +1594,6 @@ def test_anthropic_via_responses_api(): ResponsesAPIStreamEvents.RESPONSE_CREATED, ResponsesAPIStreamEvents.RESPONSE_IN_PROGRESS, ResponsesAPIStreamEvents.OUTPUT_ITEM_ADDED, - ResponsesAPIStreamEvents.CONTENT_PART_ADDED, ResponsesAPIStreamEvents.OUTPUT_TEXT_DELTA, # Can occur multiple times ResponsesAPIStreamEvents.OUTPUT_TEXT_DONE, ResponsesAPIStreamEvents.CONTENT_PART_DONE, From 0afb2cb568701f2325700621aba04a6564742896 Mon Sep 17 00:00:00 2001 From: Sameer Kankute Date: Thu, 22 Jan 2026 18:40:04 +0530 Subject: [PATCH 4/9] Fix: Responses API usage field type mismatch --- litellm/types/llms/openai.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/litellm/types/llms/openai.py b/litellm/types/llms/openai.py index 3f9842de7d..59835b0518 100644 --- a/litellm/types/llms/openai.py +++ b/litellm/types/llms/openai.py @@ -71,7 +71,7 @@ from openai.types.responses.response_create_params import ( ToolParam, ) from openai.types.responses.response_function_tool_call import ResponseFunctionToolCall -from pydantic import BaseModel, ConfigDict, Discriminator, PrivateAttr +from pydantic import BaseModel, ConfigDict, Discriminator, PrivateAttr, field_validator from typing_extensions import Annotated, Dict, Required, TypedDict, override from litellm.types.llms.base import BaseLiteLLMOpenAIResponseObject @@ -1199,6 +1199,16 @@ class ResponsesAPIResponse(BaseLiteLLMOpenAIResponseObject): # Define private attributes using PrivateAttr _hidden_params: dict = PrivateAttr(default_factory=dict) + @field_validator("usage", mode="before") + @classmethod + def validate_usage(cls, value): + """Convert usage dict to ResponseAPIUsage object if needed""" + if value is None: + return value + if isinstance(value, dict): + return ResponseAPIUsage(**value) + return value + @property def output_text(self) -> str: """ From 7c874efeabd0e72b9e072c1869e3c3c959440689 Mon Sep 17 00:00:00 2001 From: Sameer Kankute Date: Thu, 22 Jan 2026 18:49:34 +0530 Subject: [PATCH 5/9] Fix: Httpx timeout test failures --- litellm/main.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/litellm/main.py b/litellm/main.py index ea41919e19..08bb55046c 100644 --- a/litellm/main.py +++ b/litellm/main.py @@ -599,9 +599,8 @@ async def acompletion( # noqa: PLR0915 ctx = contextvars.copy_context() func_with_context = partial(ctx.run, func) - # Wrap with timeout if specified - if timeout is not None: - timeout_value = float(timeout) if not isinstance(timeout, (int, float)) else timeout + if timeout is not None and isinstance(timeout, (int, float)): + timeout_value = float(timeout) init_response = await asyncio.wait_for( loop.run_in_executor(None, func_with_context), timeout=timeout_value @@ -616,8 +615,8 @@ async def acompletion( # noqa: PLR0915 response = ModelResponse(**init_response) response = init_response elif asyncio.iscoroutine(init_response): - if timeout is not None: - timeout_value = float(timeout) if not isinstance(timeout, (int, float)) else timeout + if timeout is not None and isinstance(timeout, (int, float)): + timeout_value = float(timeout) response = await asyncio.wait_for(init_response, timeout=timeout_value) else: response = await init_response From 5a7a364edc8437cd9d4f011f3ed83d544699aa14 Mon Sep 17 00:00:00 2001 From: Sameer Kankute Date: Thu, 22 Jan 2026 19:07:34 +0530 Subject: [PATCH 6/9] fix: mypy error --- litellm/types/utils.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/litellm/types/utils.py b/litellm/types/utils.py index 8ea96d137f..7836804212 100644 --- a/litellm/types/utils.py +++ b/litellm/types/utils.py @@ -114,7 +114,6 @@ class ProviderSpecificModelInfo(TypedDict, total=False): supports_web_search: Optional[bool] supports_reasoning: Optional[bool] supports_url_context: Optional[bool] - max_input_tokens: Optional[int] class SearchContextCostPerQuery(TypedDict, total=False): @@ -142,7 +141,6 @@ class ModelInfoBase(ProviderSpecificModelInfo, total=False): key: Required[str] # the key in litellm.model_cost which is returned max_tokens: Required[Optional[int]] - max_input_tokens: Required[Optional[int]] max_output_tokens: Required[Optional[int]] input_cost_per_token: Required[float] input_cost_per_token_flex: Optional[float] # OpenAI flex service tier pricing From 0cc52c758230e24950de45352e4917f605e2c8c6 Mon Sep 17 00:00:00 2001 From: Sameer Kankute Date: Thu, 22 Jan 2026 19:15:15 +0530 Subject: [PATCH 7/9] comment code not used --- litellm/llms/bedrock/common_utils.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/litellm/llms/bedrock/common_utils.py b/litellm/llms/bedrock/common_utils.py index cfcc96378e..160cd9daa2 100644 --- a/litellm/llms/bedrock/common_utils.py +++ b/litellm/llms/bedrock/common_utils.py @@ -486,21 +486,21 @@ class BedrockModelInfo(BaseLLMModelInfo): ) -> List[str]: return [] - def get_provider_info(self, model: str) -> Optional[ProviderSpecificModelInfo]: - """ - Handles Bedrock throughput suffixes like ":28k", ":51k". - """ - import re + # def get_provider_info(self, model: str) -> Optional[ProviderSpecificModelInfo]: + # """ + # Handles Bedrock throughput suffixes like ":28k", ":51k". + # """ + # import re - overrides: ProviderSpecificModelInfo = {} + # overrides: ProviderSpecificModelInfo = {} - # Parse context window suffix (e.g., :28k, :51k) - match = re.search(r":(\d+)k$", model) - if match: - throughput_value = int(match.group(1)) * 1000 - overrides["max_input_tokens"] = throughput_value + # # Parse context window suffix (e.g., :28k, :51k) + # match = re.search(r":(\d+)k$", model) + # if match: + # throughput_value = int(match.group(1)) * 1000 + # overrides["max_input_tokens"] = throughput_value - return overrides if overrides else None + # return overrides if overrides else None def get_token_counter(self) -> Optional[BaseTokenCounter]: """ From ab9c8409240a360551ffe44739dee0a5c7660375 Mon Sep 17 00:00:00 2001 From: Sameer Kankute Date: Thu, 22 Jan 2026 19:25:21 +0530 Subject: [PATCH 8/9] fix: mypy error --- litellm/types/utils.py | 1 + 1 file changed, 1 insertion(+) diff --git a/litellm/types/utils.py b/litellm/types/utils.py index 7836804212..41a09bd391 100644 --- a/litellm/types/utils.py +++ b/litellm/types/utils.py @@ -141,6 +141,7 @@ class ModelInfoBase(ProviderSpecificModelInfo, total=False): key: Required[str] # the key in litellm.model_cost which is returned max_tokens: Required[Optional[int]] + max_input_tokens: Required[Optional[int]] max_output_tokens: Required[Optional[int]] input_cost_per_token: Required[float] input_cost_per_token_flex: Optional[float] # OpenAI flex service tier pricing From 2fefafc4aa8f2e05975f3d95a7ad8ac719ff28aa Mon Sep 17 00:00:00 2001 From: Sameer Kankute Date: Thu, 22 Jan 2026 19:26:40 +0530 Subject: [PATCH 9/9] fix: mypy error --- litellm/llms/bedrock/common_utils.py | 1 - 1 file changed, 1 deletion(-) diff --git a/litellm/llms/bedrock/common_utils.py b/litellm/llms/bedrock/common_utils.py index 160cd9daa2..89b42f5e94 100644 --- a/litellm/llms/bedrock/common_utils.py +++ b/litellm/llms/bedrock/common_utils.py @@ -10,7 +10,6 @@ from typing import TYPE_CHECKING, Dict, List, Literal, Optional, Union if TYPE_CHECKING: from litellm.types.llms.bedrock import BedrockCreateBatchRequest - from litellm.types.utils import ProviderSpecificModelInfo import httpx