Architecture
~8 min readUpdated: December 2026

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

MiniMax-M4 2.74T MoE with MSA2 sparse attention and MFlashKV offloading in Smoke Monkey

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.

Technical Review: Smoke Monkey Core Architecture Team
Tested on Node.js 18+ & BunTypeScript 5.x
Quick Answer & Executive Definition

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.

Key Architectural Takeaways
Quick Implementation Exampleminimax-m4-agent.ts
minimax-m4-agent.tstypescript
import { createAgent } from '@smoke-monkey/harness';
// Multi-turn coding & visual verification agent powered by MiniMax-M4
const 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);
Video Guides

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 MetricMiniMax-M4 SpecificationHardware / Serving Impact
Total / Active Scale2.74T total / 66B active + 631M ViTFrontier reasoning + native video/image ingestion
Attention TopologyMSA2: 128 Q heads sharing 1 × 256-D KV head4x KV footprint cut; 8x FP8 decode speedup
SSD KV OffloadingMFlashKV (16-tok blocks -> 4 KB SSD pages)1M context streamed via 2-layer lookahead
Ascend 950DT Throughput1,589 tok/s per chip (100 tok/s single-user)~3x cluster throughput despite 144 GB HBM cap
RL ConsolidationScale-out RL -> Multi-Teacher On-Policy DistillMerges 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.

bash
# 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.

Google Search Questions & Answers

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 guides

Build with Smoke Monkey Harness

Zero dependencies. 24 built-in tools. Human-in-the-loop safety. 100% open source under the MIT License.

npm install smoke-monkey-harness