# nbs282/livetranslate architecture

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

- Interactive diagram: https://gitdiagram.com/nbs282/livetranslate
- Repository: https://github.com/nbs282/livetranslate

## Overview

LiveTranslate is a local-first desktop interpreter: the user configures audio and languages, speaks into a microphone, and receives streaming subtitles plus translated speech routed to speakers or a virtual cable. The README documents native Parakeet transcription, language-pair translation, sentence-by-sentence TTS, voice cloning, setup, and updates. Sampled Rust and Python sources confirm the engine/server boundary and several setup and audio responsibilities; links involving unsampled frontend and translation modules follow the documented architecture and are kept at subsystem level.

Main entry points: [`src-tauri/src/lib.rs`](https://github.com/nbs282/livetranslate/blob/main/src-tauri/src/lib.rs) (Command/event host), [`src-tauri/src/translation/live.rs`](https://github.com/nbs282/livetranslate/blob/main/src-tauri/src/translation/live.rs) (Live session), [`python/lt_engine/server.py`](https://github.com/nbs282/livetranslate/blob/main/python/lt_engine/server.py) (Local API server), [`src/main.ts`](https://github.com/nbs282/livetranslate/blob/main/src/main.ts) (Main window)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop UI"]
  node_main_ui["Main window<br/>[main.ts]"]
  node_overlay["Subtitle overlay<br/>[overlay.ts]"]
  node_voice_ui["Voice controls<br/>[voice.ts]"]
  node_live_ui["Live controls<br/>[live.ts]"]
  node_translate_ui["Translation settings<br/>[translate.ts]"]
  node_updates["In-app updates<br/>[update.ts]"]
end

subgraph group_runtime["Audio and translation"]
  node_tauri["Command/event host<br/>[lib.rs]"]
  node_audio["Audio capture<br/>[mod.rs]"]
  node_passthrough["Audio passthrough<br/>[passthrough.rs]"]
  node_live["Live session<br/>[live.rs]"]
  node_segmenter["Sentence segmenter<br/>[segmenter.rs]"]
  node_native["Native STT engines"]
  node_sidecar["Python sidecar client<br/>[sidecar.rs]"]
  node_engine_server["Engine process manager<br/>[engine_server.rs]"]
end

subgraph group_engine["Local AI engine"]
  node_pyserver["Local API server<br/>[server.py]"]
  node_pipeline["Cascade pipeline<br/>[pipeline.py]"]
  node_cloned["Voice synthesis<br/>[cloned_tts.py]"]
  node_profile[("Voice profile<br/>[voice_profile.py]")]
end

subgraph group_setup["Setup and models"]
  node_setup["Setup workflow<br/>[setup.rs]"]
  node_catalog["Model catalog<br/>[catalog.rs]"]
  node_manager["GGUF model manager<br/>[manager.rs]"]
  node_download["Download service<br/>[download.rs]"]
  node_model_store[("Local model files")]
end

node_user(("Speaker"))
node_mic(("Microphone"))
node_call(("Video call"))
node_cable(("Virtual cable"))
node_hf(("HuggingFace Hub"))

node_user -->|"speaks into"| node_mic
node_mic -->|"audio input"| node_audio
node_main_ui -->|"invokes commands"| node_tauri
node_main_ui -->|"configures session"| node_live_ui
node_live_ui -->|"starts capture"| node_tauri
node_translate_ui -->|"sets languages"| node_tauri
node_voice_ui -->|"manages profile"| node_pyserver
node_tauri -->|"starts capture"| node_audio
node_tauri -->|"starts session"| node_live
node_audio -->|"captured audio"| node_live
node_live -->|"transcribes audio"| node_native
node_live -->|"segments speech"| node_segmenter
node_live -->|"requests translation"| node_sidecar
node_sidecar -->|"HTTP requests"| node_pyserver
node_tauri -->|"ensures engine"| node_engine_server
node_engine_server -->|"spawns process"| node_pyserver
node_native -.->|"fallback STT"| node_sidecar
node_pyserver -->|"dispatches work"| node_pipeline
node_pipeline -.->|"cloned synthesis"| node_cloned
node_pyserver -->|"saves or deletes"| node_profile
node_live -->|"partial and final events"| node_overlay
node_tauri -->|"PTT events"| node_overlay
node_overlay -->|"shows subtitles"| node_user
node_pipeline -->|"translation and audio result"| node_live
node_live -.->|"routes original audio"| node_passthrough
node_tauri -->|"starts passthrough"| node_passthrough
node_passthrough -->|"plays audio"| node_cable
node_cable -->|"call microphone input"| node_call
node_user -->|"runs first setup"| node_setup
node_setup -->|"selects assets"| node_catalog
node_setup -->|"prepares GGUF models"| node_manager
node_manager -->|"downloads model"| node_download
node_manager -->|"verifies and loads"| node_model_store
node_download -->|"fetches assets"| node_hf
node_download -->|"writes files"| node_model_store
node_main_ui -->|"checks update state"| node_updates

click node_main_ui "https://github.com/nbs282/livetranslate/blob/main/src/main.ts"
click node_overlay "https://github.com/nbs282/livetranslate/blob/main/src/overlay.ts"
click node_voice_ui "https://github.com/nbs282/livetranslate/blob/main/src/voice.ts"
click node_live_ui "https://github.com/nbs282/livetranslate/blob/main/src/live.ts"
click node_translate_ui "https://github.com/nbs282/livetranslate/blob/main/src/translate.ts"
click node_updates "https://github.com/nbs282/livetranslate/blob/main/src/update.ts"
click node_tauri "https://github.com/nbs282/livetranslate/blob/main/src-tauri/src/lib.rs"
click node_audio "https://github.com/nbs282/livetranslate/blob/main/src-tauri/src/audio/mod.rs"
click node_passthrough "https://github.com/nbs282/livetranslate/blob/main/src-tauri/src/audio/passthrough.rs"
click node_live "https://github.com/nbs282/livetranslate/blob/main/src-tauri/src/translation/live.rs"
click node_segmenter "https://github.com/nbs282/livetranslate/blob/main/src-tauri/src/translation/segmenter.rs"
click node_native "https://github.com/nbs282/livetranslate/tree/main/src-tauri/src/translation/engine"
click node_sidecar "https://github.com/nbs282/livetranslate/blob/main/src-tauri/src/translation/sidecar.rs"
click node_engine_server "https://github.com/nbs282/livetranslate/blob/main/src-tauri/src/translation/engine_server.rs"
click node_pyserver "https://github.com/nbs282/livetranslate/blob/main/python/lt_engine/server.py"
click node_pipeline "https://github.com/nbs282/livetranslate/blob/main/python/lt_engine/pipeline.py"
click node_cloned "https://github.com/nbs282/livetranslate/blob/main/python/lt_engine/cloned_tts.py"
click node_profile "https://github.com/nbs282/livetranslate/blob/main/python/lt_engine/voice_profile.py"
click node_setup "https://github.com/nbs282/livetranslate/blob/main/src-tauri/src/setup.rs"
click node_catalog "https://github.com/nbs282/livetranslate/blob/main/src-tauri/src/models/catalog.rs"
click node_manager "https://github.com/nbs282/livetranslate/blob/main/src-tauri/src/models/manager.rs"
click node_download "https://github.com/nbs282/livetranslate/blob/main/src-tauri/src/net/download.rs"

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_main_ui,node_overlay,node_voice_ui,node_live_ui,node_translate_ui,node_updates toneBlue
class node_tauri,node_audio,node_passthrough,node_live,node_segmenter,node_native,node_sidecar,node_engine_server toneAmber
class node_pyserver,node_pipeline,node_cloned,node_profile toneMint
class node_setup,node_catalog,node_manager,node_download,node_model_store toneRose
class node_user,node_mic,node_call,node_cable,node_hf toneIndigo
```

## Components

### Desktop UI

- [Main window](https://github.com/nbs282/livetranslate/blob/main/src/main.ts): `src/main.ts`
- [Subtitle overlay](https://github.com/nbs282/livetranslate/blob/main/src/overlay.ts): `src/overlay.ts`
- [Voice controls](https://github.com/nbs282/livetranslate/blob/main/src/voice.ts): `src/voice.ts`
- [Live controls](https://github.com/nbs282/livetranslate/blob/main/src/live.ts): `src/live.ts`
- [Translation settings](https://github.com/nbs282/livetranslate/blob/main/src/translate.ts): `src/translate.ts`
- [In-app updates](https://github.com/nbs282/livetranslate/blob/main/src/update.ts): `src/update.ts`

### Audio and translation

- [Command/event host](https://github.com/nbs282/livetranslate/blob/main/src-tauri/src/lib.rs): `src-tauri/src/lib.rs`
- [Audio capture](https://github.com/nbs282/livetranslate/blob/main/src-tauri/src/audio/mod.rs): `src-tauri/src/audio/mod.rs`
- [Audio passthrough](https://github.com/nbs282/livetranslate/blob/main/src-tauri/src/audio/passthrough.rs): `src-tauri/src/audio/passthrough.rs`
- [Live session](https://github.com/nbs282/livetranslate/blob/main/src-tauri/src/translation/live.rs): `src-tauri/src/translation/live.rs`
- [Sentence segmenter](https://github.com/nbs282/livetranslate/blob/main/src-tauri/src/translation/segmenter.rs): `src-tauri/src/translation/segmenter.rs`
- [Native STT engines](https://github.com/nbs282/livetranslate/tree/main/src-tauri/src/translation/engine): `src-tauri/src/translation/engine`
- [Python sidecar client](https://github.com/nbs282/livetranslate/blob/main/src-tauri/src/translation/sidecar.rs): `src-tauri/src/translation/sidecar.rs`
- [Engine process manager](https://github.com/nbs282/livetranslate/blob/main/src-tauri/src/translation/engine_server.rs): `src-tauri/src/translation/engine_server.rs`

### Local AI engine

- [Local API server](https://github.com/nbs282/livetranslate/blob/main/python/lt_engine/server.py): `python/lt_engine/server.py`
- [Cascade pipeline](https://github.com/nbs282/livetranslate/blob/main/python/lt_engine/pipeline.py): `python/lt_engine/pipeline.py`
- [Voice synthesis](https://github.com/nbs282/livetranslate/blob/main/python/lt_engine/cloned_tts.py): `python/lt_engine/cloned_tts.py`
- [Voice profile](https://github.com/nbs282/livetranslate/blob/main/python/lt_engine/voice_profile.py): `python/lt_engine/voice_profile.py`

### Setup and models

- [Setup workflow](https://github.com/nbs282/livetranslate/blob/main/src-tauri/src/setup.rs): `src-tauri/src/setup.rs`
- [Model catalog](https://github.com/nbs282/livetranslate/blob/main/src-tauri/src/models/catalog.rs): `src-tauri/src/models/catalog.rs`
- [GGUF model manager](https://github.com/nbs282/livetranslate/blob/main/src-tauri/src/models/manager.rs): `src-tauri/src/models/manager.rs`
- [Download service](https://github.com/nbs282/livetranslate/blob/main/src-tauri/src/net/download.rs): `src-tauri/src/net/download.rs`
- **Local model files**

### Other components

- **Speaker**
- **Microphone**
- **Video call**
- **Virtual cable**
- **HuggingFace Hub**

## Connections

- Speaker → Microphone: speaks into
- Microphone → Audio capture: audio input
- Main window → Command/event host: invokes commands
- Main window → Live controls: configures session
- Live controls → Command/event host: starts capture
- Translation settings → Command/event host: sets languages
- Voice controls → Local API server: manages profile
- Command/event host → Audio capture: starts capture
- Command/event host → Live session: starts session
- Audio capture → Live session: captured audio
- Live session → Native STT engines: transcribes audio
- Live session → Sentence segmenter: segments speech
- Live session → Python sidecar client: requests translation
- Python sidecar client → Local API server: HTTP requests
- Command/event host → Engine process manager: ensures engine
- Engine process manager → Local API server: spawns process
- Native STT engines → Python sidecar client: fallback STT
- Local API server → Cascade pipeline: dispatches work
- Cascade pipeline → Voice synthesis: cloned synthesis
- Local API server → Voice profile: saves or deletes
- Live session → Subtitle overlay: partial and final events
- Command/event host → Subtitle overlay: PTT events
- Subtitle overlay → Speaker: shows subtitles
- Cascade pipeline → Live session: translation and audio result
- Live session → Audio passthrough: routes original audio
- Command/event host → Audio passthrough: starts passthrough
- Audio passthrough → Virtual cable: plays audio
- Virtual cable → Video call: call microphone input
- Speaker → Setup workflow: runs first setup
- Setup workflow → Model catalog: selects assets
- Setup workflow → GGUF model manager: prepares GGUF models
- GGUF model manager → Download service: downloads model
- GGUF model manager → Local model files: verifies and loads
- Download service → HuggingFace Hub: fetches assets
- Download service → Local model files: writes files
- Main window → In-app updates: checks update state
