diff --git a/AGENTS.md b/AGENTS.md index 927038a..f048734 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -4,17 +4,21 @@ A single-container voice assistant built on LiveKit Agents. Speaks and listens i ## Architecture -One Docker container runs three processes via supervisord: +One Docker container runs four processes via supervisord: 1. **LiveKit server** — open-source WebRTC media transport (port 7880 TCP, 7882 UDP muxed media) 2. **Voice agent** — Python LiveKit Agents pipeline: Azure STT → LLM (OpenWebUI) → Azure TTS 3. **Web frontend** — static HTML served by nginx (port 9178 by default) +4. **Media server** — FastAPI music library/player coordinator (port 8092 internal, proxied at /media/api/) ``` Browser ──WebRTC──► LiveKit Server ──audio──► Agent ▲ │ └────────── audio ◄────────────────────────────┘ Azure STT → LLM (OpenWebUI) → Azure TTS + +Browser ──HTTP──► nginx /media/api/ ──► Media server ──► yt-dlp/ffmpeg ──► ./media + └────── audio element ◄── /media/files/ (nginx static, Range) ──────────┘ ``` ## Quick Start @@ -40,6 +44,7 @@ LAN access requires firewall rules: `9178/tcp` (UI + signaling), `7882/udp` | 7880 | TCP | LiveKit HTTP/WS | internal only (proxied via nginx at /livekit/) | | 7881 | TCP | LiveKit RTC media (TCP fallback) | LAN | | 7882 | UDP | LiveKit RTC media (muxed) | LAN | +| 8092 | TCP | Media server (library, player state, stream proxy) | internal only (proxied via nginx at /media/api/) | | 9178 | TCP | Web frontend (HTTPS) | LAN | ## Configuration @@ -53,6 +58,33 @@ Key variables: - `LLM_BASE_URL` — OpenAI-compatible endpoint (default `http://192.168.86.2:3005/api`, OpenWebUI) - `LLM_MODEL` — default model (default `qwen2.5-vl-3b`; switchable live from the web UI) - `LLM_API_KEY` — OpenWebUI API key (bears `sk-…`) +- `YTDLP_COOKIES` — optional path to a cookies.txt inside the container (e.g. `/data/media/cookies.txt`) for reliable YouTube downloads + +## Media Player + +Hope can play music on the web UI's media player: YouTube Music search → +yt-dlp download → ffmpeg transcode to mp3 → nginx static streaming (HTTP +Range) back to the browser's `