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
(Refactor) Code Quality improvement - remove `/prompt_templates/` , `base_aws_llm.py` from `/llms` folder (#7164)
Ishaan Jaffb5d55688e53b
diff --git a/litellm/integrations/argilla.py b/litellm/integrations/argilla.pyindex 352543d82cf..d4719591f02 100644--- a/litellm/integrations/argilla.py+++ b/litellm/integrations/argilla.py@@ -27,7 +27,7 @@ from litellm.llms.custom_httpx.http_handler import (get_async_httpx_client,httpxSpecialProvider,)-from litellm.llms.prompt_templates.common_utils import get_content_from_model_response+from litellm.litellm_core_utils.prompt_templates.common_utils import get_content_from_model_responsefrom litellm.types.integrations.argilla import (SUPPORTED_PAYLOAD_FIELDS,ArgillaCredentialsObject,diff --git a/litellm/llms/prompt_templates/common_utils.py b/litellm/litellm_core_utils/prompt_templates/common_utils.pysimilarity index 100%rename from litellm/llms/prompt_templates/common_utils.pyrename to litellm/litellm_core_utils/prompt_templates/common_utils.pydiff --git a/litellm/llms/prompt_templates/factory.py b/litellm/litellm_core_utils/prompt_templates/factory.pysimilarity index 100%rename from litellm/llms/prompt_templates/factory.pyrename to litellm/litellm_core_utils/prompt_templates/factory.pydiff --git a/litellm/llms/prompt_templates/image_handling.py b/litellm/litellm_core_utils/prompt_templates/image_handling.pysimilarity index 100%rename from litellm/llms/prompt_templates/image_handling.pyrename to litellm/litellm_core_utils/prompt_templates/image_handling.pydiff --git a/litellm/llms/anthropic/chat/transformation.py b/litellm/llms/anthropic/chat/transformation.pyindex 84549528863..860ba5eae85 100644--- a/litellm/llms/anthropic/chat/transformation.py+++ b/litellm/llms/anthropic/chat/transformation.py@@ -21,7 +21,7 @@ import requestsimport litellmfrom litellm.litellm_core_utils.core_helpers import map_finish_reasonfrom litellm.llms.base_llm.transformation import BaseConfig, BaseLLMException-from litellm.llms.prompt_templates.factory import anthropic_messages_pt+from litellm.litellm_core_utils.prompt_templates.factory import anthropic_messages_ptfrom litellm.types.llms.anthropic import (AllAnthropicToolsValues,AnthropicComputerTool,diff --git a/litellm/llms/anthropic/completion/transformation.py b/litellm/llms/anthropic/completion/transformation.pyindex e556b833baf..2435d7d4adc 100644--- a/litellm/llms/anthropic/completion/transformation.py+++ b/litellm/llms/anthropic/completion/transformation.py@@ -17,7 +17,7 @@ from litellm.llms.base_llm.transformation import (BaseLLMException,LiteLLMLoggingObj,)-from litellm.llms.prompt_templates.factory import custom_prompt, prompt_factory+from litellm.litellm_core_utils.prompt_templates.factory import custom_prompt, prompt_factoryfrom litellm.types.llms.openai import AllMessageValuesfrom litellm.types.utils import (ChatCompletionToolCallChunk,diff --git a/litellm/llms/anthropic/experimental_pass_through/transformation.py b/litellm/llms/anthropic/experimental_pass_through/transformation.pyindex 8d77c40af85..5de232e1ebd 100644--- a/litellm/llms/anthropic/experimental_pass_through/transformation.py+++ b/litellm/llms/anthropic/experimental_pass_through/transformation.py@@ -57,7 +57,7 @@ from litellm.types.utils import Choices, GenericStreamingChunkfrom litellm.utils import CustomStreamWrapper, ModelResponse, Usagefrom ...base import BaseLLM-from ...prompt_templates.factory import (+from litellm.litellm_core_utils.prompt_templates.factory import (anthropic_messages_pt,custom_prompt,prompt_factory,diff --git a/litellm/llms/azure/chat/gpt_transformation.py b/litellm/llms/azure/chat/gpt_transformation.pyindex 4e308d0ea29..bd737af2fb5 100644--- a/litellm/llms/azure/chat/gpt_transformation.py+++ b/litellm/llms/azure/chat/gpt_transformation.py@@ -14,8 +14,9 @@ from ....types.llms.openai import (ChatCompletionToolParam,ChatCompletionToolParamFunctionChunk,)+from ...base_llm.transformation import BaseConfig-from ...prompt_templates.factory import convert_to_azure_openai_messages+from litellm.litellm_core_utils.prompt_templates.factory import convert_to_azure_openai_messagesfrom ..common_utils import AzureOpenAIErrorif TYPE_CHECKING:@@ -25,7 +26,6 @@ if TYPE_CHECKING:else:LoggingClass = Any-class AzureOpenAIConfig(BaseConfig):"""Reference: https://learn.microsoft.com/en-us/azure/ai-services/openai/reference#chat-completionsdiff --git a/litellm/llms/azure/completion/handler.py b/litellm/llms/azure/completion/handler.pyindex 193776fd1d4..889d40d16f6 100644--- a/litellm/llms/azure/completion/handler.py+++ b/litellm/llms/azure/completion/handler.py@@ -22,7 +22,7 @@ from litellm.utils import (from ...base import BaseLLMfrom ...openai.completion.handler import OpenAITextCompletionfrom ...openai.completion.transformation import OpenAITextCompletionConfig-from ...prompt_templates.factory import custom_prompt, prompt_factory+from litellm.litellm_core_utils.prompt_templates.factory import custom_prompt, prompt_factoryfrom ..common_utils import AzureOpenAIErroropenai_text_completion_config = OpenAITextCompletionConfig()diff --git a/litellm/llms/azure_ai/chat/transformation.py b/litellm/llms/azure_ai/chat/transformation.pyindex e32e8f1685f..bce48e6fc01 100644--- a/litellm/llms/azure_ai/chat/transformation.py+++ b/litellm/llms/azure_ai/chat/transformation.py@@ -3,7 +3,7 @@ from typing import List, Optional, Tupleimport litellmfrom litellm._logging import verbose_loggerfrom litellm.llms.openai.openai import OpenAIConfig-from litellm.llms.prompt_templates.common_utils import (+from litellm.litellm_core_utils.prompt_templates.common_utils import (_audio_or_image_in_message_content,convert_content_list_to_str,)diff --git a/litellm/llms/base_aws_llm.py b/litellm/llms/bedrock/base_aws_llm.pysimilarity index 99%rename from litellm/llms/base_aws_llm.pyrename to litellm/llms/bedrock/base_aws_llm.pyindex 9f3a58a8be8..9df9204b6c9 100644--- a/litellm/llms/base_aws_llm.py+++ b/litellm/llms/bedrock/base_aws_llm.py@@ -10,7 +10,7 @@ from litellm._logging import verbose_loggerfrom litellm.caching.caching import DualCache, InMemoryCachefrom litellm.secret_managers.main import get_secret, get_secret_str-from .base import BaseLLM+from litellm.llms.base import BaseLLMif TYPE_CHECKING:from botocore.credentials import Credentialsdiff --git a/litellm/llms/bedrock/chat/converse_handler.py b/litellm/llms/bedrock/chat/converse_handler.pyindex 743e596f8e2..4b1f1b4f70a 100644--- a/litellm/llms/bedrock/chat/converse_handler.py+++ b/litellm/llms/bedrock/chat/converse_handler.py@@ -14,7 +14,7 @@ from litellm.llms.custom_httpx.http_handler import (from litellm.types.utils import ModelResponsefrom litellm.utils import CustomStreamWrapper, get_secret-from ...base_aws_llm import BaseAWSLLM+from ..base_aws_llm import BaseAWSLLMfrom ..common_utils import BedrockErrorfrom .invoke_handler import AWSEventStreamDecoder, MockResponseIterator, make_calldiff --git a/litellm/llms/bedrock/chat/converse_transformation.py b/litellm/llms/bedrock/chat/converse_transformation.pyindex 728fd83bc97..34c8b43657d 100644--- a/litellm/llms/bedrock/chat/converse_transformation.py+++ b/litellm/llms/bedrock/chat/converse_transformation.py@@ -24,7 +24,7 @@ from litellm.types.llms.openai import (from litellm.types.utils import ModelResponse, Usagefrom litellm.utils import CustomStreamWrapper, add_dummy_tool, has_tool_call_blocks-from ...prompt_templates.factory import _bedrock_converse_messages_pt, _bedrock_tools_pt+from litellm.litellm_core_utils.prompt_templates.factory import _bedrock_converse_messages_pt, _bedrock_tools_ptfrom ..common_utils import BedrockError, get_bedrock_tool_namediff --git a/litellm/llms/bedrock/chat/invoke_handler.py b/litellm/llms/bedrock/chat/invoke_handler.pyindex 3a72cf80576..a2a8228e272 100644--- a/litellm/llms/bedrock/chat/invoke_handler.py+++ b/litellm/llms/bedrock/chat/invoke_handler.py@@ -52,8 +52,8 @@ from litellm.types.llms.openai import (from litellm.types.utils import GenericStreamingChunk as GChunkfrom litellm.utils import CustomStreamWrapper, ModelResponse, Usage, get_secret-from ...base_aws_llm import BaseAWSLLM-from ...prompt_templates.factory import (+from ..base_aws_llm import BaseAWSLLM+from litellm.litellm_core_utils.prompt_templates.factory import (_bedrock_converse_messages_pt,_bedrock_tools_pt,cohere_message_pt,diff --git a/litellm/llms/bedrock/embed/embedding.py b/litellm/llms/bedrock/embed/embedding.pyindex 7a8591a94a2..9cb97f72f84 100644--- a/litellm/llms/bedrock/embed/embedding.py+++ b/litellm/llms/bedrock/embed/embedding.py@@ -22,7 +22,7 @@ from litellm.secret_managers.main import get_secretfrom litellm.types.llms.bedrock import AmazonEmbeddingRequest, CohereEmbeddingRequestfrom litellm.types.utils import Embedding, EmbeddingResponse, Usage-from ...base_aws_llm import BaseAWSLLM+from ..base_aws_llm import BaseAWSLLMfrom ..common_utils import BedrockErrorfrom .amazon_titan_g1_transformation import AmazonTitanG1Configfrom .amazon_titan_multimodal_transformation import (diff --git a/litellm/llms/bedrock/image/image_handler.py b/litellm/llms/bedrock/image/image_handler.pyindex 31af2910f9f..a32161c2227 100644--- a/litellm/llms/bedrock/image/image_handler.py+++ b/litellm/llms/bedrock/image/image_handler.py@@ -16,7 +16,7 @@ from litellm.llms.custom_httpx.http_handler import ()from litellm.types.utils import ImageResponse-from ...base_aws_llm import BaseAWSLLM+from ..base_aws_llm import BaseAWSLLMfrom ..common_utils import BedrockErrorif TYPE_CHECKING:diff --git a/litellm/llms/bedrock/rerank/handler.py b/litellm/llms/bedrock/rerank/handler.pyindex d604760e351..e11ed8d84a0 100644--- a/litellm/llms/bedrock/rerank/handler.py+++ b/litellm/llms/bedrock/rerank/handler.py@@ -18,7 +18,7 @@ from litellm.types.llms.bedrock import BedrockPreparedRequest, BedrockRerankRequfrom litellm.types.rerank import RerankRequestfrom litellm.types.utils import RerankResponse-from ...base_aws_llm import BaseAWSLLM+from ..base_aws_llm import BaseAWSLLMfrom ..common_utils import BedrockErrorfrom .transformation import BedrockRerankConfigdiff --git a/litellm/llms/clarifai/chat/transformation.py b/litellm/llms/clarifai/chat/transformation.pyindex 9eb48031800..53ddfcdfa61 100644--- a/litellm/llms/clarifai/chat/transformation.py+++ b/litellm/llms/clarifai/chat/transformation.py@@ -7,7 +7,7 @@ import httpximport litellmfrom litellm.llms.base_llm.base_model_iterator import FakeStreamResponseIteratorfrom litellm.llms.base_llm.transformation import BaseConfig, BaseLLMException-from litellm.llms.prompt_templates.common_utils import convert_content_list_to_str+from litellm.litellm_core_utils.prompt_templates.common_utils import convert_content_list_to_strfrom litellm.types.llms.openai import AllMessageValuesfrom litellm.types.utils import (ChatCompletionToolCallChunk,diff --git a/litellm/llms/cohere/chat/transformation.py b/litellm/llms/cohere/chat/transformation.pyindex 204137f793f..8002bf914f7 100644--- a/litellm/llms/cohere/chat/transformation.py+++ b/litellm/llms/cohere/chat/transformation.py@@ -6,7 +6,7 @@ import httpximport litellmfrom litellm.llms.base_llm.transformation import BaseConfig, BaseLLMException-from litellm.llms.prompt_templates.factory import cohere_messages_pt_v2+from litellm.litellm_core_utils.prompt_templates.factory import cohere_messages_pt_v2from litellm.types.llms.openai import AllMessageValuesfrom litellm.types.utils import ModelResponse, Usagediff --git a/litellm/llms/cohere/completion/transformation.py b/litellm/llms/cohere/completion/transformation.pyindex b94d6d24e66..2240d4ea711 100644--- a/litellm/llms/cohere/completion/transformation.py+++ b/litellm/llms/cohere/completion/transformation.py@@ -7,7 +7,7 @@ import httpximport litellmfrom litellm.llms.base_llm.transformation import BaseConfig, BaseLLMException-from litellm.llms.prompt_templates.common_utils import convert_content_list_to_str+from litellm.litellm_core_utils.prompt_templates.common_utils import convert_content_list_to_strfrom litellm.types.llms.openai import AllMessageValuesfrom litellm.types.utils import (ChatCompletionToolCallChunk,diff --git a/litellm/llms/custom_llm.py b/litellm/llms/custom_llm.pyindex de09df19c04..c19ba621b95 100644--- a/litellm/llms/custom_llm.py+++ b/litellm/llms/custom_llm.py@@ -45,8 +45,6 @@ from litellm.utils import ()from .base import BaseLLM-from .prompt_templates.factory import custom_prompt, prompt_factory-class CustomLLMError(Exception): # use this for all your exceptionsdef __init__(diff --git a/litellm/llms/databricks/chat/transformation.py b/litellm/llms/databricks/chat/transformation.pyindex 584b413373d..581eb1366c8 100644--- a/litellm/llms/databricks/chat/transformation.py+++ b/litellm/llms/databricks/chat/transformation.py@@ -11,7 +11,7 @@ from litellm.types.llms.openai import AllMessageValuesfrom litellm.types.utils import ProviderFieldfrom ...openai_like.chat.transformation import OpenAILikeChatConfig-from ...prompt_templates.common_utils import (+from litellm.litellm_core_utils.prompt_templates.common_utils import (handle_messages_with_content_list_to_str_conversion,strip_name_from_messages,)diff --git a/litellm/llms/deepseek/chat/transformation.py b/litellm/llms/deepseek/chat/transformation.pyindex 650bae07738..288b1b7c16a 100644--- a/litellm/llms/deepseek/chat/transformation.py+++ b/litellm/llms/deepseek/chat/transformation.py@@ -13,7 +13,7 @@ from litellm.types.llms.openai import AllMessageValues, ChatCompletionAssistantMfrom ....utils import _remove_additional_properties, _remove_strict_from_schemafrom ...openai.chat.gpt_transformation import OpenAIGPTConfig-from ...prompt_templates.common_utils import (+from litellm.litellm_core_utils.prompt_templates.common_utils import (handle_messages_with_content_list_to_str_conversion,)diff --git a/litellm/llms/huggingface/chat/handler.py b/litellm/llms/huggingface/chat/handler.pyindex 608bfc6ed88..1ba31d490ce 100644--- a/litellm/llms/huggingface/chat/handler.py+++ b/litellm/llms/huggingface/chat/handler.py@@ -40,7 +40,6 @@ from litellm.types.utils import Logprobs as TextCompletionLogprobsfrom litellm.utils import Choices, CustomStreamWrapper, Message, ModelResponse, Usagefrom ...base import BaseLLM-from ...prompt_templates.factory import custom_prompt, prompt_factoryfrom ..common_utils import HuggingfaceError, hf_task_list, hf_taskshf_chat_config = HuggingfaceConfig()diff --git a/litellm/llms/huggingface/chat/transformation.py b/litellm/llms/huggingface/chat/transformation.pyindex 8880ec41c35..155fc8dc816 100644--- a/litellm/llms/huggingface/chat/transformation.py+++ b/litellm/llms/huggingface/chat/transformation.py@@ -10,8 +10,8 @@ import httpximport litellmfrom litellm.litellm_core_utils.streaming_handler import CustomStreamWrapperfrom litellm.llms.base_llm.transformation import BaseConfig, BaseLLMException-from litellm.llms.prompt_templates.common_utils import convert_content_list_to_str-from litellm.llms.prompt_templates.factory import custom_prompt, prompt_factory+from litellm.litellm_core_utils.prompt_templates.common_utils import convert_content_list_to_str+from litellm.litellm_core_utils.prompt_templates.factory import custom_prompt, prompt_factoryfrom litellm.secret_managers.main import get_secret_strfrom litellm.types.llms.openai import AllMessageValuesfrom litellm.types.utils import Choices, Message, ModelResponse, Usagediff --git a/litellm/llms/mistral/mistral_chat_transformation.py b/litellm/llms/mistral/mistral_chat_transformation.pyindex 50f08771c1b..2279e807fcc 100644--- a/litellm/llms/mistral/mistral_chat_transformation.py+++ b/litellm/llms/mistral/mistral_chat_transformation.py@@ -10,7 +10,7 @@ import typesfrom typing import List, Literal, Optional, Tuple, Unionfrom litellm.llms.openai.chat.gpt_transformation import OpenAIGPTConfig-from litellm.llms.prompt_templates.common_utils import (+from litellm.litellm_core_utils.prompt_templates.common_utils import (handle_messages_with_content_list_to_str_conversion,strip_none_values_from_message,)diff --git a/litellm/llms/nlp_cloud/chat/transformation.py b/litellm/llms/nlp_cloud/chat/transformation.pyindex ec5540ca626..e547f38d22c 100644--- a/litellm/llms/nlp_cloud/chat/transformation.py+++ b/litellm/llms/nlp_cloud/chat/transformation.py@@ -5,7 +5,7 @@ from typing import TYPE_CHECKING, Any, List, Optional, Unionimport httpxfrom litellm.llms.base_llm.transformation import BaseConfig, BaseLLMException-from litellm.llms.prompt_templates.common_utils import convert_content_list_to_str+from litellm.litellm_core_utils.prompt_templates.common_utils import convert_content_list_to_strfrom litellm.types.llms.openai import AllMessageValuesfrom litellm.utils import ModelResponse, Usagediff --git a/litellm/llms/ollama/completion/handler.py b/litellm/llms/ollama/completion/handler.pyindex 74a9501deb1..5d6e2ef2dc8 100644--- a/litellm/llms/ollama/completion/handler.py+++ b/litellm/llms/ollama/completion/handler.py@@ -18,7 +18,7 @@ from litellm.llms.custom_httpx.http_handler import get_async_httpx_clientfrom litellm.secret_managers.main import get_secret_strfrom litellm.types.utils import ModelInfo, ProviderField, StreamingChoices-from ...prompt_templates.factory import custom_prompt, prompt_factory+from litellm.litellm_core_utils.prompt_templates.factory import custom_prompt, prompt_factoryfrom ..common_utils import OllamaErrorfrom .transformation import OllamaConfigdiff --git a/litellm/llms/oobabooga/chat/oobabooga.py b/litellm/llms/oobabooga/chat/oobabooga.pyindex b7852eed49d..96b50ebbc45 100644--- a/litellm/llms/oobabooga/chat/oobabooga.py+++ b/litellm/llms/oobabooga/chat/oobabooga.py@@ -9,7 +9,7 @@ import requests # type: ignorefrom litellm.llms.custom_httpx.http_handler import HTTPHandler, _get_httpx_clientfrom litellm.utils import EmbeddingResponse, ModelResponse, Usage-from ...prompt_templates.factory import custom_prompt, prompt_factory+from litellm.litellm_core_utils.prompt_templates.factory import custom_prompt, prompt_factoryfrom ..common_utils import OobaboogaErrorfrom .transformation import OobaboogaConfigdiff --git a/litellm/llms/oobabooga/chat/transformation.py b/litellm/llms/oobabooga/chat/transformation.pyindex 18944a7b80e..6780991bea3 100644--- a/litellm/llms/oobabooga/chat/transformation.py+++ b/litellm/llms/oobabooga/chat/transformation.py@@ -8,8 +8,6 @@ import httpximport litellmfrom litellm.llms.base_llm.transformation import BaseConfig, BaseLLMExceptionfrom litellm.llms.openai.chat.gpt_transformation import OpenAIGPTConfig-from litellm.llms.prompt_templates.common_utils import convert_content_list_to_str-from litellm.llms.prompt_templates.factory import custom_prompt, prompt_factoryfrom litellm.types.llms.openai import AllMessageValuesfrom litellm.types.utils import Choices, Message, ModelResponse, Usagefrom litellm.utils import token_counterdiff --git a/litellm/llms/openai/completion/transformation.py b/litellm/llms/openai/completion/transformation.pyindex cb6baba3393..e7ff85d557f 100644--- a/litellm/llms/openai/completion/transformation.py+++ b/litellm/llms/openai/completion/transformation.py@@ -14,7 +14,7 @@ from litellm.types.llms.openai import ()from litellm.types.utils import Choices, Message, ModelResponse, TextCompletionResponse-from ...prompt_templates.common_utils import convert_content_list_to_str+from litellm.litellm_core_utils.prompt_templates.common_utils import convert_content_list_to_strfrom ..chat.gpt_transformation import OpenAIGPTConfigfrom ..common_utils import OpenAIErrorfrom .utils import is_tokens_or_list_of_tokensdiff --git a/litellm/llms/openai/openai.py b/litellm/llms/openai/openai.pyindex 54f52c50fef..cc1552ba0bd 100644--- a/litellm/llms/openai/openai.py+++ b/litellm/llms/openai/openai.py@@ -45,7 +45,7 @@ from litellm.utils import (from ...types.llms.openai import *from ..base import BaseLLM-from ..prompt_templates.factory import custom_prompt, prompt_factory+from litellm.litellm_core_utils.prompt_templates.factory import custom_prompt, prompt_factoryfrom .chat.gpt_transformation import OpenAIGPTConfigfrom .common_utils import OpenAIError, drop_params_from_unprocessable_entity_errordiff --git a/litellm/llms/petals.py b/litellm/llms/petals.pyindex 28e27e5dfee..9194781f4f6 100644--- a/litellm/llms/petals.py+++ b/litellm/llms/petals.py@@ -10,7 +10,7 @@ import requests # type: ignoreimport litellmfrom litellm.utils import ModelResponse, Usage-from .prompt_templates.factory import custom_prompt, prompt_factory+from litellm.litellm_core_utils.prompt_templates.factory import custom_prompt, prompt_factoryclass PetalsError(Exception):diff --git a/litellm/llms/predibase.py b/litellm/llms/predibase.pyindex e80964551e2..66698124643 100644--- a/litellm/llms/predibase.py+++ b/litellm/llms/predibase.py@@ -26,7 +26,7 @@ from litellm.llms.custom_httpx.http_handler import (from litellm.utils import Choices, CustomStreamWrapper, Message, ModelResponse, Usagefrom .base import BaseLLM-from .prompt_templates.factory import custom_prompt, prompt_factory+from litellm.litellm_core_utils.prompt_templates.factory import custom_prompt, prompt_factoryclass PredibaseError(Exception):diff --git a/litellm/llms/replicate/chat/handler.py b/litellm/llms/replicate/chat/handler.pyindex 898f350bace..4f7a1156991 100644--- a/litellm/llms/replicate/chat/handler.py+++ b/litellm/llms/replicate/chat/handler.py@@ -17,7 +17,6 @@ from litellm.llms.custom_httpx.http_handler import (from litellm.types.llms.openai import AllMessageValuesfrom litellm.utils import CustomStreamWrapper, ModelResponse, Usage-from ...prompt_templates.factory import custom_prompt, prompt_factoryfrom ..common_utils import ReplicateErrorfrom .transformation import ReplicateConfigdiff --git a/litellm/llms/replicate/chat/transformation.py b/litellm/llms/replicate/chat/transformation.pyindex 180c67271ed..184a2cb8098 100644--- a/litellm/llms/replicate/chat/transformation.py+++ b/litellm/llms/replicate/chat/transformation.py@@ -5,8 +5,8 @@ import httpximport litellmfrom litellm.llms.base_llm.transformation import BaseConfig, BaseLLMException-from litellm.llms.prompt_templates.common_utils import convert_content_list_to_str-from litellm.llms.prompt_templates.factory import custom_prompt, prompt_factory+from litellm.litellm_core_utils.prompt_templates.common_utils import convert_content_list_to_str+from litellm.litellm_core_utils.prompt_templates.factory import custom_prompt, prompt_factoryfrom litellm.types.llms.openai import AllMessageValuesfrom litellm.types.utils import Choices, Message, ModelResponse, Usagefrom litellm.utils import token_counterdiff --git a/litellm/llms/sagemaker/chat/handler.py b/litellm/llms/sagemaker/chat/handler.pyindex f7024b94e32..5daa91277d5 100644--- a/litellm/llms/sagemaker/chat/handler.py+++ b/litellm/llms/sagemaker/chat/handler.py@@ -6,8 +6,8 @@ import httpxfrom litellm.utils import ModelResponse, get_secret-from ...base_aws_llm import BaseAWSLLM-from ...prompt_templates.factory import custom_prompt, prompt_factory+from litellm.llms.bedrock.base_aws_llm import BaseAWSLLM+from litellm.litellm_core_utils.prompt_templates.factory import custom_prompt, prompt_factoryfrom ..common_utils import AWSEventStreamDecoderfrom .transformation import SagemakerChatConfigdiff --git a/litellm/llms/sagemaker/completion/handler.py b/litellm/llms/sagemaker/completion/handler.pyindex a0961621fd4..41744f25433 100644--- a/litellm/llms/sagemaker/completion/handler.py+++ b/litellm/llms/sagemaker/completion/handler.py@@ -31,8 +31,8 @@ from litellm.utils import (get_secret,)-from ...base_aws_llm import BaseAWSLLM-from ...prompt_templates.factory import custom_prompt, prompt_factory+from litellm.llms.bedrock.base_aws_llm import BaseAWSLLM+from litellm.litellm_core_utils.prompt_templates.factory import custom_prompt, prompt_factoryfrom ..common_utils import AWSEventStreamDecoder, SagemakerErrorfrom .transformation import SagemakerConfigdiff --git a/litellm/llms/sagemaker/completion/transformation.py b/litellm/llms/sagemaker/completion/transformation.pyindex 91efa86adfa..f7bac46b6f3 100644--- a/litellm/llms/sagemaker/completion/transformation.py+++ b/litellm/llms/sagemaker/completion/transformation.py@@ -14,7 +14,7 @@ from httpx._models import Headers, Responseimport litellmfrom litellm.litellm_core_utils.asyncify import asyncifyfrom litellm.llms.base_llm.transformation import BaseConfig, BaseLLMException-from litellm.llms.prompt_templates.factory import custom_prompt, prompt_factory+from litellm.litellm_core_utils.prompt_templates.factory import custom_prompt, prompt_factoryfrom litellm.types.llms.openai import AllMessageValuesfrom litellm.types.utils import Usagediff --git a/litellm/llms/text_completion_codestral.py b/litellm/llms/text_completion_codestral.pyindex f951b897b81..035da49409b 100644--- a/litellm/llms/text_completion_codestral.py+++ b/litellm/llms/text_completion_codestral.py@@ -33,7 +33,7 @@ from litellm.utils import ()from .base import BaseLLM-from .prompt_templates.factory import custom_prompt, prompt_factory+from litellm.litellm_core_utils.prompt_templates.factory import custom_prompt, prompt_factoryclass TextCompletionCodestralError(Exception):diff --git a/litellm/llms/triton.py b/litellm/llms/triton.pyindex efd0d0a2d19..dd715fda44e 100644--- a/litellm/llms/triton.py+++ b/litellm/llms/triton.py@@ -25,7 +25,7 @@ from litellm.utils import ()from .base import BaseLLM-from .prompt_templates.factory import custom_prompt, prompt_factory+from litellm.litellm_core_utils.prompt_templates.factory import custom_prompt, prompt_factoryclass TritonError(Exception):diff --git a/litellm/llms/vertex_ai_and_google_ai_studio/gemini/transformation.py b/litellm/llms/vertex_ai_and_google_ai_studio/gemini/transformation.pyindex 7e16571f555..d67419767ae 100644--- a/litellm/llms/vertex_ai_and_google_ai_studio/gemini/transformation.py+++ b/litellm/llms/vertex_ai_and_google_ai_studio/gemini/transformation.py@@ -13,7 +13,7 @@ from pydantic import BaseModelimport litellmfrom litellm._logging import verbose_loggerfrom litellm.llms.custom_httpx.http_handler import AsyncHTTPHandler, HTTPHandler-from litellm.llms.prompt_templates.factory import (+from litellm.litellm_core_utils.prompt_templates.factory import (convert_to_anthropic_image_obj,convert_to_gemini_tool_call_invoke,convert_to_gemini_tool_call_result,diff --git a/litellm/llms/vertex_ai_and_google_ai_studio/gemini/vertex_and_google_ai_studio_gemini.py b/litellm/llms/vertex_ai_and_google_ai_studio/gemini/vertex_and_google_ai_studio_gemini.pyindex 454da4d4afc..09b74ad9929 100644--- a/litellm/llms/vertex_ai_and_google_ai_studio/gemini/vertex_and_google_ai_studio_gemini.py+++ b/litellm/llms/vertex_ai_and_google_ai_studio/gemini/vertex_and_google_ai_studio_gemini.py@@ -37,7 +37,7 @@ from litellm.llms.custom_httpx.http_handler import (HTTPHandler,get_async_httpx_client,)-from litellm.llms.prompt_templates.factory import (+from litellm.litellm_core_utils.prompt_templates.factory import (convert_generic_image_chunk_to_openai_image_obj,convert_to_anthropic_image_obj,)diff --git a/litellm/llms/vertex_ai_and_google_ai_studio/vertex_ai_non_gemini.py b/litellm/llms/vertex_ai_and_google_ai_studio/vertex_ai_non_gemini.pyindex 829bf652890..d365cfac14b 100644--- a/litellm/llms/vertex_ai_and_google_ai_studio/vertex_ai_non_gemini.py+++ b/litellm/llms/vertex_ai_and_google_ai_studio/vertex_ai_non_gemini.py@@ -15,7 +15,7 @@ import litellmfrom litellm._logging import verbose_loggerfrom litellm.litellm_core_utils.core_helpers import map_finish_reasonfrom litellm.llms.custom_httpx.http_handler import _DEFAULT_TTL_FOR_HTTPX_CLIENTS-from litellm.llms.prompt_templates.factory import (+from litellm.litellm_core_utils.prompt_templates.factory import (convert_to_anthropic_image_obj,convert_to_gemini_tool_call_invoke,convert_to_gemini_tool_call_result,diff --git a/litellm/llms/vertex_ai_and_google_ai_studio/vertex_ai_partner_models/anthropic/transformation.py b/litellm/llms/vertex_ai_and_google_ai_studio/vertex_ai_partner_models/anthropic/transformation.pyindex 882a1aed271..93031656c25 100644--- a/litellm/llms/vertex_ai_and_google_ai_studio/vertex_ai_partner_models/anthropic/transformation.py+++ b/litellm/llms/vertex_ai_and_google_ai_studio/vertex_ai_partner_models/anthropic/transformation.py@@ -24,7 +24,7 @@ from litellm.types.utils import ResponseFormatChunkfrom litellm.utils import CustomStreamWrapper, ModelResponse, Usagefrom ....anthropic.chat.transformation import AnthropicConfig-from ....prompt_templates.factory import (+from litellm.litellm_core_utils.prompt_templates.factory import (construct_tool_use_system_prompt,contains_tag,custom_prompt,diff --git a/litellm/llms/vllm/completion/handler.py b/litellm/llms/vllm/completion/handler.pyindex 34cb52d126d..b2371ffca3c 100644--- a/litellm/llms/vllm/completion/handler.py+++ b/litellm/llms/vllm/completion/handler.py@@ -9,7 +9,7 @@ import requests # type: ignorefrom litellm.utils import ModelResponse, Usage-from ...prompt_templates.factory import custom_prompt, prompt_factory+from litellm.litellm_core_utils.prompt_templates.factory import custom_prompt, prompt_factoryllm = Nonediff --git a/litellm/llms/watsonx/completion/handler.py b/litellm/llms/watsonx/completion/handler.pyindex 9cd884e3f61..599338c3081 100644--- a/litellm/llms/watsonx/completion/handler.py+++ b/litellm/llms/watsonx/completion/handler.py@@ -34,7 +34,7 @@ from litellm.types.llms.watsonx import WatsonXAIEndpointfrom litellm.utils import EmbeddingResponse, ModelResponse, Usage, map_finish_reasonfrom ...base import BaseLLM-from ...prompt_templates import factory as ptf+from litellm.litellm_core_utils.prompt_templates import factory as ptffrom ..common_utils import WatsonXAIError, _get_api_params, generate_iam_tokenfrom .transformation import IBMWatsonXAIConfigdiff --git a/litellm/llms/watsonx/completion/transformation.py b/litellm/llms/watsonx/completion/transformation.pyindex 6f2b1881067..9e68be930e2 100644--- a/litellm/llms/watsonx/completion/transformation.py+++ b/litellm/llms/watsonx/completion/transformation.py@@ -36,7 +36,7 @@ from litellm.utils import EmbeddingResponse, ModelResponse, Usage, map_finish_refrom ...base import BaseLLMfrom ...base_llm.transformation import BaseConfig-from ...prompt_templates import factory as ptf+from litellm.litellm_core_utils.prompt_templates import factory as ptffrom ..common_utils import WatsonXAIError, _get_api_params, generate_iam_tokenif TYPE_CHECKING:diff --git a/litellm/main.py b/litellm/main.pyindex cab0c7167d7..e524a3b73ce 100644--- a/litellm/main.py+++ b/litellm/main.py@@ -57,7 +57,7 @@ from litellm.litellm_core_utils.mock_functions import (mock_image_generation,)from litellm.llms.custom_httpx.http_handler import AsyncHTTPHandler, HTTPHandler-from litellm.llms.prompt_templates.common_utils import get_content_from_model_response+from litellm.litellm_core_utils.prompt_templates.common_utils import get_content_from_model_responsefrom litellm.secret_managers.main import get_secret_strfrom litellm.utils import (CustomStreamWrapper,@@ -110,8 +110,8 @@ from .llms.openai.openai import OpenAIChatCompletionfrom .llms.openai_like.chat.handler import OpenAILikeChatHandlerfrom .llms.openai_like.embedding.handler import OpenAILikeEmbeddingHandlerfrom .llms.predibase import PredibaseChatCompletion-from .llms.prompt_templates.common_utils import get_completion_messages-from .llms.prompt_templates.factory import (+from .litellm_core_utils.prompt_templates.common_utils import get_completion_messages+from .litellm_core_utils.prompt_templates.factory import (custom_prompt,function_call_prompt,map_system_message_pt,diff --git a/litellm/proxy/guardrails/guardrail_hooks/bedrock_guardrails.py b/litellm/proxy/guardrails/guardrail_hooks/bedrock_guardrails.pyindex ef41ce9b1ba..db5972a7cf0 100644--- a/litellm/proxy/guardrails/guardrail_hooks/bedrock_guardrails.py+++ b/litellm/proxy/guardrails/guardrail_hooks/bedrock_guardrails.py@@ -30,7 +30,7 @@ from litellm.integrations.custom_guardrail import CustomGuardrailfrom litellm.litellm_core_utils.logging_utils import (convert_litellm_response_object_to_str,)-from litellm.llms.base_aws_llm import BaseAWSLLM+from litellm.llms.bedrock.base_aws_llm import BaseAWSLLMfrom litellm.llms.custom_httpx.http_handler import (AsyncHTTPHandler,get_async_httpx_client,diff --git a/litellm/proxy/guardrails/guardrail_hooks/guardrails_ai.py b/litellm/proxy/guardrails/guardrail_hooks/guardrails_ai.pyindex c8d8900139a..2dd08432a74 100644--- a/litellm/proxy/guardrails/guardrail_hooks/guardrails_ai.py+++ b/litellm/proxy/guardrails/guardrail_hooks/guardrails_ai.py@@ -14,7 +14,7 @@ import litellmfrom litellm._logging import verbose_proxy_loggerfrom litellm.caching.caching import DualCachefrom litellm.integrations.custom_guardrail import CustomGuardrail-from litellm.llms.prompt_templates.common_utils import (+from litellm.litellm_core_utils.prompt_templates.common_utils import (convert_openai_message_to_only_content_messages,get_content_from_model_response,)diff --git a/litellm/proxy/hooks/prompt_injection_detection.py b/litellm/proxy/hooks/prompt_injection_detection.pyindex bbe820ffdea..be4eb79885d 100644--- a/litellm/proxy/hooks/prompt_injection_detection.py+++ b/litellm/proxy/hooks/prompt_injection_detection.py@@ -20,7 +20,7 @@ import litellmfrom litellm._logging import verbose_proxy_loggerfrom litellm.caching.caching import DualCachefrom litellm.integrations.custom_logger import CustomLogger-from litellm.llms.prompt_templates.factory import prompt_injection_detection_default_pt+from litellm.litellm_core_utils.prompt_templates.factory import prompt_injection_detection_default_ptfrom litellm.proxy._types import LiteLLMPromptInjectionParams, UserAPIKeyAuthfrom litellm.utils import get_formatted_promptdiff --git a/litellm/secret_managers/aws_secret_manager_v2.py b/litellm/secret_managers/aws_secret_manager_v2.pyindex 32653f57dc1..acee00b929c 100644--- a/litellm/secret_managers/aws_secret_manager_v2.py+++ b/litellm/secret_managers/aws_secret_manager_v2.py@@ -26,14 +26,13 @@ import httpximport litellmfrom litellm._logging import verbose_logger-from litellm.llms.base_aws_llm import BaseAWSLLMfrom litellm.llms.custom_httpx.http_handler import (_get_httpx_client,get_async_httpx_client,)from litellm.proxy._types import KeyManagementSystemfrom litellm.types.llms.custom_http import httpxSpecialProvider-+from litellm.llms.bedrock.base_aws_llm import BaseAWSLLMclass AWSSecretsManagerV2(BaseAWSLLM):@classmethoddiff --git a/tests/code_coverage_tests/enforce_llms_folder_style.py b/tests/code_coverage_tests/enforce_llms_folder_style.pynew file mode 100644index 00000000000..7f7c2c3be1e--- /dev/null+++ b/tests/code_coverage_tests/enforce_llms_folder_style.py@@ -0,0 +1,61 @@+import ast+import os+import sys++sys.path.insert(+ 0, os.path.abspath("../..")+)++import litellm++ALLOWED_FILES_IN_LLMS_FOLDER = ["__init__", "base", "base_llm", "custom_httpx", "custom_llm", "deprecated_providers"]++def get_unique_names_from_llms_dir(base_dir="./litellm/llms/"):+ """+ Returns a set of unique file and folder names from the root level of litellm/llms directory,+ excluding file extensions and __init__.py+ """+ unique_names = set()++ if not os.path.exists(base_dir):+ print(f"Warning: Directory {base_dir} does not exist.")+ return unique_names++ # Get only root level items+ items = os.listdir(base_dir)++ for item in items:+ item_path = os.path.join(base_dir, item)++ if os.path.isdir(item_path):+ if item != "__pycache__":+ unique_names.add(item)+ elif item.endswith(".py") and item != "__init__.py":+ name_without_ext = os.path.splitext(item)[0]+ unique_names.add(name_without_ext)++ return unique_names+++def run_lint_check(unique_names):+ _all_litellm_providers = [str(provider.value) for provider in litellm.LlmProviders]+ violations = []+ for name in unique_names:+ if name.lower() not in _all_litellm_providers and name not in ALLOWED_FILES_IN_LLMS_FOLDER:+ violations.append(name)++ if len(violations) > 0:+ raise ValueError(f"There are {len(violations)} violations in the llms folder. \n\n {violations}. \n\n Valid providers: {_all_litellm_providers}")++def main():+ llms_dir = "./litellm/llms/" # Update this path if needed+ llms_dir = "../../litellm/llms/" # LOCAL TESTING++ unique_names = get_unique_names_from_llms_dir(llms_dir)+ print("Unique names in llms directory:", sorted(list(unique_names)))+ run_lint_check(unique_names)++++if __name__ == "__main__":+ main()\ No newline at end of filediff --git a/tests/llm_translation/test_anthropic_completion.py b/tests/llm_translation/test_anthropic_completion.pyindex 32d0ef1a4fe..967b2d27229 100644--- a/tests/llm_translation/test_anthropic_completion.py+++ b/tests/llm_translation/test_anthropic_completion.py@@ -670,7 +670,7 @@ class TestAnthropicCompletion(BaseLLMChatTest):def test_tool_call_no_arguments(self, tool_call_no_arguments):"""Test that tool calls with no arguments is translated correctly. Relevant issue: https://github.com/BerriAI/litellm/issues/6833"""- from litellm.llms.prompt_templates.factory import (+ from litellm.litellm_core_utils.prompt_templates.factory import (convert_to_anthropic_tool_invoke,)@@ -767,7 +767,7 @@ def test_convert_tool_response_to_message_no_arguments():def test_anthropic_tool_with_image():- from litellm.llms.prompt_templates.factory import prompt_factory+ from litellm.litellm_core_utils.prompt_templates.factory import prompt_factoryimport jsonb64_data = "iVBORw0KGgoAAAANSUhEu6U3//C9t/fKv5wDgpP1r5796XwC4zyH1D565bHGDqbY85AMb0nIQe+u3J390Xbtb9XgXxcK0/aqRXpdYcwgARbCN03FJk"diff --git a/tests/llm_translation/test_bedrock_completion.py b/tests/llm_translation/test_bedrock_completion.pyindex 62803e40a2f..651424b313f 100644--- a/tests/llm_translation/test_bedrock_completion.py+++ b/tests/llm_translation/test_bedrock_completion.py@@ -33,7 +33,7 @@ from litellm import ()from litellm.llms.bedrock.chat import BedrockLLMfrom litellm.llms.custom_httpx.http_handler import AsyncHTTPHandler, HTTPHandler-from litellm.llms.prompt_templates.factory import _bedrock_tools_pt+from litellm.litellm_core_utils.prompt_templates.factory import _bedrock_tools_ptfrom base_llm_unit_tests import BaseLLMChatTestfrom base_rerank_unit_tests import BaseLLMRerankTest@@ -1262,7 +1262,7 @@ def test_bedrock_get_base_model(model, expected_base_model):assert litellm.AmazonConverseConfig()._get_base_model(model) == expected_base_model-from litellm.llms.prompt_templates.factory import _bedrock_converse_messages_pt+from litellm.litellm_core_utils.prompt_templates.factory import _bedrock_converse_messages_ptdef test_bedrock_converse_translation_tool_message():@@ -1320,7 +1320,7 @@ def test_base_aws_llm_get_credentials():import boto3- from litellm.llms.base_aws_llm import BaseAWSLLM+ from litellm.llms.bedrock.base_aws_llm import BaseAWSLLMstart_time = time.time()session = boto3.Session(@@ -1603,7 +1603,7 @@ def test_bedrock_completion_test_3():Check if content in tool result is formatted correctly"""from litellm.types.utils import ChatCompletionMessageToolCall, Function, Message- from litellm.llms.prompt_templates.factory import _bedrock_converse_messages_pt+ from litellm.litellm_core_utils.prompt_templates.factory import _bedrock_converse_messages_ptmessages = [{diff --git a/tests/llm_translation/test_gemini.py b/tests/llm_translation/test_gemini.pyindex 4e6c5118dc2..23b6f7dde7c 100644--- a/tests/llm_translation/test_gemini.py+++ b/tests/llm_translation/test_gemini.py@@ -7,7 +7,7 @@ class TestGoogleAIStudioGemini(BaseLLMChatTest):def test_tool_call_no_arguments(self, tool_call_no_arguments):"""Test that tool calls with no arguments is translated correctly. Relevant issue: https://github.com/BerriAI/litellm/issues/6833"""- from litellm.llms.prompt_templates.factory import (+ from litellm.litellm_core_utils.prompt_templates.factory import (convert_to_gemini_tool_call_invoke,)diff --git a/tests/llm_translation/test_optional_params.py b/tests/llm_translation/test_optional_params.pyindex 8acfbf0863b..bfd5ee2a476 100644--- a/tests/llm_translation/test_optional_params.py+++ b/tests/llm_translation/test_optional_params.py@@ -13,7 +13,7 @@ sys.path.insert(0, os.path.abspath("../.."))from unittest.mock import MagicMock, patchimport litellm-from litellm.llms.prompt_templates.factory import map_system_message_pt+from litellm.litellm_core_utils.prompt_templates.factory import map_system_message_ptfrom litellm.types.completion import (ChatCompletionMessageParam,ChatCompletionSystemMessageParam,diff --git a/tests/llm_translation/test_prompt_factory.py b/tests/llm_translation/test_prompt_factory.pyindex 005c62113ad..735deb84cef 100644--- a/tests/llm_translation/test_prompt_factory.py+++ b/tests/llm_translation/test_prompt_factory.py@@ -9,10 +9,10 @@ sys.path.insert(0, os.path.abspath("../.."))from typing import Union-# from litellm.llms.prompt_templates.factory import prompt_factory+# from litellm.litellm_core_utils.prompt_templates.factory import prompt_factoryimport litellmfrom litellm import completion-from litellm.llms.prompt_templates.factory import (+from litellm.litellm_core_utils.prompt_templates.factory import (_bedrock_tools_pt,anthropic_messages_pt,anthropic_pt,@@ -22,7 +22,7 @@ from litellm.llms.prompt_templates.factory import (llama_2_chat_pt,prompt_factory,)-from litellm.llms.prompt_templates.common_utils import (+from litellm.litellm_core_utils.prompt_templates.common_utils import (get_completion_messages,)from litellm.llms.vertex_ai_and_google_ai_studio.gemini.transformation import (@@ -327,7 +327,7 @@ def test_bedrock_parallel_tool_calling_pt(provider):"""Make sure parallel tool call blocks are merged correctly - https://github.com/BerriAI/litellm/issues/5277"""- from litellm.llms.prompt_templates.factory import _bedrock_converse_messages_pt+ from litellm.litellm_core_utils.prompt_templates.factory import _bedrock_converse_messages_ptfrom litellm.types.utils import ChatCompletionMessageToolCall, Function, Messagemessages = [@@ -682,7 +682,7 @@ def test_alternating_roles_e2e():def test_just_system_message():- from litellm.llms.prompt_templates.factory import _bedrock_converse_messages_pt+ from litellm.litellm_core_utils.prompt_templates.factory import _bedrock_converse_messages_ptwith pytest.raises(litellm.BadRequestError) as e:_bedrock_converse_messages_pt(@@ -694,7 +694,7 @@ def test_just_system_message():def test_convert_generic_image_chunk_to_openai_image_obj():- from litellm.llms.prompt_templates.factory import (+ from litellm.litellm_core_utils.prompt_templates.factory import (convert_generic_image_chunk_to_openai_image_obj,convert_to_anthropic_image_obj,)diff --git a/tests/local_testing/test_anthropic_prompt_caching.py b/tests/local_testing/test_anthropic_prompt_caching.pyindex cdee1938470..ad63072d74d 100644--- a/tests/local_testing/test_anthropic_prompt_caching.py+++ b/tests/local_testing/test_anthropic_prompt_caching.py@@ -23,7 +23,7 @@ import pytestimport litellmfrom litellm import RateLimitError, Timeout, completion, completion_cost, embeddingfrom litellm.llms.custom_httpx.http_handler import AsyncHTTPHandler, HTTPHandler-from litellm.llms.prompt_templates.factory import anthropic_messages_pt+from litellm.litellm_core_utils.prompt_templates.factory import anthropic_messages_pt# litellm.num_retries =3litellm.cache = Nonediff --git a/tests/local_testing/test_azure_openai.py b/tests/local_testing/test_azure_openai.pyindex fa4226b1493..013a775370c 100644--- a/tests/local_testing/test_azure_openai.py+++ b/tests/local_testing/test_azure_openai.py@@ -27,7 +27,7 @@ from respx import MockRouterimport litellmfrom litellm import RateLimitError, Timeout, completion, completion_cost, embeddingfrom litellm.llms.custom_httpx.http_handler import AsyncHTTPHandler, HTTPHandler-from litellm.llms.prompt_templates.factory import anthropic_messages_pt+from litellm.litellm_core_utils.prompt_templates.factory import anthropic_messages_ptfrom litellm.router import Routerdiff --git a/tests/local_testing/test_completion.py b/tests/local_testing/test_completion.pyindex 833dbb8ffaa..c95932bc55c 100644--- a/tests/local_testing/test_completion.py+++ b/tests/local_testing/test_completion.py@@ -22,7 +22,7 @@ import pytestimport litellmfrom litellm import RateLimitError, Timeout, completion, completion_cost, embeddingfrom litellm.llms.custom_httpx.http_handler import AsyncHTTPHandler, HTTPHandler-from litellm.llms.prompt_templates.factory import anthropic_messages_pt+from litellm.litellm_core_utils.prompt_templates.factory import anthropic_messages_pt# litellm.num_retries=3@@ -696,7 +696,7 @@ async def test_anthropic_no_content_error():def test_parse_xml_params():- from litellm.llms.prompt_templates.factory import parse_xml_params+ from litellm.litellm_core_utils.prompt_templates.factory import parse_xml_params## SCENARIO 1 ## - W/ ARRAYxml_content = """<invoke><tool_name>return_list_of_str</tool_name>\n<parameters>\n<value>\n<item>apple</item>\n<item>banana</item>\n<item>orange</item>\n</value>\n</parameters></invoke>"""diff --git a/tests/local_testing/test_hf_prompt_templates.py b/tests/local_testing/test_hf_prompt_templates.pyindex ea1e6a7d88f..b20f10bdfbd 100644--- a/tests/local_testing/test_hf_prompt_templates.py+++ b/tests/local_testing/test_hf_prompt_templates.py@@ -9,7 +9,7 @@ sys.path.insert(0, os.path.abspath("../..")) # Adds the parent directory to the system pathimport pytest-from litellm.llms.prompt_templates.factory import prompt_factory+from litellm.litellm_core_utils.prompt_templates.factory import prompt_factorydef test_prompt_formatting():diff --git a/tests/local_testing/test_sagemaker.py b/tests/local_testing/test_sagemaker.pyindex f602067338a..8438c3c6ba1 100644--- a/tests/local_testing/test_sagemaker.py+++ b/tests/local_testing/test_sagemaker.py@@ -23,7 +23,7 @@ import pytestimport litellmfrom litellm import RateLimitError, Timeout, completion, completion_cost, embeddingfrom litellm.llms.custom_httpx.http_handler import AsyncHTTPHandler, HTTPHandler-from litellm.llms.prompt_templates.factory import anthropic_messages_pt+from litellm.litellm_core_utils.prompt_templates.factory import anthropic_messages_pt# litellm.num_retries =3litellm.cache = None