From 6cf151e079d3757d0b1d4c9249fb023acbe77978 Mon Sep 17 00:00:00 2001 From: XprobeBot <122174228+XprobeBot@users.noreply.github.com> Date: Thu, 30 Oct 2025 21:28:08 +0800 Subject: [PATCH 1/5] chore: update xinference/model/llm/llm_family.json (llm) --- xinference/model/llm/llm_family.json | 45 ++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/xinference/model/llm/llm_family.json b/xinference/model/llm/llm_family.json index 689651bc7e..ba6970b9d6 100644 --- a/xinference/model/llm/llm_family.json +++ b/xinference/model/llm/llm_family.json @@ -22892,5 +22892,50 @@ "soundfile" ] } + }, + { + "model_name": "MiniMax-M2", + "model_description": "MiniMax-M2, a Mini model built for Max coding & agentic workflows.", + "context_length": 40960000, + "model_lang": [ + "en", + "zh" + ], + "model_ability": [ + "chat", + "tools", + "reasoning" + ], + "model_specs": [ + { + "model_size_in_billions": 230, + "model_format": "pytorch", + "model_src": { + "huggingface": { + "model_id": "MiniMaxAI/MiniMax-M2", + "quantizations": [ + "none" + ] + }, + "modelscope": { + "model_id": "MiniMax/MiniMax-M2", + "quantizations": [ + "none" + ] + } + } + } + ], + "chat_template": "{# ----------‑‑‑ special token variables ‑‑‑---------- #}\n{%- set toolcall_begin_token = '' -%}\n{%- set toolcall_end_token = '' -%}\n{#- Tool Rendering Functions ============================================== -#}\n{%- macro render_tool_namespace(namespace_name, tool_list) -%}\n{%- for tool in tool_list -%}\n{{ tool.function | tojson(ensure_ascii=False) }}\n{% endfor -%}\n{%- endmacro -%}\n{%- macro visible_text(content) -%}\n {%- if content is string -%}\n {{ content }}\n {%- elif content is iterable and content is not mapping -%}\n {%- for item in content -%}\n {%- if item is mapping and item.type == 'text' -%}\n {{- item.text }}\n {%- elif item is string -%}\n {{- item }}\n {%- endif -%}\n {%- endfor -%}\n {%- else -%}\n {{- content }}\n {%- endif -%}\n{%- endmacro -%}\n{#- System Message Construction ============================================ -#}\n{%- macro build_system_message(system_message) -%}\n {%- if system_message and system_message.content -%}\n {{- visible_text(system_message.content) }}\n {%- else -%}\n {%- if model_identity is not defined -%}\n {%- set model_identity = \"You are a helpful assistant.\" -%}\n {%- endif -%}\n {{- model_identity }}\n {%- endif -%}\n \n {#- Handle current_date -#}\n {%- if system_message and system_message.current_date -%}\n {{- '\\n' ~ 'Current date: ' + system_message.current_date }}\n {%- endif -%}\n {#- Handle current_location -#}\n {%- if system_message and system_message.current_location -%}\n {{- '\\n' ~ 'Current location: ' + system_message.current_location }}\n {%- endif -%}\n{%- endmacro -%}\n{#- Main Template Logic ================================================= -#}\n{#- Extract system message (only first message if it's system) -#}\n{%- set system_message = none -%}\n{%- set conversation_messages = messages -%}\n{%- if messages and messages[0].role == \"system\" -%}\n {%- set system_message = messages[0] -%}\n {%- set conversation_messages = messages[1:] -%}\n{%- endif -%}\n{#- Get the last user message turn, for interleved thinking -#}\n{%- set ns = namespace(last_user_index=-1) %}\n{% for m in conversation_messages %}\n {%- if m.role == 'user' %}\n {% set ns.last_user_index = loop.index0 -%}\n {%- endif %}\n{%- endfor %}\n{#- Render system message -#}\n{{- ']~!b[' ~ ']~b]system' ~ '\\n' }}\n{{- build_system_message(system_message) }}\n{#- Render tools if available -#}\n{%- if tools -%}\n {{- '\\n\\n' ~ '# Tools' ~ '\\n' ~ 'You may call one or more tools to assist with the user query.\\nHere are the tools available in JSONSchema format:' ~ '\\n' }}\n {{- '\\n' ~ '' ~ '\\n' }}\n {{- render_tool_namespace(\"functions\", tools) }}\n {{- '' ~ '\\n\\n' }}\n{{- 'When making tool calls, use XML format to invoke tools and pass parameters:' ~ '\\n' }}\n{{- '\\n' ~ toolcall_begin_token }}\n\nparam-value-1\nparam-value-2\n...\n\n{{- '\\n' ~ toolcall_end_token }}\n{%- endif -%}\n{{- '[e~[\\n' }}\n\n{#- Render messages -#}\n{%- set last_tool_call = namespace(name=none) -%}\n{%- for message in conversation_messages -%}\n {%- if message.role == 'assistant' -%}\n {#- Only render reasoning_content if no user message follows -#}\n {{- ']~b]ai' ~ '\\n' }}\n\n {%- set reasoning_content = '' %}\n {%- set content = visible_text(message.content) %}\n {%- if message.reasoning_content is string %}\n {%- set reasoning_content = message.reasoning_content %}\n {%- else %}\n {%- if '' in content %}\n {%- set reasoning_content = content.split('')[0].strip('\\n').split('')[-1].strip('\\n') %}\n {%- set content = content.split('')[-1].strip('\\n') %}\n {%- endif %}\n {%- endif %}\n {%- if reasoning_content and loop.index0 > ns.last_user_index -%}\n {{- '' ~ '\\n' ~ reasoning_content ~ '\\n' ~ '' ~ '\\n\\n' }}\n {%- endif -%}\n {%- if content -%}\n {{- content }}\n {%- endif -%}\n {%- if message.tool_calls -%}\n {{- '\\n' ~ toolcall_begin_token ~ '\\n' }}\n\n {%- for tool_call in message.tool_calls -%}\n {%- if tool_call.function %}\n {%- set tool_call = tool_call.function %}\n {%- endif %}\n {{- '' }}\n {% set _args = tool_call.arguments %}\n {%- for k, v in _args.items() %}\n {{- '' }}\n {{- v | tojson(ensure_ascii=False) if v is not string else v }}\n {{- '' }}\n {% endfor %}\n {{- '' ~ '\\n' }}\n {%- endfor -%}\n \n {{- toolcall_end_token}}\n {%- set last_tool_call.name = message.tool_calls[-1].name -%}\n {%- else -%}\n {%- set last_tool_call.name = none -%}\n {%- endif -%}\n {{- '[e~[' ~ '\\n' }}\n \n {%- elif message.role == 'tool' -%}\n {%- if last_tool_call.name is none -%}\n {{- raise_exception(\"Message has tool role, but there was no previous assistant message with a tool call!\") }}\n {%- endif -%}\n {%- if loop.first or (conversation_messages[loop.index0 - 1].role != 'tool') -%}\n {{- ']~b]tool' }}\n {%- endif -%}\n {%- if message.content is string -%}\n {{- '\\n' }}\n {{- message.content }}\n {{- '' }}\n {%- else -%}\n {%- for tr in message.content -%}\n {{- '\\n' }}\n {{- tr.output if tr.output is defined else (tr.text if tr.type == 'text' and tr.text is defined else tr) }}\n {{- '\\n' }}\n {%- endfor -%}\n {%- endif -%}\n {%- if loop.last or (conversation_messages[loop.index0 + 1].role != 'tool') -%}\n {{- '[e~[\\n' -}}\n {%- endif -%}\n \n {%- elif message.role == 'user' -%}\n {{- ']~b]user' ~ '\\n' }}\n {{- visible_text(message.content) }}\n {{- '[e~[' ~ '\\n' }}\n {%- endif -%}\n{%- endfor -%}\n\n{#- Generation prompt -#}\n{%- if add_generation_prompt -%}\n{{- ']~b]ai' ~ '\\n' ~ '' ~ '\\n' }}\n{%- endif -%}", + "stop_token_ids": [ + 200020 + ], + "stop": [ + "[e~[" + ], + "version": 2, + "virtualenv": { + "packages": [] + } } ] From 48f139a76cd591ca172e0aefa915d6a005bcc4db Mon Sep 17 00:00:00 2001 From: XprobeBot <122174228+XprobeBot@users.noreply.github.com> Date: Thu, 30 Oct 2025 21:42:45 +0800 Subject: [PATCH 2/5] chore: update xinference/model/llm/llm_family.json (llm) --- xinference/model/llm/llm_family.json | 47 ++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/xinference/model/llm/llm_family.json b/xinference/model/llm/llm_family.json index ba6970b9d6..d9ed92dd7c 100644 --- a/xinference/model/llm/llm_family.json +++ b/xinference/model/llm/llm_family.json @@ -22909,6 +22909,7 @@ "model_specs": [ { "model_size_in_billions": 230, + "activated_size_in_billions": 3, "model_format": "pytorch", "model_src": { "huggingface": { @@ -22924,6 +22925,52 @@ ] } } + }, + { + "model_size_in_billions": 230, + "activated_size_in_billions": 3, + "model_format": "awq", + "model_src": { + "huggingface": { + "model_id": "QuantTrio/MiniMax-M2-AWQ", + "quantizations": [ + "Int4" + ] + }, + "modelscope": { + "model_id": "tclf90/MiniMax-M2-AWQ", + "quantizations": [ + "Int4" + ] + } + } + }, + { + "model_size_in_billions": 230, + "activated_size_in_billions": 3, + "model_format": "mlx", + "model_src": { + "huggingface": { + "model_id": "mlx-community/MiniMax-M2-{quantization}", + "quantizations": [ + "3bit", + "4bit", + "5bit", + "6bit", + "8bit" + ] + }, + "modelscope": { + "model_id": "mlx-community/MiniMax-M2-{quantization}", + "quantizations": [ + "3bit", + "4bit", + "5bit", + "6bit", + "8bit" + ] + } + } } ], "chat_template": "{# ----------‑‑‑ special token variables ‑‑‑---------- #}\n{%- set toolcall_begin_token = '' -%}\n{%- set toolcall_end_token = '' -%}\n{#- Tool Rendering Functions ============================================== -#}\n{%- macro render_tool_namespace(namespace_name, tool_list) -%}\n{%- for tool in tool_list -%}\n{{ tool.function | tojson(ensure_ascii=False) }}\n{% endfor -%}\n{%- endmacro -%}\n{%- macro visible_text(content) -%}\n {%- if content is string -%}\n {{ content }}\n {%- elif content is iterable and content is not mapping -%}\n {%- for item in content -%}\n {%- if item is mapping and item.type == 'text' -%}\n {{- item.text }}\n {%- elif item is string -%}\n {{- item }}\n {%- endif -%}\n {%- endfor -%}\n {%- else -%}\n {{- content }}\n {%- endif -%}\n{%- endmacro -%}\n{#- System Message Construction ============================================ -#}\n{%- macro build_system_message(system_message) -%}\n {%- if system_message and system_message.content -%}\n {{- visible_text(system_message.content) }}\n {%- else -%}\n {%- if model_identity is not defined -%}\n {%- set model_identity = \"You are a helpful assistant.\" -%}\n {%- endif -%}\n {{- model_identity }}\n {%- endif -%}\n \n {#- Handle current_date -#}\n {%- if system_message and system_message.current_date -%}\n {{- '\\n' ~ 'Current date: ' + system_message.current_date }}\n {%- endif -%}\n {#- Handle current_location -#}\n {%- if system_message and system_message.current_location -%}\n {{- '\\n' ~ 'Current location: ' + system_message.current_location }}\n {%- endif -%}\n{%- endmacro -%}\n{#- Main Template Logic ================================================= -#}\n{#- Extract system message (only first message if it's system) -#}\n{%- set system_message = none -%}\n{%- set conversation_messages = messages -%}\n{%- if messages and messages[0].role == \"system\" -%}\n {%- set system_message = messages[0] -%}\n {%- set conversation_messages = messages[1:] -%}\n{%- endif -%}\n{#- Get the last user message turn, for interleved thinking -#}\n{%- set ns = namespace(last_user_index=-1) %}\n{% for m in conversation_messages %}\n {%- if m.role == 'user' %}\n {% set ns.last_user_index = loop.index0 -%}\n {%- endif %}\n{%- endfor %}\n{#- Render system message -#}\n{{- ']~!b[' ~ ']~b]system' ~ '\\n' }}\n{{- build_system_message(system_message) }}\n{#- Render tools if available -#}\n{%- if tools -%}\n {{- '\\n\\n' ~ '# Tools' ~ '\\n' ~ 'You may call one or more tools to assist with the user query.\\nHere are the tools available in JSONSchema format:' ~ '\\n' }}\n {{- '\\n' ~ '' ~ '\\n' }}\n {{- render_tool_namespace(\"functions\", tools) }}\n {{- '' ~ '\\n\\n' }}\n{{- 'When making tool calls, use XML format to invoke tools and pass parameters:' ~ '\\n' }}\n{{- '\\n' ~ toolcall_begin_token }}\n\nparam-value-1\nparam-value-2\n...\n\n{{- '\\n' ~ toolcall_end_token }}\n{%- endif -%}\n{{- '[e~[\\n' }}\n\n{#- Render messages -#}\n{%- set last_tool_call = namespace(name=none) -%}\n{%- for message in conversation_messages -%}\n {%- if message.role == 'assistant' -%}\n {#- Only render reasoning_content if no user message follows -#}\n {{- ']~b]ai' ~ '\\n' }}\n\n {%- set reasoning_content = '' %}\n {%- set content = visible_text(message.content) %}\n {%- if message.reasoning_content is string %}\n {%- set reasoning_content = message.reasoning_content %}\n {%- else %}\n {%- if '' in content %}\n {%- set reasoning_content = content.split('')[0].strip('\\n').split('')[-1].strip('\\n') %}\n {%- set content = content.split('')[-1].strip('\\n') %}\n {%- endif %}\n {%- endif %}\n {%- if reasoning_content and loop.index0 > ns.last_user_index -%}\n {{- '' ~ '\\n' ~ reasoning_content ~ '\\n' ~ '' ~ '\\n\\n' }}\n {%- endif -%}\n {%- if content -%}\n {{- content }}\n {%- endif -%}\n {%- if message.tool_calls -%}\n {{- '\\n' ~ toolcall_begin_token ~ '\\n' }}\n\n {%- for tool_call in message.tool_calls -%}\n {%- if tool_call.function %}\n {%- set tool_call = tool_call.function %}\n {%- endif %}\n {{- '' }}\n {% set _args = tool_call.arguments %}\n {%- for k, v in _args.items() %}\n {{- '' }}\n {{- v | tojson(ensure_ascii=False) if v is not string else v }}\n {{- '' }}\n {% endfor %}\n {{- '' ~ '\\n' }}\n {%- endfor -%}\n \n {{- toolcall_end_token}}\n {%- set last_tool_call.name = message.tool_calls[-1].name -%}\n {%- else -%}\n {%- set last_tool_call.name = none -%}\n {%- endif -%}\n {{- '[e~[' ~ '\\n' }}\n \n {%- elif message.role == 'tool' -%}\n {%- if last_tool_call.name is none -%}\n {{- raise_exception(\"Message has tool role, but there was no previous assistant message with a tool call!\") }}\n {%- endif -%}\n {%- if loop.first or (conversation_messages[loop.index0 - 1].role != 'tool') -%}\n {{- ']~b]tool' }}\n {%- endif -%}\n {%- if message.content is string -%}\n {{- '\\n' }}\n {{- message.content }}\n {{- '' }}\n {%- else -%}\n {%- for tr in message.content -%}\n {{- '\\n' }}\n {{- tr.output if tr.output is defined else (tr.text if tr.type == 'text' and tr.text is defined else tr) }}\n {{- '\\n' }}\n {%- endfor -%}\n {%- endif -%}\n {%- if loop.last or (conversation_messages[loop.index0 + 1].role != 'tool') -%}\n {{- '[e~[\\n' -}}\n {%- endif -%}\n \n {%- elif message.role == 'user' -%}\n {{- ']~b]user' ~ '\\n' }}\n {{- visible_text(message.content) }}\n {{- '[e~[' ~ '\\n' }}\n {%- endif -%}\n{%- endfor -%}\n\n{#- Generation prompt -#}\n{%- if add_generation_prompt -%}\n{{- ']~b]ai' ~ '\\n' ~ '' ~ '\\n' }}\n{%- endif -%}", From df79a1cc7eb41ecfe16b2a3b303a864be6dc959e Mon Sep 17 00:00:00 2001 From: XprobeBot <122174228+XprobeBot@users.noreply.github.com> Date: Fri, 31 Oct 2025 11:05:03 +0800 Subject: [PATCH 3/5] chore: update xinference/model/llm/llm_family.json (llm) --- xinference/model/llm/llm_family.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xinference/model/llm/llm_family.json b/xinference/model/llm/llm_family.json index d9ed92dd7c..c34b6b8298 100644 --- a/xinference/model/llm/llm_family.json +++ b/xinference/model/llm/llm_family.json @@ -22896,7 +22896,7 @@ { "model_name": "MiniMax-M2", "model_description": "MiniMax-M2, a Mini model built for Max coding & agentic workflows.", - "context_length": 40960000, + "context_length": 196608, "model_lang": [ "en", "zh" From e22ef04f564ac46dedc27c6d5f31d21a0c66c3a4 Mon Sep 17 00:00:00 2001 From: XprobeBot <122174228+XprobeBot@users.noreply.github.com> Date: Fri, 31 Oct 2025 11:18:32 +0800 Subject: [PATCH 4/5] chore: update xinference/model/llm/llm_family.json (llm) --- xinference/model/llm/llm_family.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xinference/model/llm/llm_family.json b/xinference/model/llm/llm_family.json index c34b6b8298..d614de43e8 100644 --- a/xinference/model/llm/llm_family.json +++ b/xinference/model/llm/llm_family.json @@ -22980,6 +22980,8 @@ "stop": [ "[e~[" ], + "reasoning_start_tag": "", + "reasoning_end_tag": "", "version": 2, "virtualenv": { "packages": [] From 1d45c996487d882c4fbba4e815ef0678ff0f98fc Mon Sep 17 00:00:00 2001 From: XprobeBot <122174228+XprobeBot@users.noreply.github.com> Date: Fri, 31 Oct 2025 11:28:08 +0800 Subject: [PATCH 5/5] chore: update xinference/model/llm/llm_family.json (llm) --- xinference/model/llm/llm_family.json | 1 + 1 file changed, 1 insertion(+) diff --git a/xinference/model/llm/llm_family.json b/xinference/model/llm/llm_family.json index d614de43e8..ec7dd1e0b2 100644 --- a/xinference/model/llm/llm_family.json +++ b/xinference/model/llm/llm_family.json @@ -22982,6 +22982,7 @@ ], "reasoning_start_tag": "", "reasoning_end_tag": "", + "tool_parser": "minimax", "version": 2, "virtualenv": { "packages": []