feat(stt): echtes lokales STT via faster-whisper (optional .[local])
- FasterWhisperProvider implementiert (CTranslate2): Modell prozessweit gecacht (lru_cache), Transkription in asyncio.to_thread; robuster CPU-Fallback wenn GPU/compute_type nicht verfuegbar - Config: FASTER_WHISPER_MODEL/DEVICE/COMPUTE_TYPE (Defaults base/auto/default) - pyproject: optionales Extra [local] = faster-whisper - Test: transcribe-Endpunkt nutzt jetzt einen Stub-STT (kein Platzhalter mehr) - Doku: Voraussetzungen, Hybrid-Beispiel (STT+LLM lokal, TTS remote), Architektur/README Live verifiziert: TTS->WAV->faster-whisper transkribiert korrekt (de); voller Hybrid ueber /ws/voice (faster-whisper + Ollama llama3.2 + OpenRouter-TTS) funktioniert. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
e1167951e1
commit
c25f081f9f
8 changed files with 92 additions and 8 deletions
|
|
@ -27,6 +27,9 @@ Kurzüberblick: [README](README.md).
|
|||
(`ffplay`/`aplay`/`paplay`) — auf den meisten Linux-Desktops vorhanden
|
||||
- **OpenRouter-API-Key** — nötig für Profile mit Cloud-KI (`hybrid`, `cloud`);
|
||||
für rein lokalen Betrieb (`local-dev`) nicht
|
||||
- Für **lokales STT** (Provider `faster-whisper`): einmalig `pip install -e .[local]`
|
||||
(lädt beim ersten Lauf ein Whisper-Modell). Für **lokales LLM**: ein laufender
|
||||
Ollama-Server (`http://127.0.0.1:11434`) mit einem Modell (`ollama pull llama3.2`)
|
||||
- Optional: Docker
|
||||
|
||||
## 2. Installation
|
||||
|
|
@ -213,6 +216,22 @@ curl -s -X POST $URL/api/sessions/oma-anna/route \
|
|||
|
||||
Profil global umschalten (Entwickler/Admin): `VA_PROFILE=local-dev make run`.
|
||||
|
||||
**Hybrid-Beispiel** (Aufnahme + STT + LLM **lokal**, nur TTS **remote**):
|
||||
```bash
|
||||
# einmalig: lokales STT installieren
|
||||
pip install -e .[local]
|
||||
# Server mit kleinem lokalem Ollama-Modell (muss in 'ollama list' stehen):
|
||||
echo 'LOCAL_LLM_MODEL=llama3.2:latest' >> .env
|
||||
make run
|
||||
# in Terminal 2 — Sprech-Loop mit der Hybrid-Kombi (MOTU = plughw:5,0):
|
||||
python scripts/voice_loop.py --recorder arecord --device plughw:5,0 --session hybrid \
|
||||
--stt-provider faster-whisper \
|
||||
--llm-provider local-openai-compatible \
|
||||
--tts-provider openrouter
|
||||
```
|
||||
Erster Turn ist langsamer (Whisper- und Ollama-Modell laden), danach zügig. STT-Modell
|
||||
und Gerät steuern `FASTER_WHISPER_MODEL`/`FASTER_WHISPER_DEVICE` in `.env`.
|
||||
|
||||
## B2. Soundquelle & Ausgabe-Gerät wechseln (Mikrofon, Lautsprecher, Bluetooth, Handy)
|
||||
|
||||
> **Wichtig — aktueller Stand:** Die Geräte-Endpunkte **im Gateway**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue