MiniMax-01

MiniMax-AIMIT长期未更新

MiniMax 官方开源的文本大模型 MiniMax-Text-01 和视觉语言模型 MiniMax-VL-01,基于线性注意力架构,可用于长上下文理解与多模态推理。

The official repo of MiniMax-Text-01 and MiniMax-VL-01, large-language-model & vision-language-model based on Linear Attention

暂无版本3,469star332fork同步于 2026-11-10 05:39 UTC

怎么上手

由 README 提炼,执行前请确认
README 未给出安装或运行命令
硬件要求按 README 说明

README 未说明显存与 GPU 型号要求;模型总参 456B、每 token 激活 45.9B,属大规模模型,README 未提及 CPU 运行方案。

多卡 / 张量并行
下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

MiniMax 官方开源的文本与视觉语言大模型,用线性注意力混合架构支持超长上下文

MiniMax 官方开源的文本大模型 MiniMax-Text-01 和视觉语言模型 MiniMax-VL-01,基于线性注意力架构,可用于长上下文理解与多模态推理。

核心能力

  • 采用 Lightning Attention 与 Softmax Attention 混合架构
  • 结合 MoE 与 Top-2 路由,总参 456B、激活 45.9B
  • 训练上下文达 100 万 token,推理可处理 400 万 token
  • 提供 ViT-MLP-LLM 框架的视觉语言模型 MiniMax-VL-01
  • VL 模型支持 336×336 到 2016×2016 动态分辨率输入

容易踩的坑

README 未说明依赖版本、模型权重下载方式与默认端口等部署细节

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

0 个版本

