# taoliveaigc/taomate-h3 architecture

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

- Interactive diagram: https://gitdiagram.com/taoliveaigc/taomate-h3
- Repository: https://github.com/taoliveaigc/taomate-h3

## Overview

TaoMate-H3 is a distributed, low-latency streaming text-to-audio-video generation runtime. The main workflow accepts prompts and generation settings, launches local GPU workers, performs chunked Stage3 inference with continuity state, then decodes and publishes video. The graph preserves the documented audio-guidance, resolution, and parallel-inference capabilities. Some internal links use README or SOURCE INDEX evidence because the relevant source was not excerpted; uncertain implementation details are not expanded.

Main entry points: [`src/taomate_h3/model/pipeline.py`](https://github.com/taoliveaigc/taomate-h3/blob/main/src/taomate_h3/model/pipeline.py) (H3 pipeline), [`src/taomate_h3/runtime/direct.py`](https://github.com/taoliveaigc/taomate-h3/blob/main/src/taomate_h3/runtime/direct.py) (Direct runtime), [`src/taomate_h3/runner.py`](https://github.com/taoliveaigc/taomate-h3/blob/main/src/taomate_h3/runner.py) (Run coordinator), [`src/taomate_h3/streaming/runtime.py`](https://github.com/taoliveaigc/taomate-h3/blob/main/src/taomate_h3/streaming/runtime.py) (Chunk generation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_request["Request and orchestration"]
  node_cli["CLI<br/>[cli.py]"]
  node_config["Run configuration<br/>[config.py]"]
  node_runner["Run coordinator<br/>[runner.py]"]
  node_worker["GPU worker<br/>[worker.py]"]
end

subgraph group_stream["Streaming generation"]
  node_stream_runtime["Chunk generation<br/>[runtime.py]"]
  node_stream_session["Stream session<br/>[session.py]"]
  node_stream_cache[("Clean KV cache<br/>[cache.py]")]
  node_stream_geometry["Chunk geometry<br/>[geometry.py]"]
  node_attention_hook["Attention hook<br/>[attention_hook.py]"]
end

subgraph group_model["Model inference"]
  node_direct["Direct runtime<br/>[direct.py]"]
  node_pipeline["H3 pipeline<br/>[pipeline.py]"]
  node_text_encoder["Text encoding<br/>[text_encoder.py]"]
  node_dit["H3 transformer<br/>[dit.py]"]
  node_denoise["Denoising<br/>[denoise.py]"]
  node_architecture["Model architecture<br/>[architecture.py]"]
  node_layers["Transformer layers<br/>[layers.py]"]
  node_packed_sequence["Packed sequences<br/>[packed_sequence.py]"]
  node_geometry["AV geometry<br/>[geometry.py]"]
  node_teacher["Audio guidance<br/>[teacher.py]"]
  node_base_teacher["Teacher denoising<br/>[base10_teacher.py]"]
  node_schedule["Denoise schedule"]
  node_fused["Fused kernels<br/>[fused_kernels.py]"]
  node_w8a8["W8A8 acceleration<br/>[w8a8.py]"]
  node_lora["LoRA loading<br/>[lora_checkpoint.py]"]
end

subgraph group_parallel["Parallel execution"]
  node_parallel["TP and Ulysses<br/>[parallel.py]"]
  node_linear["Sharded linear layers<br/>[linear.py]"]
  node_collectives["Collectives<br/>[collectives.py]"]
  node_ulysses["Sequence parallelism<br/>[ulysses.py]"]
end

subgraph group_media["Media output"]
  node_output["VAE and output<br/>[output.py]"]
  node_video["Published video"]
end

node_user(("User"))

node_user -->|"provides prompts"| node_cli
node_cli -->|"parses settings"| node_config
node_cli -->|"starts run"| node_runner
node_runner -->|"launches workers"| node_worker
node_runner -->|"invokes runtime"| node_direct
node_direct -->|"loads pipeline"| node_pipeline
node_direct -->|"generates chunks"| node_stream_runtime
node_stream_runtime -->|"plans chunks"| node_stream_geometry
node_stream_runtime -->|"manages session"| node_stream_session
node_stream_session -->|"installs hook"| node_attention_hook
node_stream_session -->|"commits KV"| node_stream_cache
node_stream_runtime -->|"runs denoising"| node_denoise
node_pipeline -->|"encodes prompts"| node_text_encoder
node_pipeline -->|"runs transformer"| node_dit
node_pipeline -->|"decodes latents"| node_output
node_pipeline -->|"packs inputs"| node_packed_sequence
node_pipeline -->|"uses geometry"| node_geometry
node_denoise -->|"uses architecture"| node_architecture
node_dit -->|"builds layers"| node_layers
node_layers -->|"dispatches attention"| node_attention_hook
node_runner -.->|"prepares guidance"| node_teacher
node_teacher -->|"uses teacher model"| node_base_teacher
node_teacher -->|"encodes guidance"| node_pipeline
node_teacher -->|"uses schedule"| node_schedule
node_direct -->|"sets topology"| node_parallel
node_dit -->|"uses sharded layers"| node_linear
node_linear -->|"uses collectives"| node_collectives
node_dit -->|"uses sequence parallelism"| node_ulysses
node_layers -->|"uses fused ops"| node_fused
node_direct -->|"configures acceleration"| node_w8a8
node_direct -->|"loads adapter"| node_lora
node_runner -->|"writes video"| node_video
node_output -->|"publishes media"| node_video

click node_cli "https://github.com/taoliveaigc/taomate-h3/blob/main/src/taomate_h3/cli.py"
click node_config "https://github.com/taoliveaigc/taomate-h3/blob/main/src/taomate_h3/config.py"
click node_runner "https://github.com/taoliveaigc/taomate-h3/blob/main/src/taomate_h3/runner.py"
click node_worker "https://github.com/taoliveaigc/taomate-h3/blob/main/src/taomate_h3/worker.py"
click node_direct "https://github.com/taoliveaigc/taomate-h3/blob/main/src/taomate_h3/runtime/direct.py"
click node_stream_runtime "https://github.com/taoliveaigc/taomate-h3/blob/main/src/taomate_h3/streaming/runtime.py"
click node_stream_session "https://github.com/taoliveaigc/taomate-h3/blob/main/src/taomate_h3/streaming/session.py"
click node_stream_cache "https://github.com/taoliveaigc/taomate-h3/blob/main/src/taomate_h3/streaming/cache.py"
click node_stream_geometry "https://github.com/taoliveaigc/taomate-h3/blob/main/src/taomate_h3/streaming/geometry.py"
click node_attention_hook "https://github.com/taoliveaigc/taomate-h3/blob/main/src/taomate_h3/streaming/attention_hook.py"
click node_pipeline "https://github.com/taoliveaigc/taomate-h3/blob/main/src/taomate_h3/model/pipeline.py"
click node_text_encoder "https://github.com/taoliveaigc/taomate-h3/blob/main/src/taomate_h3/model/text_encoder.py"
click node_dit "https://github.com/taoliveaigc/taomate-h3/blob/main/src/taomate_h3/model/dit.py"
click node_denoise "https://github.com/taoliveaigc/taomate-h3/blob/main/src/taomate_h3/model/denoise.py"
click node_architecture "https://github.com/taoliveaigc/taomate-h3/blob/main/src/taomate_h3/model/architecture.py"
click node_layers "https://github.com/taoliveaigc/taomate-h3/blob/main/src/taomate_h3/model/layers.py"
click node_packed_sequence "https://github.com/taoliveaigc/taomate-h3/blob/main/src/taomate_h3/model/packed_sequence.py"
click node_geometry "https://github.com/taoliveaigc/taomate-h3/blob/main/src/taomate_h3/model/geometry.py"
click node_output "https://github.com/taoliveaigc/taomate-h3/blob/main/src/taomate_h3/model/output.py"
click node_teacher "https://github.com/taoliveaigc/taomate-h3/blob/main/src/taomate_h3/teacher.py"
click node_base_teacher "https://github.com/taoliveaigc/taomate-h3/blob/main/src/taomate_h3/inference/base10_teacher.py"
click node_schedule "https://github.com/taoliveaigc/taomate-h3/blob/main/src/taomate_h3/denoise_schedule.py"
click node_parallel "https://github.com/taoliveaigc/taomate-h3/blob/main/src/taomate_h3/distributed/parallel.py"
click node_linear "https://github.com/taoliveaigc/taomate-h3/blob/main/src/taomate_h3/distributed/linear.py"
click node_collectives "https://github.com/taoliveaigc/taomate-h3/blob/main/src/taomate_h3/distributed/collectives.py"
click node_ulysses "https://github.com/taoliveaigc/taomate-h3/blob/main/src/taomate_h3/distributed/ulysses.py"
click node_fused "https://github.com/taoliveaigc/taomate-h3/blob/main/src/taomate_h3/inference/fused_kernels.py"
click node_w8a8 "https://github.com/taoliveaigc/taomate-h3/blob/main/src/taomate_h3/inference/w8a8.py"
click node_lora "https://github.com/taoliveaigc/taomate-h3/blob/main/src/taomate_h3/inference/lora_checkpoint.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_cli,node_config,node_runner,node_worker,node_user toneBlue
class node_stream_runtime,node_stream_session,node_stream_cache,node_stream_geometry,node_attention_hook toneAmber
class node_direct,node_pipeline,node_text_encoder,node_dit,node_denoise,node_architecture,node_layers,node_packed_sequence,node_geometry,node_teacher,node_base_teacher,node_schedule,node_fused,node_w8a8,node_lora toneMint
class node_parallel,node_linear,node_collectives,node_ulysses toneRose
class node_output,node_video toneIndigo
```

## Components

### Request and orchestration

- [CLI](https://github.com/taoliveaigc/taomate-h3/blob/main/src/taomate_h3/cli.py): `src/taomate_h3/cli.py`
- [Run configuration](https://github.com/taoliveaigc/taomate-h3/blob/main/src/taomate_h3/config.py): `src/taomate_h3/config.py`
- [Run coordinator](https://github.com/taoliveaigc/taomate-h3/blob/main/src/taomate_h3/runner.py): `src/taomate_h3/runner.py`
- [GPU worker](https://github.com/taoliveaigc/taomate-h3/blob/main/src/taomate_h3/worker.py): `src/taomate_h3/worker.py`

### Streaming generation

- [Chunk generation](https://github.com/taoliveaigc/taomate-h3/blob/main/src/taomate_h3/streaming/runtime.py): `src/taomate_h3/streaming/runtime.py`
- [Stream session](https://github.com/taoliveaigc/taomate-h3/blob/main/src/taomate_h3/streaming/session.py): `src/taomate_h3/streaming/session.py`
- [Clean KV cache](https://github.com/taoliveaigc/taomate-h3/blob/main/src/taomate_h3/streaming/cache.py): `src/taomate_h3/streaming/cache.py`
- [Chunk geometry](https://github.com/taoliveaigc/taomate-h3/blob/main/src/taomate_h3/streaming/geometry.py): `src/taomate_h3/streaming/geometry.py`
- [Attention hook](https://github.com/taoliveaigc/taomate-h3/blob/main/src/taomate_h3/streaming/attention_hook.py): `src/taomate_h3/streaming/attention_hook.py`

### Model inference

- [Direct runtime](https://github.com/taoliveaigc/taomate-h3/blob/main/src/taomate_h3/runtime/direct.py): `src/taomate_h3/runtime/direct.py`
- [H3 pipeline](https://github.com/taoliveaigc/taomate-h3/blob/main/src/taomate_h3/model/pipeline.py): `src/taomate_h3/model/pipeline.py`
- [Text encoding](https://github.com/taoliveaigc/taomate-h3/blob/main/src/taomate_h3/model/text_encoder.py): `src/taomate_h3/model/text_encoder.py`
- [H3 transformer](https://github.com/taoliveaigc/taomate-h3/blob/main/src/taomate_h3/model/dit.py): `src/taomate_h3/model/dit.py`
- [Denoising](https://github.com/taoliveaigc/taomate-h3/blob/main/src/taomate_h3/model/denoise.py): `src/taomate_h3/model/denoise.py`
- [Model architecture](https://github.com/taoliveaigc/taomate-h3/blob/main/src/taomate_h3/model/architecture.py): `src/taomate_h3/model/architecture.py`
- [Transformer layers](https://github.com/taoliveaigc/taomate-h3/blob/main/src/taomate_h3/model/layers.py): `src/taomate_h3/model/layers.py`
- [Packed sequences](https://github.com/taoliveaigc/taomate-h3/blob/main/src/taomate_h3/model/packed_sequence.py): `src/taomate_h3/model/packed_sequence.py`
- [AV geometry](https://github.com/taoliveaigc/taomate-h3/blob/main/src/taomate_h3/model/geometry.py): `src/taomate_h3/model/geometry.py`
- [Audio guidance](https://github.com/taoliveaigc/taomate-h3/blob/main/src/taomate_h3/teacher.py): `src/taomate_h3/teacher.py`
- [Teacher denoising](https://github.com/taoliveaigc/taomate-h3/blob/main/src/taomate_h3/inference/base10_teacher.py): `src/taomate_h3/inference/base10_teacher.py`
- [Denoise schedule](https://github.com/taoliveaigc/taomate-h3/blob/main/src/taomate_h3/denoise_schedule.py): `src/taomate_h3/denoise_schedule.py`
- [Fused kernels](https://github.com/taoliveaigc/taomate-h3/blob/main/src/taomate_h3/inference/fused_kernels.py): `src/taomate_h3/inference/fused_kernels.py`
- [W8A8 acceleration](https://github.com/taoliveaigc/taomate-h3/blob/main/src/taomate_h3/inference/w8a8.py): `src/taomate_h3/inference/w8a8.py`
- [LoRA loading](https://github.com/taoliveaigc/taomate-h3/blob/main/src/taomate_h3/inference/lora_checkpoint.py): `src/taomate_h3/inference/lora_checkpoint.py`

### Parallel execution

- [TP and Ulysses](https://github.com/taoliveaigc/taomate-h3/blob/main/src/taomate_h3/distributed/parallel.py): `src/taomate_h3/distributed/parallel.py`
- [Sharded linear layers](https://github.com/taoliveaigc/taomate-h3/blob/main/src/taomate_h3/distributed/linear.py): `src/taomate_h3/distributed/linear.py`
- [Collectives](https://github.com/taoliveaigc/taomate-h3/blob/main/src/taomate_h3/distributed/collectives.py): `src/taomate_h3/distributed/collectives.py`
- [Sequence parallelism](https://github.com/taoliveaigc/taomate-h3/blob/main/src/taomate_h3/distributed/ulysses.py): `src/taomate_h3/distributed/ulysses.py`

### Media output

- [VAE and output](https://github.com/taoliveaigc/taomate-h3/blob/main/src/taomate_h3/model/output.py): `src/taomate_h3/model/output.py`
- **Published video**

### Other components

- **User**

## Connections

- User → CLI: provides prompts
- CLI → Run configuration: parses settings (evidence: `src/taomate_h3/cli.py`)
- CLI → Run coordinator: starts run (evidence: `src/taomate_h3/cli.py`)
- Run coordinator → GPU worker: launches workers (evidence: `src/taomate_h3/worker.py`)
- Run coordinator → Direct runtime: invokes runtime (evidence: `src/taomate_h3/runner.py`)
- Direct runtime → H3 pipeline: loads pipeline (evidence: `src/taomate_h3/runtime/direct.py`)
- Direct runtime → Chunk generation: generates chunks
- Chunk generation → Chunk geometry: plans chunks (evidence: `src/taomate_h3/streaming/runtime.py`)
- Chunk generation → Stream session: manages session (evidence: `src/taomate_h3/streaming/runtime.py`)
- Stream session → Attention hook: installs hook (evidence: `src/taomate_h3/streaming/session.py`)
- Stream session → Clean KV cache: commits KV (evidence: `src/taomate_h3/streaming/session.py`)
- Chunk generation → Denoising: runs denoising (evidence: `src/taomate_h3/streaming/runtime.py`)
- H3 pipeline → Text encoding: encodes prompts (evidence: `src/taomate_h3/model/pipeline.py`)
- H3 pipeline → H3 transformer: runs transformer (evidence: `src/taomate_h3/model/pipeline.py`)
- H3 pipeline → VAE and output: decodes latents (evidence: `src/taomate_h3/model/pipeline.py`)
- H3 pipeline → Packed sequences: packs inputs (evidence: `src/taomate_h3/model/pipeline.py`)
- H3 pipeline → AV geometry: uses geometry (evidence: `src/taomate_h3/model/pipeline.py`)
- Denoising → Model architecture: uses architecture (evidence: `src/taomate_h3/model/denoise.py`)
- H3 transformer → Transformer layers: builds layers (evidence: `src/taomate_h3/model/dit.py`)
- Transformer layers → Attention hook: dispatches attention (evidence: `src/taomate_h3/model/layers.py`)
- Run coordinator → Audio guidance: prepares guidance (evidence: `src/taomate_h3/runner.py`)
- Audio guidance → Teacher denoising: uses teacher model (evidence: `src/taomate_h3/teacher.py`)
- Audio guidance → H3 pipeline: encodes guidance (evidence: `src/taomate_h3/teacher.py`)
- Audio guidance → Denoise schedule: uses schedule (evidence: `src/taomate_h3/teacher.py`)
- Direct runtime → TP and Ulysses: sets topology (evidence: `src/taomate_h3/runtime/direct.py`)
- H3 transformer → Sharded linear layers: uses sharded layers (evidence: `src/taomate_h3/model/dit.py`)
- Sharded linear layers → Collectives: uses collectives (evidence: `src/taomate_h3/distributed/linear.py`)
- H3 transformer → Sequence parallelism: uses sequence parallelism (evidence: `src/taomate_h3/model/dit.py`)
- Transformer layers → Fused kernels: uses fused ops (evidence: `src/taomate_h3/model/layers.py`)
- Direct runtime → W8A8 acceleration: configures acceleration (evidence: `src/taomate_h3/runtime/direct.py`)
- Direct runtime → LoRA loading: loads adapter (evidence: `src/taomate_h3/runtime/direct.py`)
- Run coordinator → Published video: writes video
- VAE and output → Published video: publishes media
