From 4bae4d00f5cf0fc480218040d358987e97058783 Mon Sep 17 00:00:00 2001 From: Sameer Kankute Date: Tue, 23 Dec 2025 16:09:35 +0530 Subject: [PATCH] Add: transformation file for minmax anthropic endpoint --- litellm/litellm_core_utils/get_llm_provider_logic.py | 5 ++++- litellm/types/utils.py | 1 + litellm/utils.py | 6 ++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/litellm/litellm_core_utils/get_llm_provider_logic.py b/litellm/litellm_core_utils/get_llm_provider_logic.py index a23fce891b9..a707bdedad3 100644 --- a/litellm/litellm_core_utils/get_llm_provider_logic.py +++ b/litellm/litellm_core_utils/get_llm_provider_logic.py @@ -4,8 +4,8 @@ import httpx import litellm from litellm.constants import REPLICATE_MODEL_NAME_WITH_ID_LENGTH -from litellm.secret_managers.main import get_secret, get_secret_str from litellm.llms.openai_like.json_loader import JSONProviderRegistry +from litellm.secret_managers.main import get_secret, get_secret_str from ..types.router import LiteLLM_Params @@ -267,6 +267,9 @@ def get_llm_provider( # noqa: PLR0915 elif endpoint == "api.moonshot.ai/v1": custom_llm_provider = "moonshot" dynamic_api_key = get_secret_str("MOONSHOT_API_KEY") + elif endpoint == "api.minimax.io/anthropic" or endpoint == "api.minimaxi.com/anthropic": + custom_llm_provider = "minimax" + dynamic_api_key = get_secret_str("MINIMAX_API_KEY") elif endpoint == "platform.publicai.co/v1": custom_llm_provider = "publicai" dynamic_api_key = get_secret_str("PUBLICAI_API_KEY") diff --git a/litellm/types/utils.py b/litellm/types/utils.py index 3416459bc28..47d9ece5e37 100644 --- a/litellm/types/utils.py +++ b/litellm/types/utils.py @@ -3014,6 +3014,7 @@ class LlmProviders(str, Enum): AMAZON_NOVA = "amazon_nova" A2A_AGENT = "a2a_agent" LANGGRAPH = "langgraph" + MINIMAX = "minimax" # Create a set of all provider values for quick lookup diff --git a/litellm/utils.py b/litellm/utils.py index 805fbafcfce..c0e4dd8c052 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -7501,6 +7501,12 @@ class ProviderConfigManager: ) return AzureAnthropicMessagesConfig() + elif litellm.LlmProviders.MINIMAX == provider: + from litellm.llms.minimax.messages.transformation import ( + MinimaxMessagesConfig, + ) + + return MinimaxMessagesConfig() return None @staticmethod