# smacy2017/interpilot architecture

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

- Interactive diagram: https://gitdiagram.com/smacy2017/interpilot
- Repository: https://github.com/smacy2017/interpilot

## Overview

InterPilot captures system audio, saves it as WAV, transcribes it locally, then streams an LLM response into a GUI; it also offers a simpler command-line workflow. The GUI coordinates recording, transcription, and prompting, while the recorder, transcriber, and LLM client implement those stages. The README documents Markdown-rendered replies and configurable API/model/device settings. Voice generation exists as a separate, not-yet-integrated capability. Relationships are based on the shown source and README; no unsampled implementation details are assumed.

Main entry points: [`main.py`](https://github.com/smacy2017/interpilot/blob/main/main.py) (GUI workflow), [`main_cmd.py`](https://github.com/smacy2017/interpilot/blob/main/main_cmd.py) (CLI workflow), [`src/audio_capture.py`](https://github.com/smacy2017/interpilot/blob/main/src/audio_capture.py) (Loopback recorder), [`src/transcriber.py`](https://github.com/smacy2017/interpilot/blob/main/src/transcriber.py) (Speech transcriber)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["User workflows"]
  node_gui["GUI workflow<br/>[main.py]"]
  node_cli["CLI workflow<br/>[main_cmd.py]"]
  node_settings["Runtime settings<br/>[config.ini]"]
end

subgraph group_audio["Audio and transcription"]
  node_recorder["Loopback recorder<br/>[audio_capture.py]"]
  node_wav["WAV recordings"]
  node_transcriber["Speech transcriber<br/>[transcriber.py]"]
  node_whisper["Whisper model"]
end

subgraph group_answers["LLM answers"]
  node_llm["LLM client<br/>[llm_client.py]"]
end

subgraph group_optional["Standalone voice"]
  node_voice["Voice generator<br/>[voice_generator.py]"]
end

node_user(("User"))
node_audio_devices["Audio devices"]
node_llm_api["OpenAI-compatible API"]
node_tts["Edge TTS"]
node_ffmpeg["FFmpeg"]

node_user -->|"operates"| node_gui
node_user -->|"operates"| node_cli
node_gui -->|"reads"| node_settings
node_gui -->|"starts recording"| node_recorder
node_recorder -->|"captures audio"| node_audio_devices
node_recorder -->|"writes"| node_wav
node_gui -->|"requests transcription"| node_transcriber
node_transcriber -->|"reads"| node_wav
node_transcriber -->|"transcribes with"| node_whisper
node_gui -->|"sends prompt"| node_llm
node_llm -->|"streams request"| node_llm_api
node_llm -->|"reads API settings"| node_settings
node_cli -->|"starts recording"| node_recorder
node_cli -->|"requests transcription"| node_transcriber
node_cli -->|"sends transcript"| node_llm
node_voice -->|"requests speech"| node_tts
node_voice -->|"converts audio"| node_ffmpeg
node_voice -->|"plays audio"| node_audio_devices

click node_gui "https://github.com/smacy2017/interpilot/blob/main/main.py"
click node_cli "https://github.com/smacy2017/interpilot/blob/main/main_cmd.py"
click node_settings "https://github.com/smacy2017/interpilot/blob/main/config.ini"
click node_recorder "https://github.com/smacy2017/interpilot/blob/main/src/audio_capture.py"
click node_wav "https://github.com/smacy2017/interpilot/tree/main/output"
click node_transcriber "https://github.com/smacy2017/interpilot/blob/main/src/transcriber.py"
click node_llm "https://github.com/smacy2017/interpilot/blob/main/src/llm_client.py"
click node_voice "https://github.com/smacy2017/interpilot/blob/main/src/voice_generator.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_gui,node_cli,node_settings,node_user toneBlue
class node_recorder,node_wav,node_transcriber,node_whisper toneAmber
class node_llm,node_llm_api toneMint
class node_voice toneRose
class node_audio_devices,node_tts,node_ffmpeg toneIndigo
```

## Components

### User workflows

- [GUI workflow](https://github.com/smacy2017/interpilot/blob/main/main.py): `main.py`
- [CLI workflow](https://github.com/smacy2017/interpilot/blob/main/main_cmd.py): `main_cmd.py`
- [Runtime settings](https://github.com/smacy2017/interpilot/blob/main/config.ini): `config.ini`

### Audio and transcription

- [Loopback recorder](https://github.com/smacy2017/interpilot/blob/main/src/audio_capture.py): `src/audio_capture.py`
- [WAV recordings](https://github.com/smacy2017/interpilot/tree/main/output): `output`
- [Speech transcriber](https://github.com/smacy2017/interpilot/blob/main/src/transcriber.py): `src/transcriber.py`
- **Whisper model**

### LLM answers

- [LLM client](https://github.com/smacy2017/interpilot/blob/main/src/llm_client.py): `src/llm_client.py`

### Standalone voice

- [Voice generator](https://github.com/smacy2017/interpilot/blob/main/src/voice_generator.py): `src/voice_generator.py`

### Other components

- **User**
- **Audio devices**
- **OpenAI-compatible API**
- **Edge TTS**
- **FFmpeg**

## Connections

- User → GUI workflow: operates (evidence: `README.md`)
- User → CLI workflow: operates (evidence: `README.md`)
- GUI workflow → Runtime settings: reads (evidence: `main.py`)
- GUI workflow → Loopback recorder: starts recording (evidence: `main.py`)
- Loopback recorder → Audio devices: captures audio (evidence: `src/audio_capture.py`)
- Loopback recorder → WAV recordings: writes (evidence: `src/audio_capture.py`)
- GUI workflow → Speech transcriber: requests transcription (evidence: `main.py`)
- Speech transcriber → WAV recordings: reads (evidence: `src/transcriber.py`)
- Speech transcriber → Whisper model: transcribes with (evidence: `src/transcriber.py`)
- GUI workflow → LLM client: sends prompt (evidence: `main.py`)
- LLM client → OpenAI-compatible API: streams request (evidence: `src/llm_client.py`)
- LLM client → Runtime settings: reads API settings (evidence: `src/llm_client.py`)
- CLI workflow → Loopback recorder: starts recording (evidence: `main_cmd.py`)
- CLI workflow → Speech transcriber: requests transcription (evidence: `main_cmd.py`)
- CLI workflow → LLM client: sends transcript (evidence: `main_cmd.py`)
- Voice generator → Edge TTS: requests speech (evidence: `src/voice_generator.py`)
- Voice generator → FFmpeg: converts audio (evidence: `src/voice_generator.py`)
- Voice generator → Audio devices: plays audio (evidence: `src/voice_generator.py`)
