MiniMax-M4: 2.74T Multimodal MoE, MSA2 & MFlashKV Guide

MiniMax-M4 is an open-weight natively multimodal Mixture-of-Experts model with 2.74T total parameters, 66B active parameters per token, a 631M-parameter ViT, and a 1M-token context window. Pairing MiniMax Sparse Attention 2 (MSA2) with MFlashKV 4KB SSD offloading, it achieves 1,589 tok/s per Ascend 950DT chip.
MiniMax-M4: 2.74T Multimodal MoE, MSA2 & MFlashKV Guide: MiniMax-M4 is an open-weight natively multimodal Mixture-of-Experts model with 2.74T total parameters, 66B active parameters per token, a 631M-parameter ViT, and a 1M-token context window. Pairing MiniMax Sparse Attention 2 (MSA2) with MFlashKV 4KB SSD offloading, it achieves 1,589 tok/s per Ascend 950DT chip. Designed as a zero-dependency, open-source TypeScript architecture under the MIT License with native Model Context Protocol (MCP) support and deterministic phase state machines.
- 4x Smaller KV Cache via MSA2: Shares a single 256-dimensional KV head across 128 query heads across all 68 layers, yielding 8x FP8 decode and 4.48x prefill speedups.
- MFlashKV 4KB SSD Page Alignment: Aligns 16-token KV blocks to 4 KB NVMe pages with a two-layer lookahead indexer to stream cold 1M-token context without latency spikes.
- Multi-Teacher On-Policy Distillation (MOPD): Scales RL out across parallel domain clusters (coding, agentic tools, financial analysis) and consolidates into one unified checkpoint.
- Selectable Thinking Depth & Low API Cost: Supports low, medium, high, xhigh, and max reasoning depths at $0.80/1M input ($0.05/1M cached) and $3.10/1M output tokens.
import { createAgent } from '@smoke-monkey/harness';// Multi-turn coding & visual verification agent powered by MiniMax-M4const agent = createAgent({agentId: 'minimax-m4-architect',provider: 'openai-compatible',baseUrl: 'https://api.minimax.io/v1',apiKey: process.env.MINIMAX_API_KEY,model: 'MiniMax-M4',workspacePath: process.cwd(),mcpServers: {filesystem: {command: 'npx',args: ['-y', '@modelcontextprotocol/server-filesystem', process.cwd()],},},permissions: {read_file: 'allow',write_file: 'ask',run_command: 'ask',},});async function main() {const result = await agent.run('Inspect the UI screenshot diff and patch the responsive grid layout bug in src/components/Dashboard.tsx.');console.log('MiniMax-M4 Result:', result.summary);}main().catch(console.error);
Watch: Related Video Guides
MiniMax M4: China's 2.74T Open Model Runs on Huawei Chips. How Good Is It?
MiniMax Launches M4: 2.74 Trillion Open Model: Hands-on Testing
What Is MiniMax-M4 and How Do MSA2 and MFlashKV Solve the HBM Wall?
MiniMax-M4 is a 2.74-trillion-parameter natively multimodal MoE model (66B active parameters per token) designed through deep hardware-model co-design for memory-constrained accelerators. By coupling MiniMax Sparse Attention 2 (MSA2) with MFlashKV SSD offloading, M4 sustains a 1-million-token context window without exhausting scarce HBM capacity.
Across all 68 transformer layers, MSA2 replaces dense multi-head KV storage with a single shared 256-dimensional KV head serving 128 query heads, shrinking per-token KV state by 4x and accelerating FP8 decoding kernels by 8x (4.48x on prefill). MFlashKV then maps 16-token KV attention blocks directly to 4 KB SSD pages and employs a lightweight two-layer lookahead indexer to asynchronously prefetch cold blocks into HBM ahead of the compute stream.
| Architectural Metric | MiniMax-M4 Specification | Hardware / Serving Impact |
|---|---|---|
| Total / Active Scale | 2.74T total / 66B active + 631M ViT | Frontier reasoning + native video/image ingestion |
| Attention Topology | MSA2: 128 Q heads sharing 1 × 256-D KV head | 4x KV footprint cut; 8x FP8 decode speedup |
| SSD KV Offloading | MFlashKV (16-tok blocks -> 4 KB SSD pages) | 1M context streamed via 2-layer lookahead |
| Ascend 950DT Throughput | 1,589 tok/s per chip (100 tok/s single-user) | ~3x cluster throughput despite 144 GB HBM cap |
| RL Consolidation | Scale-out RL -> Multi-Teacher On-Policy Distill | Merges coding, agent, and chip-design experts |
Tuning MiniMax-M4 Thinking Budgets and Prompt-Cache Economics
For autonomous coding harnesses, MiniMax-M4 exposes five thinking-depth tiers (low, medium, high, xhigh, max) over its OpenAI-compatible endpoint. Keeping shared repository system prompts and tool definitions stable captures the $0.05/1M cached input rate—a 16x reduction versus uncached $0.80/1M input tokens.
# Query MiniMax-M4 OpenAI-compatible API with explicit thinking-depth control
curl -s https://api.minimax.io/v1/chat/completions \
-H "Authorization: Bearer ${MINIMAX_API_KEY}" \
-H "Content-Type: application/json" \
-d '{
"model": "MiniMax-M4",
"messages": [
{"role": "system", "content": "You are a senior systems engineer verifying CUDA/Ascend kernels."},
{"role": "user", "content": "Explain why aligning 16-token KV blocks to 4KB SSD pages eliminates read amplification."}
],
"reasoning_effort": "high",
"temperature": 0.2
}'Open-Weight Release & API Availability
MiniMax-AI/MiniMax-M4 is announced as an open-weight release with downloadable weights pending final safety checks; verify weights availability on GitHub and ModelScope while using the OpenAI-compatible API for immediate harness integration.
Frequently Asked Questions
Q:How many active parameters does MiniMax-M4 use per token?
Out of 2.74 trillion total parameters (plus a 631M-parameter Vision Transformer), MiniMax-M4 activates 66 billion parameters per generated token.
Q:What does MFlashKV do for 1M-context agent sessions?
MFlashKV aligns 16-token KV cache blocks to 4 KB SSD pages and uses a two-layer lookahead indexer to prefetch required KV blocks from local or networked NVMe SSDs into HBM before attention execution.
Q:How does MiniMax Sparse Attention 2 (MSA2) reduce memory?
MSA2 shares a single 256-dimensional KV head across 128 query heads in all 68 layers, reducing per-token KV cache memory by 4x while speeding up FP8 decode kernels 8x and prefill 4.48x.
Q:What is Multi-Teacher On-Policy Distillation (MOPD) in MiniMax-M4?
MiniMax scales RL out across separate domain clusters to train specialized teachers in parallel, then distills them on-policy back into the single unified MiniMax-M4 weights.
Related Alternatives & Comparisons
Related Architecture Guides
View all guidesBest Open Source Coding Agents in 2026: Free, Local & Fully Hackable Harnesses
MCP Server Security Best Practices: Hardening Model Context Protocol Agents in 2026
Open Source Coding Agent Harness: Build a Forkable, Local AI Engineering Runtime
Build with Smoke Monkey Harness
Zero dependencies. 24 built-in tools. Human-in-the-loop safety. 100% open source under the MIT License.