From 16d3d28138008d001eeb0d64e57af352b263ddae Mon Sep 17 00:00:00 2001 From: octo-patch <266937838+octo-patch@users.noreply.github.com> Date: Wed, 29 Jul 2026 15:34:43 +0000 Subject: [PATCH] Enable MiniMax models and wire their image/video request format Add minimax/MiniMax-M3 and minimax/MiniMax-M2.7 to the allowed model list and format MiniMax multimodal messages using the OpenAI-compatible image_url/video_url schema so MiniMax-M3 can be used for image and video evaluation instead of raising on multimodal input. --- mllm_tools/litellm.py | 31 ++++++++++++++++++++++++++++++- src/utils/allowed_models.json | 4 +++- 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/mllm_tools/litellm.py b/mllm_tools/litellm.py index 4873494ad..a266b7f3b 100644 --- a/mllm_tools/litellm.py +++ b/mllm_tools/litellm.py @@ -148,8 +148,37 @@ def __call__(self, messages: List[Dict[str, Any]], metadata: Optional[Dict[str, }) else: raise ValueError("For GPT, only text and image inferencing are supported") + elif "minimax" in self.model_name.lower(): + # MiniMax uses the OpenAI-compatible content schema and + # supports both image and video inputs. + if msg["type"] == "image": + formatted_messages.append({ + "role": "user", + "content": [ + { + "type": "image_url", + "image_url": { + "url": data_url + } + } + ] + }) + elif msg["type"] == "video": + formatted_messages.append({ + "role": "user", + "content": [ + { + "type": "video_url", + "video_url": { + "url": data_url + } + } + ] + }) + else: + raise ValueError("For MiniMax, only text, image and video inferencing are supported") else: - raise ValueError("Only support Gemini and Gpt for Multimodal capability now") + raise ValueError("Only support Gemini, Gpt and MiniMax for Multimodal capability now") try: # if it's openai o series model, set temperature to None and reasoning_effort to "medium" diff --git a/src/utils/allowed_models.json b/src/utils/allowed_models.json index 2ca44ee76..35071367a 100644 --- a/src/utils/allowed_models.json +++ b/src/utils/allowed_models.json @@ -13,6 +13,8 @@ "bedrock/anthropic.claude-3-5-sonnet-20240620-v1:0", "bedrock/anthropic.claude-3-5-sonnet-20241022-v2:0", "bedrock/anthropic.claude-3-5-haiku-20241022-v1:0", - "bedrock/us.anthropic.claude-3-7-sonnet-20250219-v1:0" + "bedrock/us.anthropic.claude-3-7-sonnet-20250219-v1:0", + "minimax/MiniMax-M3", + "minimax/MiniMax-M2.7" ] } \ No newline at end of file