MiniMax-M2.7

对标题的评论会显示在这里

MiniMax-M2.7 vLLM Deployment Guide

对这一段的评论会显示在这里

This guide serves MiniMax-M2.7 through an OpenAI-compatible vLLM endpoint. The model weights are available from Hugging Face.

对这一段的评论会显示在这里

For the latest compatibility and hardware requirements, consult the official vLLM deployment guide. The official guide currently requires Linux, Python 3.9 through 3.12, a GPU with compute capability 7.0 or newer, and about 220 GB of memory for the weights.

对这一段的评论会显示在这里

Install vLLM

对这一段的评论会显示在这里

Create an isolated environment and install the latest compatible vLLM release:

对这一段的评论会显示在这里
uv venv
source .venv/bin/activate
uv pip install vllm --torch-backend=auto
对这一段的评论会显示在这里

Start the server

对这一段的评论会显示在这里

For a four-GPU deployment:

对这一段的评论会显示在这里
SAFETENSORS_FAST_GPU=1 vllm serve \
    MiniMaxAI/MiniMax-M2.7 --trust-remote-code \
    --tensor-parallel-size 4 \
    --enable-auto-tool-choice --tool-call-parser minimax_m2 \
    --reasoning-parser minimax_m2_append_think
对这一段的评论会显示在这里

For an eight-GPU deployment with expert parallelism:

对这一段的评论会显示在这里
SAFETENSORS_FAST_GPU=1 vllm serve \
    MiniMaxAI/MiniMax-M2.7 --trust-remote-code \
    --enable_expert_parallel --tensor-parallel-size 8 \
    --enable-auto-tool-choice --tool-call-parser minimax_m2 \
    --reasoning-parser minimax_m2_append_think
对这一段的评论会显示在这里

The server listens on http://localhost:8000/v1 by default.

对这一段的评论会显示在这里

Verify the endpoint

对这一段的评论会显示在这里
curl http://localhost:8000/v1/chat/completions \
    -H "Content-Type: application/json" \
    -d '{
        "model": "MiniMaxAI/MiniMax-M2.7",
        "messages": [
            {"role": "system", "content": "You are a helpful assistant."},
            {"role": "user", "content": "Explain mixture-of-experts models briefly."}
        ]
    }'
对这一段的评论会显示在这里

If vLLM reports that the model is unsupported, upgrade vLLM. If CUDA graph capture causes an illegal memory access, add --compilation-config '{"cudagraph_mode":"PIECEWISE"}' to the server command, as recommended by the official guide.

对这一段的评论会显示在这里

MiniMax-M2.7 SGLang Deployment Guide

对这一段的评论会显示在这里

This guide serves MiniMax-M2.7 through an OpenAI-compatible SGLang endpoint. The model weights are available from Hugging Face.

对这一段的评论会显示在这里

For the latest compatibility and hardware requirements, consult the official SGLang deployment guide. The official guide currently requires Linux, Python 3.9 through 3.12, a GPU with compute capability 7.0 or newer, and about 220 GB of memory for the weights.

对这一段的评论会显示在这里

Install SGLang

对这一段的评论会显示在这里

Create an isolated environment and install SGLang:

对这一段的评论会显示在这里
uv venv
source .venv/bin/activate
uv pip install sglang
对这一段的评论会显示在这里

Use SGLang 0.5.4.post1 or newer for MiniMax-M2 family support.

对这一段的评论会显示在这里

Start the server

对这一段的评论会显示在这里

For a four-GPU deployment:

对这一段的评论会显示在这里
python -m sglang.launch_server \
    --model-path MiniMaxAI/MiniMax-M2.7 \
    --tp-size 4 \
    --tool-call-parser minimax-m2 \
    --reasoning-parser minimax-append-think \
    --host 0.0.0.0 \
    --trust-remote-code \
    --port 8000 \
    --mem-fraction-static 0.85
对这一段的评论会显示在这里

For an eight-GPU deployment with expert parallelism:

对这一段的评论会显示在这里
python -m sglang.launch_server \
    --model-path MiniMaxAI/MiniMax-M2.7 \
    --tp-size 8 \
    --ep-size 8 \
    --tool-call-parser minimax-m2 \
    --reasoning-parser minimax-append-think \
    --host 0.0.0.0 \
    --trust-remote-code \
    --port 8000 \
    --mem-fraction-static 0.85
对这一段的评论会显示在这里

Verify the endpoint

对这一段的评论会显示在这里
curl http://localhost:8000/v1/chat/completions \
    -H "Content-Type: application/json" \
    -d '{
        "model": "MiniMaxAI/MiniMax-M2.7",
        "messages": [
            {"role": "system", "content": "You are a helpful assistant."},
            {"role": "user", "content": "Explain mixture-of-experts models briefly."}
        ]
    }'
对这一段的评论会显示在这里

MiniMax-M2.7 Transformers Deployment Guide

对这一段的评论会显示在这里

This guide runs MiniMax-M2.7 directly with Transformers. The model weights are available from Hugging Face.

对这一段的评论会显示在这里

For the latest compatibility and hardware requirements, consult the official Transformers deployment guide. The official guide currently requires Linux, Python 3.9 through 3.12, Transformers 4.57.1, a GPU with compute capability 7.0 or newer, and about 220 GB of memory for the weights.

对这一段的评论会显示在这里

Install dependencies

对这一段的评论会显示在这里

Create an isolated environment and install the tested Transformers release:

对这一段的评论会显示在这里
uv venv
source .venv/bin/activate
uv pip install transformers==4.57.1 torch accelerate --torch-backend=auto
对这一段的评论会显示在这里

Run inference

对这一段的评论会显示在这里
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

model_id = "MiniMaxAI/MiniMax-M2.7"

model = AutoModelForCausalLM.from_pretrained(
    model_id,
    device_map="auto",
    trust_remote_code=True,
)
tokenizer = AutoTokenizer.from_pretrained(model_id)

messages = [
    {
        "role": "user",
        "content": [
            {
                "type": "text",
                "text": "Explain mixture-of-experts models briefly.",
            }
        ],
    }
]

model_inputs = tokenizer.apply_chat_template(
    messages,
    return_tensors="pt",
    add_generation_prompt=True,
).to("cuda")

with torch.inference_mode():
    generated_ids = model.generate(model_inputs, max_new_tokens=256)

new_tokens = generated_ids[:, model_inputs.shape[1]:]
print(tokenizer.batch_decode(new_tokens, skip_special_tokens=True)[0])
对这一段的评论会显示在这里

Keep trust_remote_code=True; the model depends on its repository implementation. If downloading from Hugging Face is unavailable on your network, configure an approved proxy or mirror before running the script.

对这一段的评论会显示在这里