LXC-Frontend (FastAPI + HTML/JS): - Audio-Upload (MP3/WAV/M4A/MP4/OGG/FLAC, max. 500 MB) - SQLite Job-Store, BackgroundTask-Pipeline - Job-Liste mit Live-Status, Downloads (DOCX + JSON) - Mac-Health-Indicator im UI Mac-Worker (FastAPI): - /api/transcribe (lightning-whisper-mlx | faster-whisper | mock) - /api/summarize + /api/protocol via Ollama (llama3.1:8b) - /api/export/docx via python-docx Deploy: - systemd-Service, Nginx Reverse-Proxy - deploy/install.sh: idempotentes LXC-Setup Doku: README.md, lxc-frontend/README.md, mac-worker/README.md
68 lines
1.6 KiB
Markdown
68 lines
1.6 KiB
Markdown
# Voice-Agent Mac-Worker
|
|
|
|
Stateless FastAPI-Service auf dem Mac. Macht die schwere Arbeit: Whisper-Transkription und Ollama-Zusammenfassung. Wird vom LXC-Frontend per HTTP angesprochen.
|
|
|
|
## Setup (Apple Silicon)
|
|
|
|
```bash
|
|
cd mac-worker
|
|
python3.11 -m venv .venv
|
|
source .venv/bin/activate
|
|
pip install --upgrade pip
|
|
pip install -r requirements.txt
|
|
cp .env.example .env
|
|
# Bei Bedarf .env anpassen
|
|
```
|
|
|
|
## Ollama vorbereiten
|
|
|
|
```bash
|
|
# Ollama installieren, falls noch nicht geschehen
|
|
brew install ollama
|
|
|
|
# Modell ziehen
|
|
ollama pull llama3.1:8b
|
|
|
|
# Ollama netzwerkweit erreichbar machen (LaunchAgent)
|
|
launchctl setenv OLLAMA_HOST "0.0.0.0:11434"
|
|
brew services restart ollama
|
|
```
|
|
|
|
## Whisper-Engine wählen
|
|
|
|
| `WHISPER_ENGINE` | Wann nutzen |
|
|
|---|---|
|
|
| `mlx` | Apple Silicon — schnellste Option |
|
|
| `faster` | Intel-Mac / Linux / CUDA |
|
|
| `mock` | Testbetrieb ohne echtes Modell |
|
|
|
|
## Worker starten
|
|
|
|
```bash
|
|
uvicorn app.main:app --host 0.0.0.0 --port 8080
|
|
```
|
|
|
|
Health-Check vom LXC:
|
|
```bash
|
|
curl http://<MAC-IP>:8080/health
|
|
```
|
|
|
|
## API-Endpunkte
|
|
|
|
| Methode | Pfad | Zweck |
|
|
|---|---|---|
|
|
| GET | `/health` | Status + Ollama-Reachability |
|
|
| POST | `/api/transcribe` | multipart: `audio`, `language` → Transkript-JSON |
|
|
| POST | `/api/summarize` | JSON: `transcript`, `title` → Summary-JSON |
|
|
| POST | `/api/protocol` | JSON: `transcript`, `summary`, `title` → Protokoll-JSON |
|
|
| POST | `/api/export/docx` | JSON: Protokoll → DOCX-Binary |
|
|
|
|
## Firewall am Mac
|
|
|
|
```bash
|
|
# Eingehende Verbindungen auf Port 8080 erlauben (System-Settings > Network > Firewall)
|
|
# oder via pf — siehe Apple-Doku.
|
|
```
|
|
|
|
Der Worker hat **keine Authentifizierung** — Betrieb nur im internen Netz.
|