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 use consistent naming (#7092)
Ishaan Jaff36e99ebce72c
diff --git a/litellm/__init__.py b/litellm/__init__.pyindex 8101e1a4991..542ab89c915 100644--- a/litellm/__init__.py+++ b/litellm/__init__.py@@ -1167,18 +1167,18 @@ from .llms.jina_ai.embedding.transformation import JinaAIEmbeddingConfigfrom .llms.xai.chat.xai_transformation import XAIChatConfigfrom .llms.volcengine import VolcEngineConfigfrom .llms.text_completion_codestral import MistralTextCompletionConfig-from .llms.AzureOpenAI.azure import (+from .llms.azure.azure import (AzureOpenAIError,AzureOpenAIAssistantsAPIConfig,)-from .llms.AzureOpenAI.chat.gpt_transformation import AzureOpenAIConfig+from .llms.azure.chat.gpt_transformation import AzureOpenAIConfigfrom .llms.hosted_vllm.chat.transformation import HostedVLLMChatConfigfrom .llms.deepseek.chat.transformation import DeepSeekChatConfigfrom .llms.lm_studio.chat.transformation import LMStudioChatConfigfrom .llms.lm_studio.embed.transformation import LmStudioEmbeddingConfigfrom .llms.perplexity.chat.transformation import PerplexityChatConfig-from .llms.AzureOpenAI.chat.o1_transformation import AzureOpenAIO1Config+from .llms.azure.chat.o1_transformation import AzureOpenAIO1Configfrom .llms.watsonx.completion.handler import IBMWatsonXAIConfigfrom .llms.watsonx.chat.transformation import IBMWatsonXChatConfigfrom .main import * # type: ignorediff --git a/litellm/assistants/main.py b/litellm/assistants/main.pyindex d9b4b648fe2..4c71554fa2e 100644--- a/litellm/assistants/main.py+++ b/litellm/assistants/main.py@@ -12,7 +12,7 @@ from openai.types.beta.assistant import Assistantfrom openai.types.beta.assistant_deleted import AssistantDeletedimport litellm-from litellm.llms.AzureOpenAI import assistants+from litellm.llms.azure import assistantsfrom litellm.types.router import GenericLiteLLMParamsfrom litellm.utils import (exception_type,@@ -21,7 +21,7 @@ from litellm.utils import (supports_httpx_timeout,)-from ..llms.AzureOpenAI.assistants import AzureAssistantsAPI+from ..llms.azure.assistants import AzureAssistantsAPIfrom ..llms.OpenAI.openai import OpenAIAssistantsAPIfrom ..types.llms.openai import *from ..types.router import *diff --git a/litellm/batches/main.py b/litellm/batches/main.pyindex 4d04068a261..af449248010 100644--- a/litellm/batches/main.py+++ b/litellm/batches/main.py@@ -20,7 +20,7 @@ import httpximport litellmfrom litellm import client-from litellm.llms.AzureOpenAI.azure import AzureBatchesAPI+from litellm.llms.azure.azure import AzureBatchesAPIfrom litellm.llms.OpenAI.openai import OpenAIBatchesAPIfrom litellm.llms.vertex_ai_and_google_ai_studio.batches.handler import (VertexAIBatchPrediction,diff --git a/litellm/cost_calculator.py b/litellm/cost_calculator.pyindex 9b455604d5c..b9c67870e20 100644--- a/litellm/cost_calculator.py+++ b/litellm/cost_calculator.py@@ -22,12 +22,12 @@ from litellm.litellm_core_utils.llm_cost_calc.utils import _generic_cost_per_chafrom litellm.llms.anthropic.cost_calculation import (cost_per_token as anthropic_cost_per_token,)+from litellm.llms.azure.cost_calculation import (+ cost_per_token as azure_openai_cost_per_token,+)from litellm.llms.azure_ai.cost_calculator import (cost_per_query as azure_ai_rerank_cost_per_query,)-from litellm.llms.AzureOpenAI.cost_calculation import (- cost_per_token as azure_openai_cost_per_token,-)from litellm.llms.bedrock.image.cost_calculator import (cost_calculator as bedrock_image_cost_calculator,)diff --git a/litellm/llms/AzureOpenAI/assistants.py b/litellm/llms/azure/assistants.pysimilarity index 100%rename from litellm/llms/AzureOpenAI/assistants.pyrename to litellm/llms/azure/assistants.pydiff --git a/litellm/llms/AzureOpenAI/audio_transcriptions.py b/litellm/llms/azure/audio_transcriptions.pysimilarity index 100%rename from litellm/llms/AzureOpenAI/audio_transcriptions.pyrename to litellm/llms/azure/audio_transcriptions.pydiff --git a/litellm/llms/AzureOpenAI/azure.py b/litellm/llms/azure/azure.pysimilarity index 100%rename from litellm/llms/AzureOpenAI/azure.pyrename to litellm/llms/azure/azure.pydiff --git a/litellm/llms/AzureOpenAI/chat/gpt_transformation.py b/litellm/llms/azure/chat/gpt_transformation.pysimilarity index 100%rename from litellm/llms/AzureOpenAI/chat/gpt_transformation.pyrename to litellm/llms/azure/chat/gpt_transformation.pydiff --git a/litellm/llms/AzureOpenAI/chat/o1_handler.py b/litellm/llms/azure/chat/o1_handler.pysimilarity index 100%rename from litellm/llms/AzureOpenAI/chat/o1_handler.pyrename to litellm/llms/azure/chat/o1_handler.pydiff --git a/litellm/llms/AzureOpenAI/chat/o1_transformation.py b/litellm/llms/azure/chat/o1_transformation.pysimilarity index 100%rename from litellm/llms/AzureOpenAI/chat/o1_transformation.pyrename to litellm/llms/azure/chat/o1_transformation.pydiff --git a/litellm/llms/AzureOpenAI/common_utils.py b/litellm/llms/azure/common_utils.pysimilarity index 100%rename from litellm/llms/AzureOpenAI/common_utils.pyrename to litellm/llms/azure/common_utils.pydiff --git a/litellm/llms/AzureOpenAI/cost_calculation.py b/litellm/llms/azure/cost_calculation.pysimilarity index 100%rename from litellm/llms/AzureOpenAI/cost_calculation.pyrename to litellm/llms/azure/cost_calculation.pydiff --git a/litellm/llms/AzureOpenAI/realtime/handler.py b/litellm/llms/azure/realtime/handler.pysimilarity index 100%rename from litellm/llms/AzureOpenAI/realtime/handler.pyrename to litellm/llms/azure/realtime/handler.pydiff --git a/litellm/main.py b/litellm/main.pyindex 3a8159c3f5d..29ee9015468 100644--- a/litellm/main.py+++ b/litellm/main.py@@ -102,12 +102,12 @@ from .llms import (from .llms.ai21 import completion as ai21from .llms.anthropic.chat import AnthropicChatCompletionfrom .llms.anthropic.completion import AnthropicTextCompletion+from .llms.azure.audio_transcriptions import AzureAudioTranscription+from .llms.azure.azure import AzureChatCompletion, _check_dynamic_azure_params+from .llms.azure.chat.o1_handler import AzureOpenAIO1ChatCompletionfrom .llms.azure_ai.chat import AzureAIChatCompletionfrom .llms.azure_ai.embed import AzureAIEmbeddingfrom .llms.azure_text import AzureTextCompletion-from .llms.AzureOpenAI.audio_transcriptions import AzureAudioTranscription-from .llms.AzureOpenAI.azure import AzureChatCompletion, _check_dynamic_azure_params-from .llms.AzureOpenAI.chat.o1_handler import AzureOpenAIO1ChatCompletionfrom .llms.bedrock.chat import BedrockConverseLLM, BedrockLLMfrom .llms.bedrock.embed.embedding import BedrockEmbeddingfrom .llms.bedrock.image.image_handler import BedrockImageGenerationdiff --git a/litellm/realtime_api/main.py b/litellm/realtime_api/main.pyindex 9088a491c0d..b17662c62cd 100644--- a/litellm/realtime_api/main.py+++ b/litellm/realtime_api/main.py@@ -9,7 +9,7 @@ from litellm.secret_managers.main import get_secret_strfrom litellm.types.router import GenericLiteLLMParamsfrom ..litellm_core_utils.litellm_logging import Logging as LiteLLMLogging-from ..llms.AzureOpenAI.realtime.handler import AzureOpenAIRealtime+from ..llms.azure.realtime.handler import AzureOpenAIRealtimefrom ..llms.OpenAI.realtime.handler import OpenAIRealtimefrom ..utils import client as wrapper_clientdiff --git a/litellm/router.py b/litellm/router.pyindex 34143bd5000..c9cfab55568 100644--- a/litellm/router.py+++ b/litellm/router.py@@ -54,7 +54,7 @@ from litellm.caching.caching import DualCache, InMemoryCache, RedisCachefrom litellm.integrations.custom_logger import CustomLoggerfrom litellm.litellm_core_utils.core_helpers import _get_parent_otel_span_from_kwargsfrom litellm.litellm_core_utils.litellm_logging import Logging as LiteLLMLogging-from litellm.llms.AzureOpenAI.azure import get_azure_ad_token_from_oidc+from litellm.llms.azure.azure import get_azure_ad_token_from_oidcfrom litellm.router_strategy.least_busy import LeastBusyLoggingHandlerfrom litellm.router_strategy.lowest_cost import LowestCostLoggingHandlerfrom litellm.router_strategy.lowest_latency import LowestLatencyLoggingHandlerdiff --git a/litellm/router_utils/client_initalization_utils.py b/litellm/router_utils/client_initalization_utils.pyindex db8f20ee6b7..8a11edce8f1 100644--- a/litellm/router_utils/client_initalization_utils.py+++ b/litellm/router_utils/client_initalization_utils.py@@ -9,7 +9,7 @@ import openaiimport litellmfrom litellm import get_secret, get_secret_strfrom litellm._logging import verbose_router_logger-from litellm.llms.AzureOpenAI.azure import get_azure_ad_token_from_oidc+from litellm.llms.azure.azure import get_azure_ad_token_from_oidcfrom litellm.secret_managers.get_azure_ad_token_provider import (get_azure_ad_token_provider,)@@ -359,7 +359,7 @@ class InitalizeOpenAISDKClient:azure_client_params["azure_ad_token_provider"] = (azure_ad_token_provider)- from litellm.llms.AzureOpenAI.azure import (+ from litellm.llms.azure.azure import (select_azure_base_url_or_endpoint,)diff --git a/tests/llm_translation/test_azure_openai.py b/tests/llm_translation/test_azure_openai.pyindex 837714770f0..9bf16a5cf5b 100644--- a/tests/llm_translation/test_azure_openai.py+++ b/tests/llm_translation/test_azure_openai.py@@ -6,7 +6,7 @@ sys.path.insert() # Adds the parent directory to the system pathimport pytest-from litellm.llms.AzureOpenAI.common_utils import process_azure_headers+from litellm.llms.azure.common_utils import process_azure_headersfrom httpx import Headers@@ -172,7 +172,7 @@ def test_azure_extra_headers(input, call_type):],)def test_process_azure_endpoint_url(api_base, model, expected_endpoint):- from litellm.llms.AzureOpenAI.azure import AzureChatCompletion+ from litellm.llms.azure.azure import AzureChatCompletionazure_chat_completion = AzureChatCompletion()input_args = {diff --git a/tests/llm_translation/test_max_completion_tokens.py b/tests/llm_translation/test_max_completion_tokens.pyindex 03eb638757b..363125a6038 100644--- a/tests/llm_translation/test_max_completion_tokens.py+++ b/tests/llm_translation/test_max_completion_tokens.py@@ -231,7 +231,7 @@ def test_all_model_configs():optional_params={},) == {"max_tokens": 10}- from litellm.llms.AzureOpenAI.chat.gpt_transformation import AzureOpenAIConfig+ from litellm.llms.azure.chat.gpt_transformation import AzureOpenAIConfigassert "max_completion_tokens" in AzureOpenAIConfig().get_supported_openai_params()assert AzureOpenAIConfig().map_openai_params(diff --git a/tests/local_testing/test_secret_manager.py b/tests/local_testing/test_secret_manager.pyindex 1b95119a312..66f63809d9f 100644--- a/tests/local_testing/test_secret_manager.py+++ b/tests/local_testing/test_secret_manager.py@@ -16,7 +16,7 @@ sys.path.insert() # Adds the parent directory to the system pathimport pytestimport litellm-from litellm.llms.AzureOpenAI.azure import get_azure_ad_token_from_oidc+from litellm.llms.azure.azure import get_azure_ad_token_from_oidcfrom litellm.llms.bedrock.chat import BedrockConverseLLM, BedrockLLMfrom litellm.secret_managers.aws_secret_manager_v2 import AWSSecretsManagerV2from litellm.secret_managers.main import (