# miler777/omnivoice architecture

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

- Interactive diagram: https://gitdiagram.com/miler777/omnivoice
- Repository: https://github.com/miler777/omnivoice

## Overview

OmniVoice is a multilingual zero-shot text-to-speech system for speech generation, voice cloning, and voice design. The principal workflow accepts text and optional voice references or speaker instructions, prepares inputs, generates audio with the OmniVoice model, and returns speech. Separate branches cover model training and speech-quality evaluation. The graph includes documented capabilities whose implementation details were not sampled; dashed edges with null evidence mark relationships that cannot be verified from the excerpts.

Main entry points: [`omnivoice/models/omnivoice.py`](https://github.com/miler777/omnivoice/blob/master/omnivoice/models/omnivoice.py) (TTS model), [`omnivoice/training/builder.py`](https://github.com/miler777/omnivoice/blob/master/omnivoice/training/builder.py) (Training builder), [`omnivoice/cli/train.py`](https://github.com/miler777/omnivoice/blob/master/omnivoice/cli/train.py) (Training CLI), [`omnivoice/eval/wer`](https://github.com/miler777/omnivoice/tree/master/omnivoice/eval/wer) (WER evaluation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_generation["Speech generation"]
  node_python_api["Python API<br/>[__init__.py]"]
  node_demo["Web demo<br/>[demo.py]"]
  node_cli_infer["CLI inference<br/>[infer.py]"]
  node_batch_infer["Batch inference<br/>[infer_batch.py]"]
  node_model["TTS model<br/>[omnivoice.py]"]
  node_fast_model["FlashInfer model"]
  node_voice_design["Voice design<br/>[voice_design.py]"]
end

subgraph group_training["Model training"]
  node_training_cli["Training CLI<br/>[train.py]"]
  node_builder["Training builder<br/>[builder.py]"]
  node_train_data["Training data<br/>[dataset.py]"]
  node_batching["Batching<br/>[batching.py]"]
  node_collator["Data collator<br/>[collator.py]"]
  node_processor["Data processor<br/>[processor.py]"]
  node_trainer["Trainer<br/>[trainer.py]"]
  node_train_config["Training config<br/>[config.py]"]
end

subgraph group_evaluation["Speech evaluation"]
  node_wer["WER evaluation"]
  node_mos["MOS evaluation<br/>[utmos.py]"]
  node_speaker_eval["Speaker similarity<br/>[sim.py]"]
end

subgraph group_shared["Shared processing"]
  node_audio_utils["Audio processing<br/>[audio.py]"]
  node_text_utils["Text processing<br/>[text.py]"]
  node_language_map["Language mapping<br/>[lang_map.py]"]
  node_test_lists["Test-list reader<br/>[data_utils.py]"]
  node_eval_audio["Evaluation audio<br/>[utils.py]"]
end

node_user(("User"))

node_user -->|"requests speech"| node_python_api
node_python_api -->|"generates audio"| node_model
node_user -->|"requests demo"| node_demo
node_demo -.->|"generates with"| node_model
node_user -->|"requests inference"| node_cli_infer
node_cli_infer -.->|"runs inference"| node_model
node_user -->|"requests batch speech"| node_batch_infer
node_batch_infer -.->|"runs inference"| node_model
node_model -->|"processes audio with"| node_audio_utils
node_model -->|"processes text with"| node_text_utils
node_model -->|"uses language map"| node_language_map
node_fast_model -->|"extends model"| node_model
node_model -->|"supports voice design"| node_voice_design
node_user -.->|"starts training"| node_training_cli
node_training_cli -->|"builds training setup"| node_builder
node_builder -->|"uses configuration"| node_train_config
node_builder -->|"constructs model"| node_model
node_builder -->|"builds data loaders"| node_train_data
node_builder -->|"configures batching"| node_batching
node_builder -->|"configures collator"| node_collator
node_builder -->|"configures processor"| node_processor
node_training_cli -->|"starts training"| node_trainer
node_trainer -.->|"trains model"| node_model
node_user -.->|"evaluates speech"| node_wer
node_user -.->|"evaluates quality"| node_mos
node_user -.->|"evaluates similarity"| node_speaker_eval
node_wer -->|"reads test lists"| node_test_lists
node_mos -->|"reads test lists"| node_test_lists
node_speaker_eval -->|"reads test lists"| node_test_lists
node_wer -.->|"loads audio with"| node_eval_audio
node_mos -->|"loads audio with"| node_eval_audio
node_speaker_eval -->|"loads audio with"| node_eval_audio

click node_python_api "https://github.com/miler777/omnivoice/blob/master/omnivoice/__init__.py"
click node_demo "https://github.com/miler777/omnivoice/blob/master/omnivoice/cli/demo.py"
click node_cli_infer "https://github.com/miler777/omnivoice/blob/master/omnivoice/cli/infer.py"
click node_batch_infer "https://github.com/miler777/omnivoice/blob/master/omnivoice/cli/infer_batch.py"
click node_model "https://github.com/miler777/omnivoice/blob/master/omnivoice/models/omnivoice.py"
click node_fast_model "https://github.com/miler777/omnivoice/blob/master/omnivoice/models/omnivoice_flashinfer.py"
click node_voice_design "https://github.com/miler777/omnivoice/blob/master/omnivoice/utils/voice_design.py"
click node_training_cli "https://github.com/miler777/omnivoice/blob/master/omnivoice/cli/train.py"
click node_builder "https://github.com/miler777/omnivoice/blob/master/omnivoice/training/builder.py"
click node_train_data "https://github.com/miler777/omnivoice/blob/master/omnivoice/data/dataset.py"
click node_batching "https://github.com/miler777/omnivoice/blob/master/omnivoice/data/batching.py"
click node_collator "https://github.com/miler777/omnivoice/blob/master/omnivoice/data/collator.py"
click node_processor "https://github.com/miler777/omnivoice/blob/master/omnivoice/data/processor.py"
click node_trainer "https://github.com/miler777/omnivoice/blob/master/omnivoice/training/trainer.py"
click node_train_config "https://github.com/miler777/omnivoice/blob/master/omnivoice/training/config.py"
click node_wer "https://github.com/miler777/omnivoice/tree/master/omnivoice/eval/wer"
click node_mos "https://github.com/miler777/omnivoice/blob/master/omnivoice/eval/mos/utmos.py"
click node_speaker_eval "https://github.com/miler777/omnivoice/blob/master/omnivoice/eval/speaker_similarity/sim.py"
click node_audio_utils "https://github.com/miler777/omnivoice/blob/master/omnivoice/utils/audio.py"
click node_text_utils "https://github.com/miler777/omnivoice/blob/master/omnivoice/utils/text.py"
click node_language_map "https://github.com/miler777/omnivoice/blob/master/omnivoice/utils/lang_map.py"
click node_test_lists "https://github.com/miler777/omnivoice/blob/master/omnivoice/utils/data_utils.py"
click node_eval_audio "https://github.com/miler777/omnivoice/blob/master/omnivoice/eval/utils.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_python_api,node_demo,node_cli_infer,node_batch_infer,node_model,node_fast_model,node_voice_design,node_user toneBlue
class node_training_cli,node_builder,node_train_data,node_batching,node_collator,node_processor,node_trainer,node_train_config toneAmber
class node_wer,node_mos,node_speaker_eval toneMint
class node_audio_utils,node_text_utils,node_language_map,node_test_lists,node_eval_audio toneRose
```

## Components

### Speech generation

- [Python API](https://github.com/miler777/omnivoice/blob/master/omnivoice/__init__.py): `omnivoice/__init__.py`
- [Web demo](https://github.com/miler777/omnivoice/blob/master/omnivoice/cli/demo.py): `omnivoice/cli/demo.py`
- [CLI inference](https://github.com/miler777/omnivoice/blob/master/omnivoice/cli/infer.py): `omnivoice/cli/infer.py`
- [Batch inference](https://github.com/miler777/omnivoice/blob/master/omnivoice/cli/infer_batch.py): `omnivoice/cli/infer_batch.py`
- [TTS model](https://github.com/miler777/omnivoice/blob/master/omnivoice/models/omnivoice.py): `omnivoice/models/omnivoice.py`
- [FlashInfer model](https://github.com/miler777/omnivoice/blob/master/omnivoice/models/omnivoice_flashinfer.py): `omnivoice/models/omnivoice_flashinfer.py`
- [Voice design](https://github.com/miler777/omnivoice/blob/master/omnivoice/utils/voice_design.py): `omnivoice/utils/voice_design.py`

### Model training

- [Training CLI](https://github.com/miler777/omnivoice/blob/master/omnivoice/cli/train.py): `omnivoice/cli/train.py`
- [Training builder](https://github.com/miler777/omnivoice/blob/master/omnivoice/training/builder.py): `omnivoice/training/builder.py`
- [Training data](https://github.com/miler777/omnivoice/blob/master/omnivoice/data/dataset.py): `omnivoice/data/dataset.py`
- [Batching](https://github.com/miler777/omnivoice/blob/master/omnivoice/data/batching.py): `omnivoice/data/batching.py`
- [Data collator](https://github.com/miler777/omnivoice/blob/master/omnivoice/data/collator.py): `omnivoice/data/collator.py`
- [Data processor](https://github.com/miler777/omnivoice/blob/master/omnivoice/data/processor.py): `omnivoice/data/processor.py`
- [Trainer](https://github.com/miler777/omnivoice/blob/master/omnivoice/training/trainer.py): `omnivoice/training/trainer.py`
- [Training config](https://github.com/miler777/omnivoice/blob/master/omnivoice/training/config.py): `omnivoice/training/config.py`

### Speech evaluation

- [WER evaluation](https://github.com/miler777/omnivoice/tree/master/omnivoice/eval/wer): `omnivoice/eval/wer`
- [MOS evaluation](https://github.com/miler777/omnivoice/blob/master/omnivoice/eval/mos/utmos.py): `omnivoice/eval/mos/utmos.py`
- [Speaker similarity](https://github.com/miler777/omnivoice/blob/master/omnivoice/eval/speaker_similarity/sim.py): `omnivoice/eval/speaker_similarity/sim.py`

### Shared processing

- [Audio processing](https://github.com/miler777/omnivoice/blob/master/omnivoice/utils/audio.py): `omnivoice/utils/audio.py`
- [Text processing](https://github.com/miler777/omnivoice/blob/master/omnivoice/utils/text.py): `omnivoice/utils/text.py`
- [Language mapping](https://github.com/miler777/omnivoice/blob/master/omnivoice/utils/lang_map.py): `omnivoice/utils/lang_map.py`
- [Test-list reader](https://github.com/miler777/omnivoice/blob/master/omnivoice/utils/data_utils.py): `omnivoice/utils/data_utils.py`
- [Evaluation audio](https://github.com/miler777/omnivoice/blob/master/omnivoice/eval/utils.py): `omnivoice/eval/utils.py`

### Other components

- **User**

## Connections

- User → Python API: requests speech (evidence: `README.md`)
- Python API → TTS model: generates audio (evidence: `README.md`)
- User → Web demo: requests demo (evidence: `README.md`)
- Web demo → TTS model: generates with (evidence: `omnivoice/cli/demo.py`)
- User → CLI inference: requests inference (evidence: `README.md`)
- CLI inference → TTS model: runs inference (evidence: `omnivoice/cli/infer.py`)
- User → Batch inference: requests batch speech (evidence: `README.md`)
- Batch inference → TTS model: runs inference (evidence: `omnivoice/cli/infer_batch.py`)
- TTS model → Audio processing: processes audio with (evidence: `omnivoice/models/omnivoice.py`)
- TTS model → Text processing: processes text with (evidence: `omnivoice/models/omnivoice.py`)
- TTS model → Language mapping: uses language map (evidence: `omnivoice/models/omnivoice.py`)
- FlashInfer model → TTS model: extends model (evidence: `omnivoice/models/omnivoice_flashinfer.py`)
- TTS model → Voice design: supports voice design (evidence: `omnivoice/models/omnivoice.py`)
- User → Training CLI: starts training
- Training CLI → Training builder: builds training setup (evidence: `omnivoice/cli/train.py`)
- Training builder → Training config: uses configuration (evidence: `omnivoice/training/builder.py`)
- Training builder → TTS model: constructs model (evidence: `omnivoice/training/builder.py`)
- Training builder → Training data: builds data loaders (evidence: `omnivoice/training/builder.py`)
- Training builder → Batching: configures batching (evidence: `omnivoice/training/builder.py`)
- Training builder → Data collator: configures collator (evidence: `omnivoice/training/builder.py`)
- Training builder → Data processor: configures processor (evidence: `omnivoice/training/builder.py`)
- Training CLI → Trainer: starts training (evidence: `omnivoice/cli/train.py`)
- Trainer → TTS model: trains model
- User → WER evaluation: evaluates speech
- User → MOS evaluation: evaluates quality
- User → Speaker similarity: evaluates similarity
- WER evaluation → Test-list reader: reads test lists (evidence: `omnivoice/eval/wer/fleurs.py`)
- MOS evaluation → Test-list reader: reads test lists (evidence: `omnivoice/eval/mos/utmos.py`)
- Speaker similarity → Test-list reader: reads test lists (evidence: `omnivoice/eval/speaker_similarity/sim.py`)
- WER evaluation → Evaluation audio: loads audio with (evidence: `omnivoice/eval/wer/minimax.py`)
- MOS evaluation → Evaluation audio: loads audio with (evidence: `omnivoice/eval/mos/utmos.py`)
- Speaker similarity → Evaluation audio: loads audio with (evidence: `omnivoice/eval/speaker_similarity/sim.py`)
