{
  "hf_id": "MiniMaxAI/MiniMax-M2",
  "meta": {
    "title": "MiniMax-M2",
    "slug": "minimax-m2",
    "provider": "MiniMax",
    "description": "MiniMax M2 MoE language model (230B total / 10B active) for coding, agent toolchains, and long-context reasoning — native FP8 checkpoint, with an NVFP4 variant for Blackwell",
    "date_added": "2025-10-26",
    "date_updated": "2026-05-11",
    "tasks": [
      "text"
    ],
    "performance_headline": "Open-source MoE with strong SWE-Bench and Terminal-Bench performance, 196K context",
    "related_recipes": [],
    "hardware": {
      "h100": "verified",
      "h200": "verified",
      "mi300x": "verified",
      "mi325x": "verified",
      "mi355x": "verified"
    }
  },
  "recommended_command": {
    "hardware": "h200",
    "strategy": "single_node_tp",
    "variant": "default",
    "node_count": 1,
    "deploy_type": "single_node",
    "env": {},
    "docker_image": "vllm/vllm-openai:latest",
    "command": "vllm serve MiniMaxAI/MiniMax-M2 \\\n  --trust-remote-code \\\n  --tensor-parallel-size 4 \\\n  --tool-call-parser minimax_m2 \\\n  --enable-auto-tool-choice \\\n  --reasoning-parser minimax_m2",
    "argv": [
      "vllm",
      "serve",
      "MiniMaxAI/MiniMax-M2",
      "--trust-remote-code",
      "--tensor-parallel-size",
      "4",
      "--tool-call-parser",
      "minimax_m2",
      "--enable-auto-tool-choice",
      "--reasoning-parser",
      "minimax_m2"
    ],
    "docker_command": "docker run --gpus all \\\n  --privileged --ipc=host -p 8000:8000 \\\n  -v ~/.cache/huggingface:/root/.cache/huggingface \\\n  vllm/vllm-openai:latest MiniMaxAI/MiniMax-M2 \\\n  --trust-remote-code \\\n  --tensor-parallel-size 4 \\\n  --tool-call-parser minimax_m2 \\\n  --enable-auto-tool-choice \\\n  --reasoning-parser minimax_m2",
    "docker_argv": [
      "docker",
      "run",
      "--gpus",
      "all",
      "--privileged",
      "--ipc=host",
      "-p",
      "8000:8000",
      "-v",
      "~/.cache/huggingface:/root/.cache/huggingface",
      "vllm/vllm-openai:latest",
      "MiniMaxAI/MiniMax-M2",
      "--trust-remote-code",
      "--tensor-parallel-size",
      "4",
      "--tool-call-parser",
      "minimax_m2",
      "--enable-auto-tool-choice",
      "--reasoning-parser",
      "minimax_m2"
    ],
    "strategy_spec": {
      "name": "single_node_tp",
      "deploy_type": "single_node",
      "display_name": "Tensor Parallel",
      "short_label": "TP",
      "orientation": "latency",
      "description": "Single-node tensor parallel. Splits the model across all local GPUs. TP size is set to the GPU count at deploy time. The simplest multi-GPU strategy — works for all model architectures.\n",
      "hardware_match": {
        "min_gpus": 1,
        "max_gpus": 8,
        "multi_node": false
      },
      "vllm_args": [],
      "parallel_flag": "--tensor-parallel-size"
    },
    "hardware_profile": {
      "brand": "NVIDIA",
      "generation": "hopper",
      "compute_arch": "sm90",
      "display_name": "H200",
      "description": "NVIDIA H200 SXM 141 GB HBM3e · 8-GPU HGX node",
      "gpu_count": 8,
      "vram_gb": 1128,
      "multi_node": false
    },
    "alternatives": {
      "single_node_tep": "/MiniMaxAI/MiniMax-M2/strategies/single_node_tep.json",
      "single_node_dep": "/MiniMaxAI/MiniMax-M2/strategies/single_node_dep.json",
      "multi_node_tp": "/MiniMaxAI/MiniMax-M2/strategies/multi_node_tp.json",
      "multi_node_tp_pp": "/MiniMaxAI/MiniMax-M2/strategies/multi_node_tp_pp.json",
      "multi_node_tep": "/MiniMaxAI/MiniMax-M2/strategies/multi_node_tep.json",
      "multi_node_dep": "/MiniMaxAI/MiniMax-M2/strategies/multi_node_dep.json",
      "pd_cluster": "/MiniMaxAI/MiniMax-M2/strategies/pd_cluster.json",
      "kv_store_centralized_mooncake": "/MiniMaxAI/MiniMax-M2/strategies/kv_store_centralized_mooncake.json",
      "kv_store_distributed_mooncake": "/MiniMaxAI/MiniMax-M2/strategies/kv_store_distributed_mooncake.json"
    },
    "by_hardware": {
      "h200": "/MiniMaxAI/MiniMax-M2/hw/h200.json",
      "h100": "/MiniMaxAI/MiniMax-M2/hw/h100.json",
      "b200": "/MiniMaxAI/MiniMax-M2/hw/b200.json",
      "gb200": "/MiniMaxAI/MiniMax-M2/hw/gb200.json",
      "b300": "/MiniMaxAI/MiniMax-M2/hw/b300.json",
      "gb300": "/MiniMaxAI/MiniMax-M2/hw/gb300.json",
      "mi300x": "/MiniMaxAI/MiniMax-M2/hw/mi300x.json",
      "mi325x": "/MiniMaxAI/MiniMax-M2/hw/mi325x.json",
      "mi350x": "/MiniMaxAI/MiniMax-M2/hw/mi350x.json",
      "mi355x": "/MiniMaxAI/MiniMax-M2/hw/mi355x.json"
    }
  },
  "model": {
    "model_id": "MiniMaxAI/MiniMax-M2",
    "min_vllm_version": "0.11.1",
    "architecture": "moe",
    "parameter_count": "230B",
    "active_parameters": "10B",
    "context_length": 196608,
    "base_args": [
      "--trust-remote-code"
    ],
    "base_env": {},
    "install": {
      "pip": {
        "command": "uv venv\nsource .venv/bin/activate\nuv pip install -U vllm --torch-backend auto"
      },
      "docker": {
        "command": "docker pull vllm/vllm-openai:latest"
      },
      "extras": [
        {
          "note": "Optional: DeepGEMM FP8 MoE kernels for throughput (skip on B200 — known FlashInfer FP8 MoE error)",
          "command": "export VLLM_USE_DEEP_GEMM=1",
          "optional": true
        }
      ]
    }
  },
  "features": {
    "tool_calling": {
      "description": "MiniMax M2 tool call parser with automatic tool choice",
      "args": [
        "--tool-call-parser",
        "minimax_m2",
        "--enable-auto-tool-choice"
      ]
    },
    "reasoning": {
      "description": "MiniMax M2 reasoning parser for chain-of-thought extraction",
      "args": [
        "--reasoning-parser",
        "minimax_m2"
      ]
    }
  },
  "opt_in_features": [],
  "variants": {
    "default": {
      "precision": "fp8",
      "vram_minimum_gb": 276,
      "description": "Native FP8 checkpoint — 4x H200/H20/H100 or 4x A100/A800 for weights, plus KV cache headroom"
    },
    "nvfp4": {
      "model_id": "RedHatAI/MiniMax-M2-NVFP4",
      "precision": "nvfp4",
      "vram_minimum_gb": 138,
      "description": "NVFP4 (4-bit) quantized weights — requires Blackwell (B200/B300); roughly half the VRAM of the FP8 checkpoint",
      "extra_args": [
        "--kv-cache-dtype",
        "fp8"
      ],
      "json": "/RedHatAI/MiniMax-M2-NVFP4.json"
    }
  },
  "kv_offload_support": {
    "offloading_cpu": "verified",
    "offloading_fs": "verified"
  },
  "hardware_overrides": {
    "amd": {
      "extra_args": [
        "--tensor-parallel-size",
        "2",
        "--attention-backend",
        "ROCM_AITER_FA"
      ],
      "extra_env": {
        "VLLM_ROCM_USE_AITER": "1",
        "VLLM_ROCM_SHUFFLE_KV_CACHE_LAYOUT": "1"
      }
    }
  },
  "guide": "## Overview\n\n[MiniMax-M2](https://huggingface.co/MiniMaxAI/MiniMax-M2) is an advanced MoE language\nmodel from [MiniMax](https://www.minimax.io/). Highlights:\n\n- Superior intelligence — #1 among open-source models globally on math, science, coding, tool use\n- Advanced coding — multi-file edits, run-fix loops, test-validated repairs (SWE-Bench, Terminal-Bench)\n- Agent performance — plans and executes complex toolchains across shell, browser, and code\n- Efficient design — 10B active / 230B total for low latency and high throughput\n- 196K context length per sequence\n\n## Prerequisites\n\n- **OS:** Linux\n- **Python:** 3.10 - 3.13\n- **NVIDIA:** compute capability >= 7.0; ~220 GB for weights + 240 GB per 1M context tokens\n- **AMD:** MI300X / MI325X / MI350X / MI355X with ROCm 7.0+\n\n### Install vLLM (NVIDIA, stable)\n\n```bash\nuv venv\nsource .venv/bin/activate\nuv pip install -U vllm --torch-backend auto\n```\n\n### Install vLLM (NVIDIA, nightly)\n\nIf you hit corrupted output, upgrade to a nightly after commit\n`cf3eacfe58fa9e745c2854782ada884a9f992cf7`:\n\n```bash\nuv pip install -U vllm --extra-index-url https://wheels.vllm.ai/nightly\n```\n\n### Install vLLM (AMD ROCm)\n\n```bash\nuv pip install vllm --extra-index-url https://wheels.vllm.ai/rocm/\n```\n\n### Docker (NVIDIA, dedicated M2 image)\n\n```bash\ndocker run --gpus all \\\n  -p 8000:8000 \\\n  --ipc=host \\\n  -v ~/.cache/huggingface:/root/.cache/huggingface \\\n  vllm/vllm-openai:minimax27 MiniMaxAI/MiniMax-M2 \\\n      --tensor-parallel-size 4 \\\n      --tool-call-parser minimax_m2 \\\n      --reasoning-parser minimax_m2 \\\n      --enable-auto-tool-choice \\\n      --trust-remote-code\n```\n\n## Launching the Server\n\n### NVIDIA — TP4 (4x H200/H20/H100 or 4x A100/A800)\n\n```bash\nvllm serve MiniMaxAI/MiniMax-M2 \\\n  --tensor-parallel-size 4 \\\n  --tool-call-parser minimax_m2 \\\n  --reasoning-parser minimax_m2 \\\n  --enable-auto-tool-choice \\\n  --trust-remote-code\n```\n\nPure TP8 is not supported. For >4 GPUs use DP+EP or TP+EP:\n\n### TP4+EP (recommended for H100)\n\n```bash\nvllm serve MiniMaxAI/MiniMax-M2 \\\n  --tensor-parallel-size 4 \\\n  --enable-expert-parallel \\\n  --tool-call-parser minimax_m2 \\\n  --reasoning-parser minimax_m2 \\\n  --enable-auto-tool-choice\n```\n\n### DP8+EP\n\n```bash\nvllm serve MiniMaxAI/MiniMax-M2 \\\n  --data-parallel-size 8 \\\n  --enable-expert-parallel \\\n  --tool-call-parser minimax_m2 \\\n  --reasoning-parser minimax_m2 \\\n  --enable-auto-tool-choice\n```\n\n### AMD ROCm — TP2\n\n```bash\nVLLM_ROCM_USE_AITER=1 vllm serve MiniMaxAI/MiniMax-M2 \\\n  --tensor-parallel-size 2 \\\n  --tool-call-parser minimax_m2 \\\n  --reasoning-parser minimax_m2 \\\n  --enable-auto-tool-choice \\\n  --trust-remote-code\n```\n\n## Benchmarking\n\n```bash\nvllm bench serve \\\n  --backend vllm \\\n  --model MiniMaxAI/MiniMax-M2 \\\n  --endpoint /v1/completions \\\n  --dataset-name random \\\n  --random-input 2048 \\\n  --random-output 1024 \\\n  --max-concurrency 10 \\\n  --num-prompt 100\n```\n\n## Troubleshooting\n\n- **MiniMax QK norm fusion:** Latest vLLM applies the fusion automatically at\n  runtime when the fused CUDA op is available; older vLLM builds used an\n  explicit `fuse_minimax_qk_norm` compile pass.\n- **Corrupted output on stable release:** Upgrade to a nightly after commit\n  `cf3eacfe58fa9e745c2854782ada884a9f992cf7`.\n- **DeepGEMM:** vLLM uses DeepGEMM by default; install via\n  [install_deepgemm.sh](https://github.com/vllm-project/vllm/blob/main/tools/install_deepgemm.sh)\n  when missing.\n- **AITER first launch:** AMD initial launch JIT-compiles CK-based FP8 MoE, RMSNorm,\n  and activation kernels. Subsequent launches use cached kernels.\n\n## Quantized Variant (NVFP4)\n\n[`RedHatAI/MiniMax-M2-NVFP4`](https://huggingface.co/RedHatAI/MiniMax-M2-NVFP4) is an NVFP4 (4-bit)\ncheckpoint — roughly half the VRAM of the native FP8 checkpoint. Select the **nvfp4** variant\nabove (it sets `--kv-cache-dtype fp8`; on vLLM v0.28.0+ the FlashInfer NVFP4 MoE\nkernels are selected automatically), or pass the repo id\ndirectly to `vllm serve`. NVFP4 requires a Blackwell GPU (compute capability 10.0+).\n\n## References\n\n- [Model card](https://huggingface.co/MiniMaxAI/MiniMax-M2)\n- [NVFP4 variant](https://huggingface.co/RedHatAI/MiniMax-M2-NVFP4)\n- [MiniMax](https://www.minimax.io/)\n- [vLLM PR #43410 (automatic MiniMax QK norm fusion)](https://github.com/vllm-project/vllm/pull/43410)\n",
  "source": {
    "source": "vllm",
    "repo": "vllm-project/vllm",
    "ref": "main",
    "sha": "389ffebe555705c85337025d5df108d0384d365e",
    "path": "recipes/models/MiniMaxAI/MiniMax-M2.yaml",
    "edit_url": "https://github.com/vllm-project/vllm/edit/main/recipes/models/MiniMaxAI/MiniMax-M2.yaml",
    "overlays": []
  }
}