mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-09 03:18:44 +00:00
Add Vertex MiniMAX m2 (#16373)
This commit is contained in:
parent
99a8a304c1
commit
940a72ceb0
5 changed files with 49 additions and 2 deletions
|
|
@ -480,6 +480,7 @@ vertex_deepseek_models: Set = set()
|
|||
vertex_ai_ai21_models: Set = set()
|
||||
vertex_mistral_models: Set = set()
|
||||
vertex_openai_models: Set = set()
|
||||
vertex_minimax_models: Set = set()
|
||||
ai21_models: Set = set()
|
||||
ai21_chat_models: Set = set()
|
||||
nlp_cloud_models: Set = set()
|
||||
|
|
@ -640,6 +641,9 @@ def add_known_models():
|
|||
elif value.get("litellm_provider") == "vertex_ai-openai_models":
|
||||
key = key.replace("vertex_ai/", "")
|
||||
vertex_openai_models.add(key)
|
||||
elif value.get("litellm_provider") == "vertex_ai-minimax_models":
|
||||
key = key.replace("vertex_ai/", "")
|
||||
vertex_minimax_models.add(key)
|
||||
elif value.get("litellm_provider") == "ai21":
|
||||
if value.get("mode") == "chat":
|
||||
ai21_chat_models.add(key)
|
||||
|
|
@ -895,7 +899,8 @@ models_by_provider: dict = {
|
|||
| vertex_anthropic_models
|
||||
| vertex_vision_models
|
||||
| vertex_language_models
|
||||
| vertex_deepseek_models,
|
||||
| vertex_deepseek_models
|
||||
| vertex_minimax_models,
|
||||
"ai21": ai21_models,
|
||||
"bedrock": bedrock_models | bedrock_converse_models,
|
||||
"petals": petals_models,
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ class PartnerModelPrefixes(str, Enum):
|
|||
CLAUDE_PREFIX = "claude"
|
||||
QWEN_PREFIX = "qwen"
|
||||
GPT_OSS_PREFIX = "openai/gpt-oss-"
|
||||
MINIMAX_PREFIX = "minimaxai/"
|
||||
|
||||
|
||||
class VertexAIPartnerModels(VertexBase):
|
||||
|
|
@ -62,6 +63,7 @@ class VertexAIPartnerModels(VertexBase):
|
|||
or model.startswith(PartnerModelPrefixes.CLAUDE_PREFIX)
|
||||
or model.startswith(PartnerModelPrefixes.QWEN_PREFIX)
|
||||
or model.startswith(PartnerModelPrefixes.GPT_OSS_PREFIX)
|
||||
or model.startswith(PartnerModelPrefixes.MINIMAX_PREFIX)
|
||||
):
|
||||
return True
|
||||
return False
|
||||
|
|
@ -73,6 +75,7 @@ class VertexAIPartnerModels(VertexBase):
|
|||
PartnerModelPrefixes.DEEPSEEK_PREFIX,
|
||||
PartnerModelPrefixes.QWEN_PREFIX,
|
||||
PartnerModelPrefixes.GPT_OSS_PREFIX,
|
||||
PartnerModelPrefixes.MINIMAX_PREFIX,
|
||||
]
|
||||
if any(provider in model for provider in OPENAI_LIKE_VERTEX_PROVIDERS):
|
||||
return True
|
||||
|
|
|
|||
|
|
@ -23096,6 +23096,18 @@
|
|||
"source": "https://cloud.google.com/vertex-ai/generative-ai/pricing#partner-models",
|
||||
"supports_tool_choice": true
|
||||
},
|
||||
"vertex_ai/minimaxai/minimax-m2-maas": {
|
||||
"input_cost_per_token": 3e-07,
|
||||
"litellm_provider": "vertex_ai-minimax_models",
|
||||
"max_input_tokens": 196608,
|
||||
"max_output_tokens": 196608,
|
||||
"max_tokens": 196608,
|
||||
"mode": "chat",
|
||||
"output_cost_per_token": 1.2e-06,
|
||||
"source": "https://cloud.google.com/vertex-ai/generative-ai/pricing#partner-models",
|
||||
"supports_function_calling": true,
|
||||
"supports_tool_choice": true
|
||||
},
|
||||
"vertex_ai/mistral-medium-3": {
|
||||
"input_cost_per_token": 4e-07,
|
||||
"litellm_provider": "vertex_ai-mistral_models",
|
||||
|
|
|
|||
|
|
@ -23098,6 +23098,18 @@
|
|||
"source": "https://cloud.google.com/vertex-ai/generative-ai/pricing#partner-models",
|
||||
"supports_tool_choice": true
|
||||
},
|
||||
"vertex_ai/minimaxai/minimax-m2-maas": {
|
||||
"input_cost_per_token": 3e-07,
|
||||
"litellm_provider": "vertex_ai-minimax_models",
|
||||
"max_input_tokens": 196608,
|
||||
"max_output_tokens": 196608,
|
||||
"max_tokens": 196608,
|
||||
"mode": "chat",
|
||||
"output_cost_per_token": 1.2e-06,
|
||||
"source": "https://cloud.google.com/vertex-ai/generative-ai/pricing#partner-models",
|
||||
"supports_function_calling": true,
|
||||
"supports_tool_choice": true
|
||||
},
|
||||
"vertex_ai/mistral-medium-3": {
|
||||
"input_cost_per_token": 4e-07,
|
||||
"litellm_provider": "vertex_ai-mistral_models",
|
||||
|
|
|
|||
|
|
@ -965,6 +965,8 @@ async def test_vertex_ai_partner_model_detection():
|
|||
|
||||
# Test Meta/Llama models
|
||||
assert VertexAIPartnerModels.is_vertex_partner_model("meta/llama-3.1-405b")
|
||||
# Test Minimax models
|
||||
assert VertexAIPartnerModels.is_vertex_partner_model("minimaxai/minimax-m2-maas")
|
||||
|
||||
# Test Gemini models (should NOT be detected as partner model)
|
||||
assert not VertexAIPartnerModels.is_vertex_partner_model("gemini-1.5-pro")
|
||||
|
|
@ -973,4 +975,17 @@ async def test_vertex_ai_partner_model_detection():
|
|||
|
||||
# Test other non-partner models
|
||||
assert not VertexAIPartnerModels.is_vertex_partner_model("text-bison-001")
|
||||
assert not VertexAIPartnerModels.is_vertex_partner_model("chat-bison-001")
|
||||
assert not VertexAIPartnerModels.is_vertex_partner_model("chat-bison-001")
|
||||
|
||||
|
||||
def test_vertex_ai_minimax_uses_openai_handler():
|
||||
"""
|
||||
Ensure Minimax partner models re-use the OpenAI-format handler.
|
||||
"""
|
||||
from litellm.llms.vertex_ai.vertex_ai_partner_models.main import (
|
||||
VertexAIPartnerModels,
|
||||
)
|
||||
|
||||
assert VertexAIPartnerModels.should_use_openai_handler(
|
||||
"minimaxai/minimax-m2-maas"
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue