feat(stt): mode texte + sélection de modèle (client→serveur par requête) (#7)

Serveur : /v1/ask accepte un model optionnel (validé contre STT_ALLOWED_MODELS),
nouvel endpoint GET /v1/models (défaut + alias autorisés). Pas de switch global.

Client : 'stt --text' (chat texte simple sans micro/HUD), '--model hermes|claude|qwen|opus'
(noms courts → alias LiteLLM), commandes /model et /models en mode texte. Le modèle
choisi est envoyé au serveur à chaque requête (voix comme texte).


Claude-Session: https://claude.ai/code/session_013FmcxGsyXZXogiAHQLjnZT

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
ALI YESILKAYA 2026-06-17 13:36:06 +02:00 committed by GitHub
parent 47936b0088
commit bcdb4f8b2a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 146 additions and 25 deletions

View file

@ -16,11 +16,26 @@ CONFIG_DIR = Path.home() / ".config" / "stt"
CONFIG_PATH = CONFIG_DIR / "stt.toml"
DATA_DIR = Path.home() / ".local" / "share" / "stt"
# Noms courts → alias LiteLLM (pour --model et la commande /model)
MODEL_PRESETS = {
"hermes": "hermes-default", # Qwen3-8B local (défaut, gratuit)
"qwen": "qwen3-8b",
"claude": "claude-sonnet-4-6", # Claude (facturé)
"opus": "claude-opus-4-7",
}
def resolve_model(name: str) -> str:
"""Nom court → alias LiteLLM (ou renvoie tel quel si déjà un alias)."""
return MODEL_PRESETS.get(name, name)
DEFAULT_CONFIG: dict[str, Any] = {
"server": {
# STT-server (in-cluster) — joignable via Traefik / wildcard *.lab.local
"url": "http://stt.lab.local",
"timeout_sec": 90,
# Modèle demandé au serveur (alias LiteLLM, ou nom court ci-dessous)
"model": "hermes-default",
},
"voice": {
"wake_word": "hermes",