refactor(stt): pivot client-serveur — STT-server in-cluster + client pipx

Sépare STT en deux :
- stt/client/ : commande `stt` (pipx), voix locale (Whisper/Piper) + HUD ; envoie
  le texte au serveur via api.py (ServerClient → POST /v1/ask). URL serveur paramétrable,
  pas de cerveau local (suppression du routeur 3 modes).
- stt/server/ : STT-server FastAPI (conteneur), /healthz + /v1/ask → LiteLLM (Qwen3/Claude).

Déploiement cluster :
- k8s/apps/stt/ : Deployment, Service, IngressRoute (stt.lab.local), litellm-ext
  (Service + Endpoints → 192.168.10.1:4000 pour joindre LiteLLM hors cluster)
- k8s/apps-of-apps/apps/stt.yaml : Application ArgoCD (depuis main)
- .github/workflows/build-stt-server.yml : build/push image → ghcr.io/alkatrazz24/funk-stt-server

Inférence/chat seulement (outils Hermes 'agir sur Funk' = phase ultérieure, API :8080 à spécifier).
Vérifié : py_compile client+serveur, YAML manifests, ServerClient.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013FmcxGsyXZXogiAHQLjnZT
This commit is contained in:
Claude 2026-06-17 09:37:34 +00:00
parent 1ff3fd9bed
commit 6947b394f1
No known key found for this signature in database
38 changed files with 566 additions and 356 deletions

View file

@ -0,0 +1,25 @@
# stt/config — personnalisation
Tout ce qui se change **sans recompiler**. `stt --setup` copie `stt.example.toml` vers
`~/.config/stt/stt.toml`.
```
config/
├── stt.example.toml # config de référence (modes cerveau, voix, thème, mémoire)
├── themes/ # thèmes HUD : couleurs, fond, style du visualiseur (CSS/JSON)
├── avatars/ # images / avatars affichés dans le HUD
└── voices/ # modèles Piper .onnx (TTS) — fr_FR par défaut
```
## Points de personnalisation
| Quoi | Où | Note |
|---|---|---|
| Image / avatar | `avatars/` + `ui.avatar` | swappable à chaud |
| Thème / design | `themes/` + `ui.theme` | couleurs, fond, visualiseur |
| Voix | `voices/*.onnx` + `voice.piper_voice` | géré par `stt --setup` |
| Wake word | `voice.wake_word` | défaut « Ok Hermès » |
| Cerveau | `[brain]` | mode + override + endpoints |
> 🔒 La clé Anthropic (mode `claude-direct`) passe par la variable d'env `ANTHROPIC_API_KEY`,
> **jamais** dans ce fichier (qui peut finir versionné).

View file

@ -0,0 +1,28 @@
# Configuration du CLIENT STT — copier vers ~/.config/stt/stt.toml (`stt --setup` le génère).
# Reflète les défauts embarqués (stt/client/stt/config.py : DEFAULT_CONFIG).
# Le client n'a plus de cerveau : il envoie le texte au STT-server (in-cluster).
[server]
url = "http://stt.lab.local" # endpoint du STT-server (paramétrable)
timeout_sec = 90
[voice]
wake_word = "hermes" # "Ok Hermès"
whisper_model = "large-v3" # STT faster-whisper (CPU int8) — "small" pour tester
piper_voice = "fr_FR-upmc-medium" # TTS — ~/.local/share/piper/<voix>.onnx
language = "fr"
silence_sec = 1.2
min_speech_sec = 0.6
chat_timeout_sec = 60
[ui]
theme = "arc-reactor"
avatar = "default"
kiosk = true
ws_host = "127.0.0.1"
ws_port = 9300 # websocket états → HUD (doit matcher hud/index.html)
http_port = 9301 # HTTP statique qui sert le HUD
[memory]
enabled = true # cache local de conversation (brut, gitignoré)
local_db = "~/.local/share/stt/memory.sqlite"