# jingyaogong/minimind-o architecture

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

- Interactive diagram: https://gitdiagram.com/jingyaogong/minimind-o
- Repository: https://github.com/jingyaogong/minimind-o

## Overview

MiniMind-O is a small end-to-end multimodal model and training project: it accepts text, audio, and images, generates a semantic response, and can produce streaming speech. The graph follows data preparation through SFT training and inference, then shows the CLI, Gradio demo, and realtime telephone-style WebUI as separate entry points. Internal model stages are documented in the README and partially visible in the sampled model code; unsampled implementation details are not expanded beyond those documented capabilities.

Main entry points: [`model/model_omni.py`](https://github.com/jingyaogong/minimind-o/blob/master/model/model_omni.py) (Thinker), [`trainer/train_sft_omni.py`](https://github.com/jingyaogong/minimind-o/blob/master/trainer/train_sft_omni.py) (SFT Trainer), [`webui/web_demo.py`](https://github.com/jingyaogong/minimind-o/blob/master/webui/web_demo.py) (Realtime WebUI), [`dataset/omni_dataset.py`](https://github.com/jingyaogong/minimind-o/blob/master/dataset/omni_dataset.py) (Dataset Pipeline)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data Preparation"]
  node_multimodal_data["SFT Data<br/>[omni_dataset.py]"]
  node_dataset_pipeline["Dataset Pipeline<br/>[omni_dataset.py]"]
end

subgraph group_training["Model Training"]
  node_trainer["SFT Trainer<br/>[train_sft_omni.py]"]
  node_training_utils["Training Utilities<br/>[trainer_utils.py]"]
end

subgraph group_model["Omni Model"]
  node_minimind["MiniMind Backbone<br/>[model_minimind.py]"]
  node_thinker["Thinker<br/>[model_omni.py]"]
  node_audio_projector["Audio Projector<br/>[model_omni.py]"]
  node_vision_projector["Vision Projector<br/>[model_omni.py]"]
  node_talker["Talker MTP<br/>[model_omni.py]"]
  node_speaker["Speaker Conditioning<br/>[model_omni.py]"]
  node_vad["Realtime VAD<br/>[model_omni.py]"]
  node_mimi["Mimi Audio Codec<br/>[model_omni.py]"]
end

subgraph group_inference["Inference Apps"]
  node_cli["CLI Evaluation<br/>[eval_omni.py]"]
  node_gradio_demo["Gradio Demo<br/>[web_demo_omni.py]"]
  node_realtime_webui["Realtime WebUI<br/>[web_demo.py]"]
end

node_user(("User"))

node_user -->|"provides examples"| node_dataset_pipeline
node_multimodal_data -->|"loads and prepares"| node_dataset_pipeline
node_dataset_pipeline -->|"supplies batches"| node_trainer
node_trainer -->|"uses helpers"| node_training_utils
node_trainer -->|"trains"| node_thinker
node_trainer -->|"trains"| node_talker
node_thinker -->|"builds on"| node_minimind
node_audio_projector -->|"injects audio features"| node_thinker
node_vision_projector -->|"injects image features"| node_thinker
node_thinker -->|"conditions speech"| node_talker
node_speaker -->|"conditions voice"| node_talker
node_talker -->|"predicts codec codes"| node_mimi
node_mimi -->|"streams speech"| node_user
node_user -->|"submits prompts"| node_cli
node_cli -->|"runs inference"| node_thinker
node_user -->|"submits multimodal input"| node_gradio_demo
node_gradio_demo -->|"runs inference"| node_thinker
node_user -->|"starts live session"| node_realtime_webui
node_realtime_webui -->|"runs inference"| node_thinker
node_realtime_webui -->|"detects speech activity"| node_vad
node_realtime_webui -->|"streams decoded audio"| node_mimi

click node_multimodal_data "https://github.com/jingyaogong/minimind-o/blob/master/dataset/omni_dataset.py"
click node_dataset_pipeline "https://github.com/jingyaogong/minimind-o/blob/master/dataset/omni_dataset.py"
click node_trainer "https://github.com/jingyaogong/minimind-o/blob/master/trainer/train_sft_omni.py"
click node_training_utils "https://github.com/jingyaogong/minimind-o/blob/master/trainer/trainer_utils.py"
click node_minimind "https://github.com/jingyaogong/minimind-o/blob/master/model/model_minimind.py"
click node_thinker "https://github.com/jingyaogong/minimind-o/blob/master/model/model_omni.py"
click node_audio_projector "https://github.com/jingyaogong/minimind-o/blob/master/model/model_omni.py"
click node_vision_projector "https://github.com/jingyaogong/minimind-o/blob/master/model/model_omni.py"
click node_talker "https://github.com/jingyaogong/minimind-o/blob/master/model/model_omni.py"
click node_speaker "https://github.com/jingyaogong/minimind-o/blob/master/model/model_omni.py"
click node_vad "https://github.com/jingyaogong/minimind-o/blob/master/model/model_omni.py"
click node_mimi "https://github.com/jingyaogong/minimind-o/blob/master/model/model_omni.py"
click node_cli "https://github.com/jingyaogong/minimind-o/blob/master/eval_omni.py"
click node_gradio_demo "https://github.com/jingyaogong/minimind-o/blob/master/scripts/web_demo_omni.py"
click node_realtime_webui "https://github.com/jingyaogong/minimind-o/blob/master/webui/web_demo.py"

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_multimodal_data,node_dataset_pipeline,node_user toneBlue
class node_trainer,node_training_utils toneAmber
class node_minimind,node_thinker,node_audio_projector,node_vision_projector,node_talker,node_speaker,node_vad,node_mimi toneMint
class node_cli,node_gradio_demo,node_realtime_webui toneRose
```

## Components

### Data Preparation

- [SFT Data](https://github.com/jingyaogong/minimind-o/blob/master/dataset/omni_dataset.py): `dataset/omni_dataset.py`
- [Dataset Pipeline](https://github.com/jingyaogong/minimind-o/blob/master/dataset/omni_dataset.py): `dataset/omni_dataset.py`

### Model Training

- [SFT Trainer](https://github.com/jingyaogong/minimind-o/blob/master/trainer/train_sft_omni.py): `trainer/train_sft_omni.py`
- [Training Utilities](https://github.com/jingyaogong/minimind-o/blob/master/trainer/trainer_utils.py): `trainer/trainer_utils.py`

### Omni Model

- [MiniMind Backbone](https://github.com/jingyaogong/minimind-o/blob/master/model/model_minimind.py): `model/model_minimind.py`
- [Thinker](https://github.com/jingyaogong/minimind-o/blob/master/model/model_omni.py): `model/model_omni.py`
- [Audio Projector](https://github.com/jingyaogong/minimind-o/blob/master/model/model_omni.py): `model/model_omni.py`
- [Vision Projector](https://github.com/jingyaogong/minimind-o/blob/master/model/model_omni.py): `model/model_omni.py`
- [Talker MTP](https://github.com/jingyaogong/minimind-o/blob/master/model/model_omni.py): `model/model_omni.py`
- [Speaker Conditioning](https://github.com/jingyaogong/minimind-o/blob/master/model/model_omni.py): `model/model_omni.py`
- [Realtime VAD](https://github.com/jingyaogong/minimind-o/blob/master/model/model_omni.py): `model/model_omni.py`
- [Mimi Audio Codec](https://github.com/jingyaogong/minimind-o/blob/master/model/model_omni.py): `model/model_omni.py`

### Inference Apps

- [CLI Evaluation](https://github.com/jingyaogong/minimind-o/blob/master/eval_omni.py): `eval_omni.py`
- [Gradio Demo](https://github.com/jingyaogong/minimind-o/blob/master/scripts/web_demo_omni.py): `scripts/web_demo_omni.py`
- [Realtime WebUI](https://github.com/jingyaogong/minimind-o/blob/master/webui/web_demo.py): `webui/web_demo.py`

### Other components

- **User**

## Connections

- User → Dataset Pipeline: provides examples
- SFT Data → Dataset Pipeline: loads and prepares (evidence: `dataset/omni_dataset.py`)
- Dataset Pipeline → SFT Trainer: supplies batches (evidence: `trainer/train_sft_omni.py`)
- SFT Trainer → Training Utilities: uses helpers (evidence: `trainer/train_sft_omni.py`)
- SFT Trainer → Thinker: trains (evidence: `trainer/train_sft_omni.py`)
- SFT Trainer → Talker MTP: trains (evidence: `trainer/train_sft_omni.py`)
- Thinker → MiniMind Backbone: builds on (evidence: `model/model_omni.py`)
- Audio Projector → Thinker: injects audio features (evidence: `model/model_omni.py`)
- Vision Projector → Thinker: injects image features (evidence: `model/model_omni.py`)
- Thinker → Talker MTP: conditions speech (evidence: `model/model_omni.py`)
- Speaker Conditioning → Talker MTP: conditions voice (evidence: `model/model_omni.py`)
- Talker MTP → Mimi Audio Codec: predicts codec codes (evidence: `model/model_omni.py`)
- Mimi Audio Codec → User: streams speech
- User → CLI Evaluation: submits prompts
- CLI Evaluation → Thinker: runs inference (evidence: `eval_omni.py`)
- User → Gradio Demo: submits multimodal input (evidence: `scripts/web_demo_omni.py`)
- Gradio Demo → Thinker: runs inference (evidence: `scripts/web_demo_omni.py`)
- User → Realtime WebUI: starts live session
- Realtime WebUI → Thinker: runs inference (evidence: `webui/web_demo.py`)
- Realtime WebUI → Realtime VAD: detects speech activity (evidence: `webui/web_demo.py`)
- Realtime WebUI → Mimi Audio Codec: streams decoded audio (evidence: `webui/web_demo.py`)
