The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
fix: fix import errors
Krrish Dholakiafc2d1f264619
diff --git a/enterprise/litellm_enterprise/types/proxy/proxy_server.py b/enterprise/litellm_enterprise/types/proxy/proxy_server.pyindex 497be59c4b9..f1a1f2639ed 100644--- a/enterprise/litellm_enterprise/types/proxy/proxy_server.py+++ b/enterprise/litellm_enterprise/types/proxy/proxy_server.py@@ -1,4 +1,6 @@-from typing import Literal, TypedDict+from typing import Literal++from typing_extensions import TypedDictclass CustomAuthSettings(TypedDict):diff --git a/litellm/completion_extras/litellm_responses_transformation/handler.py b/litellm/completion_extras/litellm_responses_transformation/handler.pyindex f2eeaf04554..6ec49ce0620 100644--- a/litellm/completion_extras/litellm_responses_transformation/handler.py+++ b/litellm/completion_extras/litellm_responses_transformation/handler.py@@ -2,7 +2,9 @@Handler for transforming /chat/completions api requests to litellm.responses requests"""-from typing import TYPE_CHECKING, Any, Coroutine, TypedDict, Union+from typing import TYPE_CHECKING, Any, Coroutine, Union++from typing_extensions import TypedDictif TYPE_CHECKING:from litellm import CustomStreamWrapper, LiteLLMLoggingObj, ModelResponsediff --git a/litellm/endpoints/speech/speech_to_completion_bridge/handler.py b/litellm/endpoints/speech/speech_to_completion_bridge/handler.pyindex 3035c5065c5..13af0a30fe0 100644--- a/litellm/endpoints/speech/speech_to_completion_bridge/handler.py+++ b/litellm/endpoints/speech/speech_to_completion_bridge/handler.py@@ -2,7 +2,9 @@Handler for transforming /chat/completions api requests to litellm.responses requests"""-from typing import TYPE_CHECKING, Optional, TypedDict, Union+from typing import TYPE_CHECKING, Optional, Union++from typing_extensions import TypedDictif TYPE_CHECKING:from litellm import LiteLLMLoggingObjdiff --git a/litellm/integrations/humanloop.py b/litellm/integrations/humanloop.pyindex 9f43d806266..8e60d3736e0 100644--- a/litellm/integrations/humanloop.py+++ b/litellm/integrations/humanloop.py@@ -4,9 +4,10 @@ Humanloop integrationhttps://humanloop.com/"""-from typing import Any, Dict, List, Optional, Tuple, TypedDict, Union, cast+from typing import Any, Dict, List, Optional, Tuple, Union, castimport httpx+from typing_extensions import TypedDictimport litellmfrom litellm.caching import DualCachediff --git a/litellm/integrations/prompt_management_base.py b/litellm/integrations/prompt_management_base.pyindex 34b4455f564..7754ca435ca 100644--- a/litellm/integrations/prompt_management_base.py+++ b/litellm/integrations/prompt_management_base.py@@ -1,5 +1,7 @@from abc import ABC, abstractmethod-from typing import Any, Dict, List, Optional, Tuple, TypedDict+from typing import Any, Dict, List, Optional, Tuple++from typing_extensions import TypedDictfrom litellm.types.llms.openai import AllMessageValuesfrom litellm.types.utils import StandardCallbackDynamicParamsdiff --git a/litellm/litellm_core_utils/logging_worker.py b/litellm/litellm_core_utils/logging_worker.pyindex 16860ad6852..3c475f133a8 100644--- a/litellm/litellm_core_utils/logging_worker.py+++ b/litellm/litellm_core_utils/logging_worker.py@@ -1,7 +1,9 @@import asyncioimport contextlibimport contextvars-from typing import Coroutine, Optional, TypedDict+from typing import Coroutine, Optional++from typing_extensions import TypedDictfrom litellm._logging import verbose_loggerdiff --git a/litellm/llms/huggingface/rerank/transformation.py b/litellm/llms/huggingface/rerank/transformation.pyindex 3f5c44fec05..9c3234c3512 100644--- a/litellm/llms/huggingface/rerank/transformation.py+++ b/litellm/llms/huggingface/rerank/transformation.py@@ -1,8 +1,9 @@import osimport uuid-from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, TypedDict, Union+from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, Unionimport httpx+from typing_extensions import TypedDictimport litellmfrom litellm.llms.base_llm.chat.transformation import BaseLLMExceptiondiff --git a/litellm/llms/vertex_ai/text_to_speech/text_to_speech_handler.py b/litellm/llms/vertex_ai/text_to_speech/text_to_speech_handler.pyindex 18bc72db46a..9d9015c2b91 100644--- a/litellm/llms/vertex_ai/text_to_speech/text_to_speech_handler.py+++ b/litellm/llms/vertex_ai/text_to_speech/text_to_speech_handler.py@@ -1,6 +1,7 @@-from typing import Optional, TypedDict, Union+from typing import Optional, Unionimport httpx+from typing_extensions import TypedDictimport litellmfrom litellm.llms.custom_httpx.http_handler import (diff --git a/litellm/llms/vertex_ai/vertex_embeddings/types.py b/litellm/llms/vertex_ai/vertex_embeddings/types.pyindex c0c53b170c4..7f85ea46f31 100644--- a/litellm/llms/vertex_ai/vertex_embeddings/types.py+++ b/litellm/llms/vertex_ai/vertex_embeddings/types.py@@ -3,7 +3,9 @@ Types for Vertex Embeddings Requests"""from enum import Enum-from typing import List, Optional, TypedDict, Union+from typing import List, Optional, Union++from typing_extensions import TypedDictclass TaskType(str, Enum):diff --git a/litellm/model_prices_and_context_window_backup.json b/litellm/model_prices_and_context_window_backup.jsonindex 46331c7cff7..261fe9552d0 100644--- a/litellm/model_prices_and_context_window_backup.json+++ b/litellm/model_prices_and_context_window_backup.json@@ -20777,5 +20777,207 @@"metadata": {"notes": "Volcengine Doubao embedding model - text-240715 version with 2560 dimensions"}+ },+ "ovhcloud/Qwen2.5-VL-72B-Instruct": {+ "max_tokens": 32000,+ "max_input_tokens": 32000,+ "max_output_tokens": 32000,+ "input_cost_per_token": 9.1e-07,+ "output_cost_per_token": 9.1e-07,+ "litellm_provider": "ovhcloud",+ "mode": "chat",+ "supports_function_calling": false,+ "supports_response_schema": true,+ "supports_tool_choice": false,+ "supports_vision": true,+ "source": "https://endpoints.ai.cloud.ovh.net/models/qwen2-5-vl-72b-instruct"+ },+ "ovhcloud/llava-v1.6-mistral-7b-hf": {+ "max_tokens": 32000,+ "max_input_tokens": 32000,+ "max_output_tokens": 32000,+ "input_cost_per_token": 2.9e-07,+ "output_cost_per_token": 2.9e-07,+ "litellm_provider": "ovhcloud",+ "mode": "chat",+ "supports_function_calling": false,+ "supports_response_schema": true,+ "supports_tool_choice": false,+ "supports_vision": true,+ "source": "https://endpoints.ai.cloud.ovh.net/models/llava-next-mistral-7b"+ },+ "ovhcloud/gpt-oss-120b": {+ "max_tokens": 131000,+ "max_input_tokens": 131000,+ "max_output_tokens": 131000,+ "input_cost_per_token": 8e-08,+ "output_cost_per_token": 4e-07,+ "litellm_provider": "ovhcloud",+ "mode": "chat",+ "supports_function_calling": false,+ "supports_response_schema": true,+ "supports_tool_choice": false,+ "supports_reasoning": true,+ "source": "https://endpoints.ai.cloud.ovh.net/models/gpt-oss-120b"+ },+ "ovhcloud/Meta-Llama-3_3-70B-Instruct": {+ "max_tokens": 131000,+ "max_input_tokens": 131000,+ "max_output_tokens": 131000,+ "input_cost_per_token": 6.7e-07,+ "output_cost_per_token": 6.7e-07,+ "litellm_provider": "ovhcloud",+ "mode": "chat",+ "supports_function_calling": true,+ "supports_response_schema": true,+ "supports_tool_choice": true,+ "source": "https://endpoints.ai.cloud.ovh.net/models/meta-llama-3-3-70b-instruct"+ },+ "ovhcloud/Qwen2.5-Coder-32B-Instruct": {+ "max_tokens": 32000,+ "max_input_tokens": 32000,+ "max_output_tokens": 32000,+ "input_cost_per_token": 8.7e-07,+ "output_cost_per_token": 8.7e-07,+ "litellm_provider": "ovhcloud",+ "mode": "chat",+ "supports_function_calling": false,+ "supports_response_schema": true,+ "supports_tool_choice": false,+ "source": "https://endpoints.ai.cloud.ovh.net/models/qwen2-5-coder-32b-instruct"+ },+ "ovhcloud/Mixtral-8x7B-Instruct-v0.1": {+ "max_tokens": 32000,+ "max_input_tokens": 32000,+ "max_output_tokens": 32000,+ "input_cost_per_token": 6.3e-07,+ "output_cost_per_token": 6.3e-07,+ "litellm_provider": "ovhcloud",+ "mode": "chat",+ "supports_function_calling": false,+ "supports_response_schema": true,+ "supports_tool_choice": false,+ "source": "https://endpoints.ai.cloud.ovh.net/models/mixtral-8x7b-instruct-v0-1"+ },+ "ovhcloud/Meta-Llama-3_1-70B-Instruct": {+ "max_tokens": 131000,+ "max_input_tokens": 131000,+ "max_output_tokens": 131000,+ "input_cost_per_token": 6.7e-07,+ "output_cost_per_token": 6.7e-07,+ "litellm_provider": "ovhcloud",+ "mode": "chat",+ "supports_function_calling": false,+ "supports_response_schema": false,+ "supports_tool_choice": false,+ "source": "https://endpoints.ai.cloud.ovh.net/models/meta-llama-3-1-70b-instruct"+ },+ "ovhcloud/Mistral-Small-3.2-24B-Instruct-2506": {+ "max_tokens": 128000,+ "max_input_tokens": 128000,+ "max_output_tokens": 128000,+ "input_cost_per_token": 9e-08,+ "output_cost_per_token": 2.8e-07,+ "litellm_provider": "ovhcloud",+ "mode": "chat",+ "supports_function_calling": true,+ "supports_response_schema": true,+ "supports_tool_choice": true,+ "supports_vision": true,+ "source": "https://endpoints.ai.cloud.ovh.net/models/mistral-small-3-2-24b-instruct-2506"+ },+ "ovhcloud/DeepSeek-R1-Distill-Llama-70B": {+ "max_tokens": 131000,+ "max_input_tokens": 131000,+ "max_output_tokens": 131000,+ "input_cost_per_token": 6.7e-07,+ "output_cost_per_token": 6.7e-07,+ "litellm_provider": "ovhcloud",+ "mode": "chat",+ "supports_function_calling": true,+ "supports_response_schema": true,+ "supports_tool_choice": true,+ "supports_reasoning": true,+ "source": "https://endpoints.ai.cloud.ovh.net/models/deepseek-r1-distill-llama-70b"+ },+ "ovhcloud/Llama-3.1-8B-Instruct": {+ "max_tokens": 131000,+ "max_input_tokens": 131000,+ "max_output_tokens": 131000,+ "input_cost_per_token": 1e-07,+ "output_cost_per_token": 1e-07,+ "litellm_provider": "ovhcloud",+ "mode": "chat",+ "supports_function_calling": true,+ "supports_response_schema": true,+ "supports_tool_choice": true,+ "source": "https://endpoints.ai.cloud.ovh.net/models/llama-3-1-8b-instruct"+ },+ "ovhcloud/Mistral-7B-Instruct-v0.3": {+ "max_tokens": 127000,+ "max_input_tokens": 127000,+ "max_output_tokens": 127000,+ "input_cost_per_token": 1e-07,+ "output_cost_per_token": 1e-07,+ "litellm_provider": "ovhcloud",+ "mode": "chat",+ "supports_function_calling": true,+ "supports_response_schema": true,+ "supports_tool_choice": true,+ "source": "https://endpoints.ai.cloud.ovh.net/models/mistral-7b-instruct-v0-3"+ },+ "ovhcloud/gpt-oss-20b": {+ "max_tokens": 131000,+ "max_input_tokens": 131000,+ "max_output_tokens": 131000,+ "input_cost_per_token": 4e-08,+ "output_cost_per_token": 1.5e-07,+ "litellm_provider": "ovhcloud",+ "mode": "chat",+ "supports_function_calling": false,+ "supports_response_schema": true,+ "supports_tool_choice": false,+ "supports_reasoning": true,+ "source": "https://endpoints.ai.cloud.ovh.net/models/gpt-oss-20b"+ },+ "ovhcloud/Mistral-Nemo-Instruct-2407": {+ "max_tokens": 118000,+ "max_input_tokens": 118000,+ "max_output_tokens": 118000,+ "input_cost_per_token": 1.3e-07,+ "output_cost_per_token": 1.3e-07,+ "litellm_provider": "ovhcloud",+ "mode": "chat",+ "supports_function_calling": true,+ "supports_response_schema": true,+ "supports_tool_choice": true,+ "source": "https://endpoints.ai.cloud.ovh.net/models/mistral-nemo-instruct-2407"+ },+ "ovhcloud/Qwen3-32B": {+ "max_tokens": 32000,+ "max_input_tokens": 32000,+ "max_output_tokens": 32000,+ "input_cost_per_token": 8e-08,+ "output_cost_per_token": 2.3e-07,+ "litellm_provider": "ovhcloud",+ "mode": "chat",+ "supports_function_calling": true,+ "supports_response_schema": true,+ "supports_tool_choice": true,+ "supports_reasoning": true,+ "source": "https://endpoints.ai.cloud.ovh.net/models/qwen3-32b"+ },+ "ovhcloud/mamba-codestral-7B-v0.1": {+ "max_tokens": 256000,+ "max_input_tokens": 256000,+ "max_output_tokens": 256000,+ "input_cost_per_token": 1.9e-07,+ "output_cost_per_token": 1.9e-07,+ "litellm_provider": "ovhcloud",+ "mode": "chat",+ "supports_function_calling": false,+ "supports_response_schema": true,+ "supports_tool_choice": false,+ "source": "https://endpoints.ai.cloud.ovh.net/models/mamba-codestral-7b-v0-1"}}diff --git a/litellm/proxy/hooks/parallel_request_limiter.py b/litellm/proxy/hooks/parallel_request_limiter.pyindex 242c013d677..c7bfc27d6b6 100644--- a/litellm/proxy/hooks/parallel_request_limiter.py+++ b/litellm/proxy/hooks/parallel_request_limiter.py@@ -1,10 +1,11 @@import asyncioimport sysfrom datetime import datetime, timedelta-from typing import TYPE_CHECKING, Any, List, Literal, Optional, Tuple, TypedDict, Union+from typing import TYPE_CHECKING, Any, List, Literal, Optional, Tuple, Unionfrom fastapi import HTTPExceptionfrom pydantic import BaseModel+from typing_extensions import TypedDictimport litellmfrom litellm import DualCache, ModelResponsediff --git a/litellm/proxy/management_endpoints/scim/scim_v2.py b/litellm/proxy/management_endpoints/scim/scim_v2.pyindex b9929c3b433..f84b4df42d0 100644--- a/litellm/proxy/management_endpoints/scim/scim_v2.py+++ b/litellm/proxy/management_endpoints/scim/scim_v2.py@@ -5,7 +5,7 @@ This is an enterprise feature and requires a premium license."""import uuid-from typing import Any, Dict, List, Optional, Set, Tuple, TypedDict+from typing import Any, Dict, List, Optional, Set, Tuplefrom fastapi import (APIRouter,@@ -17,6 +17,7 @@ from fastapi import (Request,Response,)+from typing_extensions import TypedDictimport litellmfrom litellm._logging import verbose_proxy_loggerdiff --git a/litellm/proxy/pass_through_endpoints/llm_provider_handlers/assembly_passthrough_logging_handler.py b/litellm/proxy/pass_through_endpoints/llm_provider_handlers/assembly_passthrough_logging_handler.pyindex 1acaf5f3614..a8c5562d4d6 100644--- a/litellm/proxy/pass_through_endpoints/llm_provider_handlers/assembly_passthrough_logging_handler.py+++ b/litellm/proxy/pass_through_endpoints/llm_provider_handlers/assembly_passthrough_logging_handler.py@@ -2,10 +2,11 @@ import asyncioimport jsonimport timefrom datetime import datetime-from typing import Literal, Optional, TypedDict+from typing import Literal, Optionalfrom urllib.parse import urlparseimport httpx+from typing_extensions import TypedDictimport litellmfrom litellm._logging import verbose_proxy_loggerdiff --git a/litellm/router_utils/cooldown_cache.py b/litellm/router_utils/cooldown_cache.pyindex 0a199d4b757..aba8bfd72f1 100644--- a/litellm/router_utils/cooldown_cache.py+++ b/litellm/router_utils/cooldown_cache.py@@ -3,7 +3,9 @@ Wrapper around router cache. Meant to handle model cooldown logic"""import time-from typing import TYPE_CHECKING, Any, List, Optional, Tuple, TypedDict, Union+from typing import TYPE_CHECKING, Any, List, Optional, Tuple, Union++from typing_extensions import TypedDictfrom litellm import verbose_loggerfrom litellm.caching.caching import DualCachediff --git a/litellm/router_utils/prompt_caching_cache.py b/litellm/router_utils/prompt_caching_cache.pyindex 6a96b85e8af..e9637f28605 100644--- a/litellm/router_utils/prompt_caching_cache.py+++ b/litellm/router_utils/prompt_caching_cache.py@@ -4,7 +4,9 @@ Wrapper around router cache. Meant to store model id when prompt caching supportimport hashlibimport json-from typing import TYPE_CHECKING, Any, List, Optional, TypedDict, Union+from typing import TYPE_CHECKING, Any, List, Optional, Union++from typing_extensions import TypedDictfrom litellm.caching.caching import DualCachefrom litellm.caching.in_memory_cache import InMemoryCachediff --git a/litellm/types/caching.py b/litellm/types/caching.pyindex 67b0238ce8a..bb4ea416b87 100644--- a/litellm/types/caching.py+++ b/litellm/types/caching.py@@ -1,7 +1,8 @@from enum import Enum-from typing import Any, Dict, List, Literal, Optional, TypedDict, Union+from typing import Any, Dict, List, Literal, Optional, Unionfrom pydantic import BaseModel+from typing_extensions import TypedDictclass LiteLLMCacheType(str, Enum):diff --git a/litellm/types/guardrails.py b/litellm/types/guardrails.pyindex d257e316d7c..e5ea89325eb 100644--- a/litellm/types/guardrails.py+++ b/litellm/types/guardrails.py@@ -1,9 +1,9 @@from datetime import datetimefrom enum import Enum-from typing import Any, Dict, List, Literal, Optional, TypedDict, Union+from typing import Any, Dict, List, Literal, Optional, Unionfrom pydantic import BaseModel, ConfigDict, Field-from typing_extensions import Required+from typing_extensions import Required, TypedDict"""Pydantic object defining how to set guardrails on litellm proxydiff --git a/litellm/types/images/main.py b/litellm/types/images/main.pyindex 1e7466f4e83..3002f9bffb4 100644--- a/litellm/types/images/main.py+++ b/litellm/types/images/main.py@@ -1,4 +1,6 @@-from typing import Any, Dict, List, Literal, Optional, TypedDict, Union+from typing import Any, Dict, List, Literal, Optional, Union++from typing_extensions import TypedDictfrom litellm.types.utils import FileTypesdiff --git a/litellm/types/integrations/anthropic_cache_control_hook.py b/litellm/types/integrations/anthropic_cache_control_hook.pyindex 88f22ac1b71..6e859f10187 100644--- a/litellm/types/integrations/anthropic_cache_control_hook.py+++ b/litellm/types/integrations/anthropic_cache_control_hook.py@@ -1,4 +1,6 @@-from typing import Literal, Optional, TypedDict, Union+from typing import Literal, Optional, Union++from typing_extensions import TypedDictfrom litellm.types.llms.openai import ChatCompletionCachedContentdiff --git a/litellm/types/integrations/argilla.py b/litellm/types/integrations/argilla.pyindex 6c0de762a70..1de7e75ed7c 100644--- a/litellm/types/integrations/argilla.py+++ b/litellm/types/integrations/argilla.py@@ -1,7 +1,9 @@import osfrom datetime import datetime as dtfrom enum import Enum-from typing import Any, Dict, List, Literal, Optional, Set, TypedDict+from typing import Any, Dict, List, Literal, Optional, Set++from typing_extensions import TypedDictclass ArgillaItem(TypedDict):diff --git a/litellm/types/integrations/base_health_check.py b/litellm/types/integrations/base_health_check.pyindex b69529d1fcd..2443564dcd2 100644--- a/litellm/types/integrations/base_health_check.py+++ b/litellm/types/integrations/base_health_check.py@@ -1,4 +1,6 @@-from typing import Literal, Optional, TypedDict+from typing import Literal, Optional++from typing_extensions import TypedDictclass IntegrationHealthCheckStatus(TypedDict):diff --git a/litellm/types/integrations/datadog.py b/litellm/types/integrations/datadog.pyindex 7ea25561f95..fce60b9c4b5 100644--- a/litellm/types/integrations/datadog.py+++ b/litellm/types/integrations/datadog.py@@ -1,5 +1,7 @@from enum import Enum-from typing import Optional, TypedDict+from typing import Optional++from typing_extensions import TypedDictDD_MAX_BATCH_SIZE = 1000diff --git a/litellm/types/integrations/datadog_llm_obs.py b/litellm/types/integrations/datadog_llm_obs.pyindex 41489ace30f..25ee0932b12 100644--- a/litellm/types/integrations/datadog_llm_obs.py+++ b/litellm/types/integrations/datadog_llm_obs.py@@ -3,7 +3,9 @@ Payloads for Datadog LLM Observability Service (LLMObs)API Reference: https://docs.datadoghq.com/llm_observability/setup/api/?tab=example#api-standards"""-from typing import Any, Dict, List, Literal, Optional, TypedDict+from typing import Any, Dict, List, Literal, Optional++from typing_extensions import TypedDictfrom litellm.types.integrations.custom_logger import StandardCustomLoggerInitParamsdiff --git a/litellm/types/integrations/gcs_bucket.py b/litellm/types/integrations/gcs_bucket.pyindex 9f5065ced2b..2be2acab2f2 100644--- a/litellm/types/integrations/gcs_bucket.py+++ b/litellm/types/integrations/gcs_bucket.py@@ -1,4 +1,6 @@-from typing import TYPE_CHECKING, Any, Dict, Optional, TypedDict+from typing import TYPE_CHECKING, Any, Dict, Optional++from typing_extensions import TypedDictfrom litellm.types.utils import StandardLoggingPayloaddiff --git a/litellm/types/integrations/langfuse.py b/litellm/types/integrations/langfuse.pyindex ecf42d8cd47..e509d074172 100644--- a/litellm/types/integrations/langfuse.py+++ b/litellm/types/integrations/langfuse.py@@ -1,4 +1,6 @@-from typing import Optional, TypedDict+from typing import Optional++from typing_extensions import TypedDictclass LangfuseLoggingConfig(TypedDict):diff --git a/litellm/types/integrations/langsmith.py b/litellm/types/integrations/langsmith.pyindex 48c8e2e0a29..382479ab420 100644--- a/litellm/types/integrations/langsmith.py+++ b/litellm/types/integrations/langsmith.py@@ -1,8 +1,9 @@from dataclasses import dataclassfrom datetime import datetime-from typing import Any, Dict, List, NamedTuple, Optional, TypedDict+from typing import Any, Dict, List, NamedTuple, Optionalfrom pydantic import BaseModel+from typing_extensions import TypedDictclass LangsmithInputs(BaseModel):diff --git a/litellm/types/integrations/pagerduty.py b/litellm/types/integrations/pagerduty.pyindex 22fd16654aa..0fa45f219cb 100644--- a/litellm/types/integrations/pagerduty.py+++ b/litellm/types/integrations/pagerduty.py@@ -1,5 +1,7 @@from datetime import datetime-from typing import List, Literal, Optional, TypedDict, Union+from typing import List, Literal, Optional, Union++from typing_extensions import TypedDictfrom litellm.types.utils import StandardLoggingUserAPIKeyMetadatadiff --git a/litellm/types/integrations/rag/bedrock_knowledgebase.py b/litellm/types/integrations/rag/bedrock_knowledgebase.pyindex dd60ccc198d..c7ee4d87825 100644--- a/litellm/types/integrations/rag/bedrock_knowledgebase.py+++ b/litellm/types/integrations/rag/bedrock_knowledgebase.py@@ -1,4 +1,6 @@-from typing import Any, Dict, List, Literal, Optional, TypedDict, Union+from typing import Any, Dict, List, Literal, Optional, Union++from typing_extensions import TypedDictclass BedrockKBLocation(TypedDict, total=False):diff --git a/litellm/types/integrations/slack_alerting.py b/litellm/types/integrations/slack_alerting.pyindex 804c41eaf87..856640638c2 100644--- a/litellm/types/integrations/slack_alerting.py+++ b/litellm/types/integrations/slack_alerting.py@@ -1,9 +1,10 @@import osfrom datetime import datetime as dtfrom enum import Enum-from typing import Any, Dict, List, Literal, Optional, Set, TypedDict+from typing import Any, Dict, List, Literal, Optional, Setfrom pydantic import BaseModel, Field+from typing_extensions import TypedDictfrom litellm.types.utils import LiteLLMPydanticObjectBasediff --git a/litellm/types/litellm_core_utils/streaming_chunk_builder_utils.py b/litellm/types/litellm_core_utils/streaming_chunk_builder_utils.pyindex ecdc95bf25e..aa879e14c34 100644--- a/litellm/types/litellm_core_utils/streaming_chunk_builder_utils.py+++ b/litellm/types/litellm_core_utils/streaming_chunk_builder_utils.py@@ -1,4 +1,6 @@-from typing import TYPE_CHECKING, Optional, TypedDict+from typing import TYPE_CHECKING, Optional++from typing_extensions import TypedDictfrom ..utils import CompletionTokensDetails, PromptTokensDetailsWrapperdiff --git a/litellm/types/llms/anthropic_messages/anthropic_response.py b/litellm/types/llms/anthropic_messages/anthropic_response.pyindex 158d11c463c..1eab1b37e06 100644--- a/litellm/types/llms/anthropic_messages/anthropic_response.py+++ b/litellm/types/llms/anthropic_messages/anthropic_response.py@@ -1,6 +1,6 @@-from typing import Any, Dict, List, Literal, Optional, TypedDict, Union+from typing import Any, Dict, List, Literal, Optional, Union-from typing_extensions import TypeAlias+from typing_extensions import TypeAlias, TypedDictfrom litellm.types.llms.anthropic import (AnthropicResponseContentBlockText,diff --git a/litellm/types/llms/bedrock.py b/litellm/types/llms/bedrock.pyindex 5853f9de2aa..baa7c205204 100644--- a/litellm/types/llms/bedrock.py+++ b/litellm/types/llms/bedrock.py@@ -1,11 +1,12 @@import json-from typing import Any, List, Literal, Optional, TypedDict, Union+from typing import Any, List, Literal, Optional, Unionfrom typing_extensions import (TYPE_CHECKING,Protocol,Required,Self,+ TypedDict,TypeGuard,get_origin,override,diff --git a/litellm/types/llms/bedrock_invoke_agents.py b/litellm/types/llms/bedrock_invoke_agents.pyindex dde9405a720..385048b4ff6 100644--- a/litellm/types/llms/bedrock_invoke_agents.py+++ b/litellm/types/llms/bedrock_invoke_agents.py@@ -4,7 +4,9 @@ Type definitions for AWS Bedrock Invoke Agent API responses.https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html"""-from typing import Any, Dict, List, Optional, TypedDict, Union+from typing import Any, Dict, List, Optional, Union++from typing_extensions import TypedDictclass InvokeAgentEventHeaders(TypedDict, total=False):diff --git a/litellm/types/llms/databricks.py b/litellm/types/llms/databricks.pyindex c484e80ada3..c862bf0e4ac 100644--- a/litellm/types/llms/databricks.py+++ b/litellm/types/llms/databricks.py@@ -1,11 +1,12 @@import json-from typing import Any, Dict, List, Literal, Optional, TypedDict, Union+from typing import Any, Dict, List, Literal, Optional, Unionfrom pydantic import BaseModelfrom typing_extensions import (Protocol,Required,Self,+ TypedDict,TypeGuard,get_origin,override,diff --git a/litellm/types/llms/mistral.py b/litellm/types/llms/mistral.pyindex 375120e5376..34f501ef69f 100644--- a/litellm/types/llms/mistral.py+++ b/litellm/types/llms/mistral.py@@ -1,4 +1,6 @@-from typing import List, Literal, Optional, TypedDict, Union+from typing import List, Literal, Optional, Union++from typing_extensions import TypedDictclass FunctionCall(TypedDict):diff --git a/litellm/types/llms/ollama.py b/litellm/types/llms/ollama.pyindex d8f20de514d..b863b76c03c 100644--- a/litellm/types/llms/ollama.py+++ b/litellm/types/llms/ollama.py@@ -1,11 +1,12 @@import json-from typing import Any, List, Optional, TypedDict, Union+from typing import Any, List, Optional, Unionfrom pydantic import BaseModelfrom typing_extensions import (Protocol,Required,Self,+ TypedDict,TypeGuard,get_origin,override,diff --git a/litellm/types/llms/openrouter.py b/litellm/types/llms/openrouter.pyindex d5bb031a171..39ed7e104fb 100644--- a/litellm/types/llms/openrouter.py+++ b/litellm/types/llms/openrouter.py@@ -1,6 +1,8 @@import jsonfrom enum import Enum-from typing import Any, Dict, List, Literal, Optional, Tuple, TypedDict, Union+from typing import Any, Dict, List, Literal, Optional, Tuple, Union++from typing_extensions import TypedDictclass OpenRouterErrorMessage(TypedDict):diff --git a/litellm/types/llms/rerank.py b/litellm/types/llms/rerank.pyindex f781af88ffb..fac093161c1 100644--- a/litellm/types/llms/rerank.py+++ b/litellm/types/llms/rerank.py@@ -1,11 +1,12 @@import jsonfrom enum import Enum-from typing import Any, Dict, List, Literal, Optional, Tuple, TypedDict, Union+from typing import Any, Dict, List, Literal, Optional, Tuple, Unionfrom typing_extensions import (Protocol,Required,Self,+ TypedDict,TypeGuard,get_origin,override,diff --git a/litellm/types/llms/watsonx.py b/litellm/types/llms/watsonx.pyindex 7dee2836527..426ca8a7d25 100644--- a/litellm/types/llms/watsonx.py+++ b/litellm/types/llms/watsonx.py@@ -1,8 +1,9 @@import jsonfrom enum import Enum-from typing import Any, List, Optional, TypedDict, Union+from typing import Any, List, Optional, Unionfrom pydantic import BaseModel+from typing_extensions import TypedDictclass WatsonXAPIParams(TypedDict):diff --git a/litellm/types/passthrough_endpoints/pass_through_endpoints.py b/litellm/types/passthrough_endpoints/pass_through_endpoints.pyindex 39facdd8e6f..c99775f2a6c 100644--- a/litellm/types/passthrough_endpoints/pass_through_endpoints.py+++ b/litellm/types/passthrough_endpoints/pass_through_endpoints.py@@ -1,5 +1,7 @@from enum import Enum-from typing import Optional, TypedDict+from typing import Optional++from typing_extensions import TypedDictclass EndpointType(str, Enum):diff --git a/litellm/types/proxy/litellm_pre_call_utils.py b/litellm/types/proxy/litellm_pre_call_utils.pyindex c33f1ba8bce..a956f92187c 100644--- a/litellm/types/proxy/litellm_pre_call_utils.py+++ b/litellm/types/proxy/litellm_pre_call_utils.py@@ -1,4 +1,4 @@-from typing import TypedDict+from typing_extensions import TypedDictclass SecretFields(TypedDict):diff --git a/litellm/types/proxy/management_endpoints/common_daily_activity.py b/litellm/types/proxy/management_endpoints/common_daily_activity.pyindex 713ca56758c..08ffc5d097a 100644--- a/litellm/types/proxy/management_endpoints/common_daily_activity.py+++ b/litellm/types/proxy/management_endpoints/common_daily_activity.py@@ -1,8 +1,9 @@from datetime import datefrom enum import Enum-from typing import Any, Dict, List, Optional, TypedDict+from typing import Any, Dict, List, Optionalfrom pydantic import BaseModel, Field+from typing_extensions import TypedDictclass GroupByDimension(str, Enum):diff --git a/litellm/types/proxy/management_endpoints/ui_sso.py b/litellm/types/proxy/management_endpoints/ui_sso.pyindex fe6d7569b23..820b0164400 100644--- a/litellm/types/proxy/management_endpoints/ui_sso.py+++ b/litellm/types/proxy/management_endpoints/ui_sso.py@@ -1,6 +1,7 @@-from typing import List, Literal, Optional, TypedDict, Union+from typing import List, Literal, Optional, Unionfrom pydantic import Field+from typing_extensions import TypedDictfrom litellm.types.utils import LiteLLMPydanticObjectBasediff --git a/litellm/types/proxy/ui_sso.py b/litellm/types/proxy/ui_sso.pyindex 625b523477b..0c036274c79 100644--- a/litellm/types/proxy/ui_sso.py+++ b/litellm/types/proxy/ui_sso.py@@ -1,4 +1,6 @@-from typing import Literal, Optional, TypedDict+from typing import Literal, Optional++from typing_extensions import TypedDictclass ReturnedUITokenObject(TypedDict):diff --git a/litellm/types/realtime.py b/litellm/types/realtime.pyindex 73b60a223a4..1ec41f40b3d 100644--- a/litellm/types/realtime.py+++ b/litellm/types/realtime.py@@ -1,4 +1,6 @@-from typing import List, Literal, Optional, TypedDict, Union+from typing import List, Literal, Optional, Union++from typing_extensions import TypedDictfrom .llms.openai import (OpenAIRealtimeEvents,diff --git a/litellm/utils.py b/litellm/utils.pyindex 0d35f95bbe0..d279ce5c14b 100644--- a/litellm/utils.py+++ b/litellm/utils.py@@ -4616,7 +4616,7 @@ def _check_provider_match(model_info: dict, custom_llm_provider: Optional[str])return True-from typing import TypedDict+from typing_extensions import TypedDictclass PotentialModelNamesAndCustomLLMProvider(TypedDict):