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,24 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: stt
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: default
source:
repoURL: git@github.com:Alkatrazz24/Funk-lab.git
targetRevision: main
path: k8s/apps/stt
directory:
recurse: true
destination:
server: https://kubernetes.default.svc
namespace: ai
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true

View file

@ -0,0 +1,47 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: stt-server
namespace: ai
spec:
replicas: 1
selector:
matchLabels:
app: stt-server
template:
metadata:
labels:
app: stt-server
spec:
containers:
- name: stt-server
image: ghcr.io/alkatrazz24/funk-stt-server:latest
ports:
- containerPort: 8000
env:
# LiteLLM (s01) joint via le Service Endpoints litellm-ext
- name: STT_LITELLM_URL
value: "http://litellm-ext:4000/v1/chat/completions"
- name: STT_LITELLM_KEY
value: "lm-studio"
- name: STT_MODEL
value: "hermes-default"
readinessProbe:
httpGet:
path: /healthz
port: 8000
initialDelaySeconds: 5
periodSeconds: 10
livenessProbe:
httpGet:
path: /healthz
port: 8000
initialDelaySeconds: 10
periodSeconds: 20
resources:
requests:
cpu: 50m
memory: 128Mi
limits:
cpu: 500m
memory: 256Mi

14
k8s/apps/stt/ingress.yaml Normal file
View file

@ -0,0 +1,14 @@
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: stt-server
namespace: ai
spec:
entryPoints:
- web
routes:
- match: Host(`stt.lab.local`)
kind: Rule
services:
- name: stt-server
port: 8000

View file

@ -0,0 +1,22 @@
# LiteLLM tourne sur storage-01 (HORS cluster) — on l'expose comme un Service interne
# via un Service sans sélecteur + Endpoints manuel pointant vers l'IP LAN cluster de s01.
apiVersion: v1
kind: Service
metadata:
name: litellm-ext
namespace: ai
spec:
ports:
- port: 4000
targetPort: 4000
---
apiVersion: v1
kind: Endpoints
metadata:
name: litellm-ext
namespace: ai
subsets:
- addresses:
- ip: 192.168.10.1 # storage-01, IP LAN cluster (cf. CLAUDE.md)
ports:
- port: 4000

11
k8s/apps/stt/service.yaml Normal file
View file

@ -0,0 +1,11 @@
apiVersion: v1
kind: Service
metadata:
name: stt-server
namespace: ai
spec:
selector:
app: stt-server
ports:
- port: 8000
targetPort: 8000