暂无 release 数据(可能没有发版,或尚未同步)。

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    MiniMax-01

    1. Introduction

    We are delighted to introduce two remarkable models, MiniMax-Text-01 and MiniMax-VL-01. MiniMax-Text-01 is a powerful language model boasting 456 billion total parameters, with 45.9 billion activated per token. To unlock its long-context capabilities, it adopts a hybrid architecture integrating Lightning Attention, Softmax Attention, and Mixture-of-Experts (MoE). Leveraging advanced parallel strategies like Linear Attention Sequence Parallelism Plus (LASP+), varlen ring attention, and Expert Tensor Parallel (ETP), its training context length extends to 1 million tokens, and it can handle up to 4 million tokens during inference. Consequently, MiniMax-Text-01 showcases top-tier performance on various academic benchmarks. Building on MiniMax-Text-01's prowess, we developed MiniMax-VL-01 for enhanced visual capabilities. It uses the "ViT-MLP-LLM" framework common in multimodal LLMs. It is initialized and trained using three key components: a 303-million-parameter Vision Transformer (ViT) for visual encoding, a randomly initialized two-layer MLP projector for image adaptation, and MiniMax-Text-01 as the base LLM. This model features a dynamic resolution mechanism. Input images are resized according to a pre-set grid, with resolutions ranging from 336×336 to 2016×2016, while maintaining a 336×336 thumbnail. The resized images are split into non - overlapping patches of the same size. These patches and the thumbnail are encoded separately and then combined to form a full image representation. As a result, MiniMax-VL-01 has achieved top-level performance on multimodal leaderboards, demonstrating its edge in complex multimodal tasks.

    2. Model Architecture

    The architecture of MiniMax-Text-01 is briefly described as follows:

    • Total Parameters: 456B
    • Activated Parameters per Token: 45.9B
    • Number Layers: 80
    • Hybrid Attention: a softmax attention is positioned after every 7 lightning attention.
      • Number of attention heads: 64
      • Attention head dimension: 128
    • Mixture of Experts:
      • Number of experts: 32
      • Expert hidden dimension: 9216
      • Top-2 routing strategy
    • Positional Encoding: Rotary Position Embedding (RoPE) applied to half of the attention head dimension with a base frequency of 10,000,000
    • Hidden Size: 6144
    • Vocab Size: 200,064

    For MiniMax-VL-01, the additional ViT architecture details is as follows:

    • Total Parameters: 303M
    • Number of layers: 24
    • Patch size: 14
    • Hidden size: 1024
    • FFN hidden size: 4096
    • Number of heads: 16
    • Attention head dimension: 64

    3. Evaluation

    Text Benchmarks

    Core Academic Benchmarks
    TasksGPT-4o (11-20)Claude-3.5-Sonnet (10-22)Gemini-1.5-Pro (002)Gemini-2.0-Flash (exp)Qwen2.5-72B-Inst.DeepSeek-V3Llama-3.1-405B-Inst.MiniMax-Text-01
    General
    MMLU*85.788.386.886.586.188.588.688.5
    MMLU-Pro*74.478.075.876.471.175.973.375.7
    SimpleQA39.028.123.426.610.324.923.223.7
    C-SimpleQA64.656.859.463.352.264.854.767.4
    IFEval (avg)84.190.189.488.487.287.386.489.1
    Arena-Hard92.487.685.372.781.291.463.589.1
    Reasoning
    GPQA* (diamond)46.065.059.162.149.059.150.754.4
    DROP* (F1)89.288.889.289.385.091.092.587.8
    Mathematics
    GSM8k*95.696.995.295.495.896.796.794.8
    MATH*76.674.184.683.981.884.673.877.4
    Coding
    MBPP +76.275.175.475.977.078.873.071.7
    HumanEval90.293.786.689.686.692.189.086.9

    * Evaluated following a 0-shot CoT setting.

    Long Benchmarks

    4M Needle In A Haystack Test

    Ruler

    Model4k8k16k32k64k128k256k512k1M
    GPT-4o (11-20)0.9700.9210.8900.8880.884----
    Claude-3.5-Sonnet (10-22)0.9650.9600.9570.9500.9520.938---
    Gemini-1.5-Pro (002)0.9620.9600.9600.9580.9380.9170.9160.8610.850
    Gemini-2.0-Flash (exp)0.9600.9600.9510.9570.9370.8600.7970.709-
    MiniMax-Text-010.9630.9610.9530.9540.9430.9470.9450.9280.910

    LongBench v2

    Modeloveralleasyhardshortmediumlong
    Human53.7100.025.147.259.153.7
    w/ CoT
    GPT-4o (11-20)51.454.249.759.648.643.5
    Claude-3.5-Sonnet (10-22)46.755.241.553.941.944.4
    Deepseek-V3------
    Qwen2.5-72B-Inst.43.547.940.848.940.939.8
    MiniMax-Text-0156.566.150.561.756.747.2
    w/o CoT
    GPT-4o (11-20)50.157.445.653.352.440.2
    Claude-3.5-Sonnet (10-22)41.046.937.346.138.637.0
    Deepseek-V348.7-----
    Qwen2.5-72B-Inst.42.142.741.845.638.144.4
    MiniMax-Text-0152.960.947.958.952.643.5

    MTOB

    Context Typeno contexthalf bookfull bookΔ half bookΔ full book
    eng → kalam (ChrF)
    GPT-4o (11-20)9.9054.30-44.40-
    Claude-3.5-Sonnet (10-22)20.2253.6255.6533.3935.42
    Gemini-1.5-Pro (002)16.7953.6857.9036.8941.11
    Gemini-2.0-Flash (exp)12.2049.5053.3037.3041.10
    Qwen-Long16.5548.4845.9431.9229.39
    MiniMax-Text-016.051.7451.6045.745.6
    kalam → eng (BLEURT)
    GPT-4o (11-20)33.2058.30-25.10-
    Claude-3.5-Sonnet (10-22)31.4259.7062.3028.2830.88
    Gemini-1.5-Pro (002)32.0261.5263.0929.5031.07
    Gemini-2.0-Flash (exp)33.8057.5057.0023.7023.20
    Qwen-Long30.1353.1432.1523.012.02
    MiniMax-Text-0133.6557.1058.0023.4524.35

    Vision Benchmarks

    TasksGPT-4o(11-20)Claude-3.5-Sonnet (10-22)Gemini-1.5-Pro (002)Gemini-2.0-Flash (exp)Qwen2-VL-72B-Inst.InternVL2.5-78BLLama-3.2-90BMiniMax-VL-01
    Knowledge
    MMMU*63.572.068.470.664.566.562.168.5
    MMMU-Pro*54.554.750.957.043.247.336.052.7
    Visual Q&A
    ChartQA*relaxed88.190.888.788.391.291.585.591.7
    DocVQA*91.194.291.592.997.196.190.196.4
    OCRBench806790800846856847805865
    Mathematics & Sciences
    AI2D*83.182.080.985.184.486.878.983.3
    MathVista*62.165.470.673.169.668.457.368.6
    OlympiadBenchfull25.228.432.146.121.925.119.324.2
    Long Context
    M-LongDocacc41.431.426.231.411.619.713.932.5
    Comprehensive
    MEGA-Benchmacro49.451.445.953.946.845.319.947.4
    User Experience
    In-house Benchmark62.347.049.272.140.634.813.656.6

    * Evaluated following a 0-shot CoT setting.

    4. Quickstart

    Here, we provide a simple example to demonstrate how to use MiniMax-Text-01 and MiniMax-VL-01 respectively.

    MiniMax-Text-01

    from transformers import AutoModelForCausalLM, AutoTokenizer, AutoConfig, QuantoConfig, GenerationConfig
    
    # load hf config
    hf_config = AutoConfig.from_pretrained("MiniMaxAI/MiniMax-Text-01", trust_remote_code=True)
    
    # quantization config, int8 is recommended
    quantization_config =  QuantoConfig(
                weights="int8",
                modules_to_not_convert=[
                    "lm_head",
                    "embed_tokens",
                ] + [f"model.layers.{i}.coefficient" for i in range(hf_config.num_hidden_layers)]
                + [f"model.layers.{i}.block_sparse_moe.gate" for i in range(hf_config.num_hidden_layers)]
            )
    
    # assume 8 GPUs
    world_size = 8
    layers_per_device = hf_config.num_hidden_layers // world_size
    # set device map
    device_map = {
        'model.embed_tokens': 'cuda:0',
        'model.norm': f'cuda:{world_size - 1}',
        'lm_head': f'cuda:{world_size - 1}'
    }
    for i in range(world_size):
        for j in range(layers_per_device):
            device_map[f'model.layers.{i * layers_per_device + j}'] = f'cuda:{i}'
    
    # load tokenizer
    tokenizer = AutoTokenizer.from_pretrained("MiniMaxAI/MiniMax-Text-01")
    prompt = "Hello!"
    messages = [
        {"role": "system", "content": [{"type": "text", "text": "You are a helpful assistant created by MiniMax based on MiniMax-Text-01 model."}]},
        {"role": "user", "content": [{"type": "text", "text": prompt}]},
    ]
    text = tokenizer.apply_chat_template(
        messages,
        tokenize=False,
        add_generation_prompt=True
    )
    # tokenize and move to device
    model_inputs = tokenizer(text, return_tensors="pt").to("cuda")
    
    # load bfloat16 model, move to device, and apply quantization
    quantized_model = AutoModelForCausalLM.from_pretrained(
        "MiniMaxAI/MiniMax-Text-01",
        torch_dtype="bfloat16",
        device_map=device_map,
        quantization_config=quantization_config,
        trust_remote_code=True,
        offload_buffers=True,
    )
    
    # generate response
    generation_config = GenerationConfig(
        max_new_tokens=20,
        eos_token_id=200020,
        use_cache=True,
    )
    generated_ids = quantized_model.generate(**model_inputs, generation_config=generation_config)
    print(f"generated_ids: {generated_ids}")
    generated_ids = [
        output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
    ]
    response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
    

    MiniMax-VL-01

    from transformers import AutoModelForCausalLM, AutoProcessor, AutoConfig, QuantoConfig, GenerationConfig
    import torch
    import json
    import os
    from PIL import Image
    
    # load hf config
    hf_config = AutoConfig.from_pretrained("MiniMaxAI/MiniMax-VL-01", trust_remote_code=True)
    
    # quantization config, int8 is recommended
    quantization_config =  QuantoConfig(
                weights="int8",
                modules_to_not_convert=[
                    "vision_tower",
                    "image_newline",
                    "multi_modal_projector",
                    "lm_head",
                    "embed_tokens",
                ] + [f"model.layers.{i}.coefficient" for i in range(hf_config.text_config.num_hidden_layers)]
                + [f"model.layers.{i}.block_sparse_moe.gate" for i in range(hf_config.text_config.num_hidden_layers)]
            )
    
    # set device map
    model_safetensors_index_path = os.path.join("MiniMax-VL-01", "model.safetensors.index.json")
    with open(model_safetensors_index_path, "r") as f:
        model_safetensors_index = json.load(f)
    weight_map = model_safetensors_index['weight_map']
    vision_map = {}
    for key, value in weight_map.items():
        if 'vision_tower' in key or 'image_newline' in key or 'multi_modal_projector' in key:
            new_key = key.replace('.weight','').replace('.bias','')
            if new_key not in vision_map:
                vision_map[new_key] = value
    # assume 8 GPUs
    world_size = 8
    device_map = {
        'language_model.model.embed_tokens': 'cuda:0',
        'language_model.model.norm': f'cuda:{world_size - 1}',
        'language_model.lm_head': f'cuda:{world_size - 1}'
    }
    for key, value in vision_map.items():
        device_map[key] = f'cuda:0'
    device_map['vision_tower.vision_model.post_layernorm'] = f'cuda:0'
    layers_per_device = hf_config.text_config.num_hidden_layers // world_size
    for i in range(world_size):
        for j in range(layers_per_device):
            device_map[f'language_model.model.layers.{i * layers_per_device + j}'] = f'cuda:{i}'
    
    # load processor
    processor = AutoProcessor.from_pretrained("MiniMaxAI/MiniMax-VL-01", trust_remote_code=True)
    messages = [
        {"role": "system", "content": [{"type": "text", "text": "You are a helpful assistant created by MiniMax based on MiniMax-VL-01 model."}]},
        {"role": "user", "content": [{"type": "image", "image": "placeholder"},{"type": "text", "text": "Describe this image."}]},
    ]
    prompt = processor.tokenizer.apply_chat_template(
        messages, tokenize=False, add_generation_prompt=True
    )
    raw_image = Image.open("figures/image.jpg")
    # tokenize and move to device
    model_inputs = processor(images=[raw_image], text=prompt, return_tensors='pt').to('cuda').to(torch.bfloat16)
    
    # load bfloat16 model, move to device, and apply quantization
    quantized_model = AutoModelForCausalLM.from_pretrained(
        "MiniMaxAI/MiniMax-VL-01",
        torch_dtype="bfloat16",
        device_map=device_map,
        quantization_config=quantization_config,
        trust_remote_code=True,
        offload_buffers=True,
    )
    generation_config = GenerationConfig(
        max_new_tokens=100,
        eos_token_id=200020,
        use_cache=True,
    )
    
    # generate response
    generated_ids = quantized_model.generate(**model_inputs, generation_config=generation_config)
    print(f"generated_ids: {generated_ids}")
    generated_ids = [
        output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
    ]
    response = processor.tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
    

    5. Deployment Guide

    For production deployment, we recommend using vLLM to serve MiniMax-Text-01 and MiniMax-VL-01. vLLM provides excellent performance for serving large language models with the following features:

    • 🔥 Outstanding service throughput performance
    • ⚡ Efficient and intelligent memory management
    • 📦 Powerful batch request processing capability
    • ⚙️ Deeply optimized underlying performance

    For detailed vLLM deployment instructions, please refer to our vLLM Deployment Guide.

    Alternatively, you can also deploy using Transformers directly. For detailed Transformers deployment instructions, you can see our MiniMax-Text-01 Transformers Deployment Guide.

    6. Citation

    @misc{minimax2025minimax01scalingfoundationmodels,
          title={MiniMax-01: Scaling Foundation Models with Lightning Attention}, 
          author={MiniMax and Aonian Li and Bangwei Gong and Bo Yang and Boji Shan and Chang Liu and Cheng Zhu and Chunhao Zhang and Congchao Guo and Da Chen and Dong Li and Enwei Jiao and Gengxin Li and Guojun Zhang and Haohai Sun and Houze Dong and Jiadai Zhu and Jiaqi Zhuang and Jiayuan Song and Jin Zhu and Jingtao Han and Jingyang Li and Junbin Xie and Junhao Xu and Junjie Yan and Kaishun Zhang and Kecheng Xiao and Kexi Kang and Le Han and Leyang Wang and Lianfei Yu and Liheng Feng and Lin Zheng and Linbo Chai and Long Xing and Meizhi Ju and Mingyuan Chi and Mozhi Zhang and Peikai Huang and Pengcheng Niu and Pengfei Li and Pengyu Zhao and Qi Yang and Qidi Xu and Qiexiang Wang and Qin Wang and Qiuhui Li and Ruitao Leng and Shengmin Shi and Shuqi Yu and Sichen Li and Songquan Zhu and Tao Huang and Tianrun Liang and Weigao Sun and Weixuan Sun and Weiyu Cheng and Wenkai Li and Xiangjun Song and Xiao Su and Xiaodong Han and Xinjie Zhang and Xinzhu Hou and Xu Min and Xun Zou and Xuyang Shen and Yan Gong and Yingjie Zhu and Yipeng Zhou and Yiran Zhong and Yongyi Hu and Yuanxiang Fan and Yue Yu and Yufeng Yang and Yuhao Li and Yunan Huang and Yunji Li and Yunpeng Huang and Yunzhi Xu and Yuxin Mao and Zehan Li and Zekang Li and Zewei Tao and Zewen Ying and Zhaoyang Cong and Zhen Qin and Zhenhua Fan and Zhihang Yu and Zhuo Jiang and Zijia Wu},
          year={2025},
          eprint={2501.08313},
          archivePrefix={arXiv},
          primaryClass={cs.CL},
          url={https://arxiv.org/abs/2501.08313}, 
    }
    

    7. Chatbot & API

    For general use and evaluation, we provide a Chatbot with online search capabilities and the online API for developers. For general use and evaluation, we provide the MiniMax MCP Server with video generation, image generation, speech synthesis, and voice cloning for developers.

    Contact us at [email protected].