# rbitts/live architecture

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

- Interactive diagram: https://gitdiagram.com/rbitts/live
- Repository: https://github.com/rbitts/live

## Overview

Open-weight Live is a local, single-user PoC for comparing a native MiniCPM-o live path with a Korean Qwen full-duplex system. In the Qwen workflow, the browser streams audio and camera frames to a WebSocket gateway; a session handles speech detection, interruption, and temporary conversation context, then coordinates ASR, visual-language response, and streamed TTS before returning transcript, text, and audio events. The native path is separately documented and uses an adapter to the official demo. Worker internals and the native upstream UI are not fully sampled, so those links are limited to documented behavior.

Main entry points: [`web/index.html`](https://github.com/rbitts/live/blob/main/web/index.html) (Live browser UI), [`src/live/backend.py`](https://github.com/rbitts/live/blob/main/src/live/backend.py) (Qwen coordinator), [`src/live/app.py`](https://github.com/rbitts/live/blob/main/src/live/app.py) (WebSocket gateway), [`src/live/session.py`](https://github.com/rbitts/live/blob/main/src/live/session.py) (Live session)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Browser client"]
  node_browser["Live browser UI<br/>[index.html]"]
  node_capture["Audio capture<br/>[worklet.js]"]
end

subgraph group_gateway["Gateway and session"]
  node_app["WebSocket gateway<br/>[app.py]"]
  node_session["Live session<br/>[session.py]"]
  node_backend["Qwen coordinator<br/>[backend.py]"]
end

subgraph group_qwen["Qwen inference"]
  node_asr["Speech recognition<br/>[model_worker.py]"]
  node_vlm["Visual response<br/>[model_worker.py]"]
  node_tts["Speech synthesis<br/>[model_worker.py]"]
end

subgraph group_native["Native path"]
  node_native_config["Native profile<br/>[native.json]"]
  node_native_adapter["Native adapter<br/>[native_backend.py]"]
  node_official_demo["MiniCPM official demo"]
end

node_user(("User"))

node_user -->|"uses"| node_browser
node_browser -->|"captures audio"| node_capture
node_capture -->|"posts PCM"| node_browser
node_browser -->|"streams inputs"| node_app
node_app -->|"serves UI"| node_browser
node_app -->|"dispatches events"| node_session
node_session -->|"requests inference"| node_backend
node_backend -->|"transcribes audio"| node_asr
node_backend -->|"streams response"| node_vlm
node_backend -->|"streams speech"| node_tts
node_session -->|"emits events"| node_browser
node_user -->|"uses native live"| node_official_demo
node_native_config -.->|"configures profile"| node_native_adapter
node_native_adapter -.->|"connects backend"| node_official_demo

click node_browser "https://github.com/rbitts/live/blob/main/web/index.html"
click node_capture "https://github.com/rbitts/live/blob/main/web/worklet.js"
click node_app "https://github.com/rbitts/live/blob/main/src/live/app.py"
click node_session "https://github.com/rbitts/live/blob/main/src/live/session.py"
click node_backend "https://github.com/rbitts/live/blob/main/src/live/backend.py"
click node_asr "https://github.com/rbitts/live/blob/main/scripts/model_worker.py"
click node_vlm "https://github.com/rbitts/live/blob/main/scripts/model_worker.py"
click node_tts "https://github.com/rbitts/live/blob/main/scripts/model_worker.py"
click node_native_config "https://github.com/rbitts/live/blob/main/configs/native.json"
click node_native_adapter "https://github.com/rbitts/live/blob/main/scripts/native_backend.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_browser,node_capture,node_user toneBlue
class node_app,node_session,node_backend toneAmber
class node_asr,node_vlm,node_tts toneMint
class node_native_config,node_native_adapter,node_official_demo toneRose
```

## Components

### Browser client

- [Live browser UI](https://github.com/rbitts/live/blob/main/web/index.html): `web/index.html`
- [Audio capture](https://github.com/rbitts/live/blob/main/web/worklet.js): `web/worklet.js`

### Gateway and session

- [WebSocket gateway](https://github.com/rbitts/live/blob/main/src/live/app.py): `src/live/app.py`
- [Live session](https://github.com/rbitts/live/blob/main/src/live/session.py): `src/live/session.py`
- [Qwen coordinator](https://github.com/rbitts/live/blob/main/src/live/backend.py): `src/live/backend.py`

### Qwen inference

- [Speech recognition](https://github.com/rbitts/live/blob/main/scripts/model_worker.py): `scripts/model_worker.py`
- [Visual response](https://github.com/rbitts/live/blob/main/scripts/model_worker.py): `scripts/model_worker.py`
- [Speech synthesis](https://github.com/rbitts/live/blob/main/scripts/model_worker.py): `scripts/model_worker.py`

### Native path

- [Native profile](https://github.com/rbitts/live/blob/main/configs/native.json): `configs/native.json`
- [Native adapter](https://github.com/rbitts/live/blob/main/scripts/native_backend.py): `scripts/native_backend.py`
- **MiniCPM official demo**

### Other components

- **User**

## Connections

- User → Live browser UI: uses (evidence: `README.md`)
- Live browser UI → Audio capture: captures audio (evidence: `web/worklet.js`)
- Audio capture → Live browser UI: posts PCM (evidence: `web/worklet.js`)
- Live browser UI → WebSocket gateway: streams inputs (evidence: `README.md`)
- WebSocket gateway → Live browser UI: serves UI (evidence: `src/live/app.py`)
- WebSocket gateway → Live session: dispatches events (evidence: `src/live/app.py`)
- Live session → Qwen coordinator: requests inference (evidence: `src/live/session.py`)
- Qwen coordinator → Speech recognition: transcribes audio (evidence: `src/live/backend.py`)
- Qwen coordinator → Visual response: streams response (evidence: `src/live/backend.py`)
- Qwen coordinator → Speech synthesis: streams speech (evidence: `src/live/backend.py`)
- Live session → Live browser UI: emits events
- User → MiniCPM official demo: uses native live (evidence: `README.md`)
- Native profile → Native adapter: configures profile
- Native adapter → MiniCPM official demo: connects backend
