# minimax-ai/minimax-01 architecture

> Architecture diagram of the GitHub repository minimax-ai/minimax-01, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/minimax-ai/minimax-01
- Repository: https://github.com/minimax-ai/minimax-01

## Overview

Based on your project’s file tree and detailed README, we know you’re working with a specialized large-scale foundation model repository that serves two related purposes:
- MiniMax-Text-01: a very large language model (456B total parameters, 45.9B activated per token) built with a hybrid attention mechanism (Lightning and Softmax Attention) as well as a Mixture-of-Experts component.
- MiniMax-VL-01: a vision–language model that extends the text model with a visual module (a 303M-parameter Vision Transformer and an MLP projector) to process images dynamically at multiple resolutions.
The repository also includes evaluation scripts, inference examples, detailed licensing, and usage tutorials. It is clearly intended both for internal research and developer use (via chatbot and API).

##### Main Components
a. Data & Evaluation:
– Evaluation datasets in multiple languages (see “evaluation” directory with Chinese and English tokenized data).
– Benchmarking modules (“score.py” in evaluation/MR-NIAH) that assess model performance.
b. Inference/Processors:
– Two inference scripts for loading MiniMax-Text-01 and MiniMax-VL-01 (located in the “inference” directory).
– Configuration files (e.g., requirements.txt for inference) and the quantization configuration (QuantoConfig) used to optimize model loading on multi-GPU setups.
c. Model Architecture (Core Model Components):
– The language module (MiniMax-Text-01) detailed by parameter counts, attention configuration (hybrid, MoE, RoPE, etc.),
– The visual module integrated in MiniMax-VL-01 (ViT, MLP projector, dynamic resolution mechanism),
– And now, as per the extra instruction, a “GaN layer” (which can be considered an additional processing or gating layer). This extra component may be used to denote an added “Graphical/Generative Accelerator Node (GaN)” in the computational flow. It should be shown integrated into (or sitting between) the existing modules—for example, right before the multi-modal projector in the vision branch or as an intermediary processing stage prior to final inference—to further enhance the model’s capabilities.
d. Distributed Computing Resources:
– A representation of the GPU distribution scheme (with 8 GPUs, mapping of model layers to different devices as shown in the inference code).
e. Frontend/API:
– The externally facing API endpoints and chatbot interface (links to https://chat.minimax.io/ and https://www.minimax.io/platform).

##### Relationships and Interactions
– Show that the text input is tokenized and fed into the language model, while image input is processed by the visual encoder. Both streams then interact in the multi-modal processing phase.
– Illustrate how outputs from the two models become part of the final generation pipeline.

##### Architectural Patterns and Design Principles
– Emphasize the modularity of the two separate but related models: maintain distinct blocks for the language branch and the vision branch.
– Annotate that the models adopt advanced parallel strategies (e.g., LASP+, varlen ring attention, Expert Tensor Parallelism) to handle very long context sequences.

## Diagram (Mermaid)

```mermaid
graph TD
    %% User Input Layer
    U("User Input"):::data
    TI("Text Input"):::data
    II("Image Input"):::data

    U --> TI
    U --> II

    %% Data & Evaluation Subgraph
    subgraph "Data & Evaluation"
        ED("Evaluation Datasets (Chinese & English)"):::data
        BM("Benchmarking Module: Score Script"):::data
    end
    ED --- BM
    %% Link user input to evaluation data for performance benchmarking (if applicable)
    TI --> ED
    II --> ED

    %% Inference/Processors Subgraph
    subgraph "Inference/Processors"
        IT("Inference: MiniMax-Text-01"):::inference
        IV("Inference: MiniMax-VL-01"):::inference
        QC("Quantization & Device Mapping"):::distributed
    end
    %% Connect Evaluation to Inference processing
    BM --> IT
    BM --> IV
    IT --> QC
    IV --> QC

    %% Model Architecture Subgraph
    subgraph "Model Architecture"
        %% Language Model Branch
        TL("MiniMax-Text-01 Language Model\n[Hybrid Attention, MoE, RoPE]"):::model
        %% Visual Model Branch
        VV("MiniMax-VL-01 Visual Encoder\n[ViT, MLP Projector, Dynamic Resolution]"):::model
        %% GaN Layer
        GaN("GaN Layer\n[Accelerates multi-modal integration]"):::gang
        %% Multi-modal Fusion and Output
        MF("Multi-modal Fusion"):::model
        OG("Output Generation"):::model
    end
    %% Connect text branch
    TI --> TL
    TL --> MF
    %% Connect vision branch with GaN layer inserted
    II --> VV
    VV --> GaN
    GaN --> MF
    %% Fusion to output
    MF --> OG

    %% Distributed Computing Resources
    subgraph "Distributed Computing Resources"
        GPU("GPU Distribution Scheme\n[8 GPUs, Layer Segmentation]"):::distributed
    end
    QC --> GPU
    GPU --> OG

    %% Frontend/API Subgraph
    subgraph "Frontend/API"
        API("API Endpoint\n(chat.minimax.io)"):::api
        CB("Chatbot Interface\n(minimax.io/platform)"):::api
    end
    OG --> API
    OG --> CB

    %% Documentation & Licensing Subgraph
    subgraph "Documentation & Licensing"
        RD("README & Documentation"):::doc
        LC("Licenses"):::doc
    end
    RD --- LC

    %% Click Events
    click ED "https://github.com/minimax-ai/minimax-01/tree/main/evaluation/"
    click BM "https://github.com/minimax-ai/minimax-01/blob/main/evaluation/MR-NIAH/score.py"
    click IT "https://github.com/minimax-ai/minimax-01/blob/main/inference/minimax-text-01.py"
    click IV "https://github.com/minimax-ai/minimax-01/blob/main/inference/minimax-vl-01.py"
    click QC "https://github.com/minimax-ai/minimax-01/blob/main/inference/requirements.txt"
    click TL "https://github.com/minimax-ai/minimax-01/blob/main/MiniMax-Text-01-Model-Card.md"
    click VV "https://github.com/minimax-ai/minimax-01/blob/main/MiniMax-VL-01-Model-Card.md"
    click RD "https://github.com/minimax-ai/minimax-01/blob/main/README.md"
    click LC "https://github.com/minimax-ai/minimax-01/tree/main/LICENSE-CODE"
    click LC "https://github.com/minimax-ai/minimax-01/tree/main/LICENSE-MODEL"
    
    %% Styles
    classDef data fill:#AED6F1,stroke:#1B4F72,stroke-width:2px;
    classDef inference fill:#F9E79F,stroke:#B7950B,stroke-width:2px;
    classDef model fill:#82E0AA,stroke:#138D75,stroke-width:2px;
    classDef gang fill:#F5B041,stroke:#E67E22,stroke-width:2px;
    classDef distributed fill:#76D7C4,stroke:#17A589,stroke-width:2px;
    classDef api fill:#F1948A,stroke:#C0392B,stroke-width:2px;
    classDef doc fill:#D7BDE2,stroke:#8E44AD,stroke-width:2px;
```
