# minimax-m31/minimax-m3.1-flash architecture

> Architecture diagram of the GitHub repository minimax-m31/minimax-m3.1-flash, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/minimax-m31/minimax-m3.1-flash
- Repository: https://github.com/minimax-m31/minimax-m3.1-flash

## Overview

MiniMax M3.1-Flash is presented as a Windows desktop coding product with a MiniMax Code model, 1M-token context, and Token Plan-only access. The documented user flow is to open MiniMax Code and choose M3.1-Flash. Source excerpts identify desktop, chat, context, plan, and quota components, but do not show calls or data flow between them, so those relationships are omitted.

Main entry points: [`desk/Code.cpp`](https://github.com/minimax-m31/minimax-m3.1-flash/blob/main/desk/Code.cpp) (Desktop entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop app"]
  node_desktop_entry["Desktop entry<br/>[Code.cpp]"]
  node_window["Windows window<br/>[Win.cpp]"]
  node_editor["Editor pane<br/>[Editor.h]"]
end

subgraph group_coding["Coding session"]
  node_session["Coding session<br/>[Session.cpp]"]
  node_stream["Token stream<br/>[Stream.h]"]
  node_account_key["Account key<br/>[Key.cpp]"]
end

subgraph group_model["Model access"]
  node_context["Context limit<br/>[Context.h]"]
  node_model_token["Model token row<br/>[Token.cpp]"]
  node_plan_gate["Token Plan gate<br/>[Plan.cpp]"]
end

subgraph group_usage["Plan and usage"]
  node_quota["Plan quota<br/>[Quota.h]"]
  node_meter["Token meter<br/>[Meter.cpp]"]
  node_billing["Plan billing<br/>[Bill.cpp]"]
end

node_user(("User"))

node_user -->|"opens and selects"| node_desktop_entry

click node_desktop_entry "https://github.com/minimax-m31/minimax-m3.1-flash/blob/main/desk/Code.cpp"
click node_window "https://github.com/minimax-m31/minimax-m3.1-flash/blob/main/desk/Win.cpp"
click node_editor "https://github.com/minimax-m31/minimax-m3.1-flash/blob/main/desk/Editor.h"
click node_session "https://github.com/minimax-m31/minimax-m3.1-flash/blob/main/chat/Session.cpp"
click node_stream "https://github.com/minimax-m31/minimax-m3.1-flash/blob/main/chat/Stream.h"
click node_account_key "https://github.com/minimax-m31/minimax-m3.1-flash/blob/main/chat/Key.cpp"
click node_context "https://github.com/minimax-m31/minimax-m3.1-flash/blob/main/code/Context.h"
click node_model_token "https://github.com/minimax-m31/minimax-m3.1-flash/blob/main/code/Token.cpp"
click node_plan_gate "https://github.com/minimax-m31/minimax-m3.1-flash/blob/main/code/Plan.cpp"
click node_quota "https://github.com/minimax-m31/minimax-m3.1-flash/blob/main/token/Quota.h"
click node_meter "https://github.com/minimax-m31/minimax-m3.1-flash/blob/main/token/Meter.cpp"
click node_billing "https://github.com/minimax-m31/minimax-m3.1-flash/blob/main/token/Bill.cpp"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_desktop_entry,node_window,node_editor,node_user toneBlue
class node_session,node_stream,node_account_key toneAmber
class node_context,node_model_token,node_plan_gate toneMint
class node_quota,node_meter,node_billing toneRose
```

## Components

### Desktop app

- [Desktop entry](https://github.com/minimax-m31/minimax-m3.1-flash/blob/main/desk/Code.cpp): `desk/Code.cpp`
- [Windows window](https://github.com/minimax-m31/minimax-m3.1-flash/blob/main/desk/Win.cpp): `desk/Win.cpp`
- [Editor pane](https://github.com/minimax-m31/minimax-m3.1-flash/blob/main/desk/Editor.h): `desk/Editor.h`

### Coding session

- [Coding session](https://github.com/minimax-m31/minimax-m3.1-flash/blob/main/chat/Session.cpp): `chat/Session.cpp`
- [Token stream](https://github.com/minimax-m31/minimax-m3.1-flash/blob/main/chat/Stream.h): `chat/Stream.h`
- [Account key](https://github.com/minimax-m31/minimax-m3.1-flash/blob/main/chat/Key.cpp): `chat/Key.cpp`

### Model access

- [Context limit](https://github.com/minimax-m31/minimax-m3.1-flash/blob/main/code/Context.h): `code/Context.h`
- [Model token row](https://github.com/minimax-m31/minimax-m3.1-flash/blob/main/code/Token.cpp): `code/Token.cpp`
- [Token Plan gate](https://github.com/minimax-m31/minimax-m3.1-flash/blob/main/code/Plan.cpp): `code/Plan.cpp`

### Plan and usage

- [Plan quota](https://github.com/minimax-m31/minimax-m3.1-flash/blob/main/token/Quota.h): `token/Quota.h`
- [Token meter](https://github.com/minimax-m31/minimax-m3.1-flash/blob/main/token/Meter.cpp): `token/Meter.cpp`
- [Plan billing](https://github.com/minimax-m31/minimax-m3.1-flash/blob/main/token/Bill.cpp): `token/Bill.cpp`

### Other components

- **User**

## Connections

- User → Desktop entry: opens and selects (evidence: `README.md`)
