mirror of
https://github.com/Alkatrazz24/Funk-lab.git
synced 2026-07-09 06:14:41 +02:00
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
27 lines
954 B
Python
27 lines
954 B
Python
"""Configuration du STT-server — via variables d'environnement (12-factor / k8s)."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import os
|
|
|
|
|
|
class Settings:
|
|
# LiteLLM (s01) — joint via un Service ExternalName/Endpoints dans le cluster.
|
|
litellm_url: str = os.getenv(
|
|
"STT_LITELLM_URL", "http://litellm-ext:4000/v1/chat/completions"
|
|
)
|
|
litellm_key: str = os.getenv("STT_LITELLM_KEY", "lm-studio")
|
|
model: str = os.getenv("STT_MODEL", "hermes-default")
|
|
|
|
system_prompt: str = os.getenv(
|
|
"STT_SYSTEM_PROMPT",
|
|
"Tu es Hermes, l'assistant vocal du homelab Funk. "
|
|
"Réponds toujours en français, de façon concise (2-3 phrases maximum), "
|
|
"sans markdown ni listes.",
|
|
)
|
|
max_tokens: int = int(os.getenv("STT_MAX_TOKENS", "200"))
|
|
temperature: float = float(os.getenv("STT_TEMPERATURE", "0.7"))
|
|
request_timeout: float = float(os.getenv("STT_REQUEST_TIMEOUT", "60"))
|
|
|
|
|
|
settings = Settings()
|