From 47936b0088d36549c541df4e5900d2a887f8d5cc Mon Sep 17 00:00:00 2001 From: ALI YESILKAYA Date: Wed, 17 Jun 2026 13:19:51 +0200 Subject: [PATCH] fix(stt): joindre LiteLLM en IP directe (192.168.10.1:4000) (#6) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit L'indirection litellm-ext (Service sans sélecteur + Endpoints manuel) ne routait pas ('All connection attempts failed'). open-webui joint LiteLLM en IP directe — on copie ce pattern éprouvé et on supprime litellm-external.yaml. Claude-Session: https://claude.ai/code/session_013FmcxGsyXZXogiAHQLjnZT Co-authored-by: Claude --- admin/ia/stt.md | 10 +++++----- k8s/apps/stt/deployment.yaml | 4 ++-- k8s/apps/stt/litellm-external.yaml | 22 ---------------------- stt/README.md | 6 +++--- stt/server/README.md | 4 ++-- stt/server/stt_server/config.py | 4 ++-- 6 files changed, 14 insertions(+), 36 deletions(-) delete mode 100644 k8s/apps/stt/litellm-external.yaml diff --git a/admin/ia/stt.md b/admin/ia/stt.md index 77b05f0..69d4b03 100644 --- a/admin/ia/stt.md +++ b/admin/ia/stt.md @@ -58,7 +58,7 @@ Maillon réellement manquant : **l'interface graphique HUD** + le packaging + la │ • Piper (TTS) │ POST │ POST /v1/ask {text} → {reply} │ │ • HUD web (ui/ + hud/) │ /v1/ask│ brain → LiteLLM (httpx) │ │ • api.py → ServerClient │ ◀───── │ IngressRoute : stt.lab.local │ - └────────────────────────────────┘ reply │ Service Endpoints : litellm-ext │ + └────────────────────────────────┘ reply │ → LiteLLM s01 192.168.10.1:4000 │ └──────────────┬─────────────────────────┘ ▼ LiteLLM :4000 (storage-01, hors cluster) @@ -67,8 +67,8 @@ Maillon réellement manquant : **l'interface graphique HUD** + le packaging + la ### Le cerveau — côté serveur -Le STT-server appelle **LiteLLM `:4000`** (OpenAI-compatible), joint depuis le cluster via -un Service sans sélecteur + Endpoints manuel (`litellm-ext` → `192.168.10.1:4000`). LiteLLM +Le STT-server appelle **LiteLLM `:4000`** (OpenAI-compatible), joint depuis le cluster en +**IP directe** `192.168.10.1:4000` (même pattern qu'open-webui). LiteLLM route lui-même vers Qwen3 (g01) ou Claude selon l'alias `hermes-default` / `hermes-switch`. > **« Agir sur Funk »** (outils de l'agent Hermes via le gateway `:8080`) n'est **pas** dans le @@ -95,7 +95,7 @@ route lui-même vers Qwen3 (g01) ou Claude selon l'alias `hermes-default` / `her | — UI/HUD | `stt/client/stt/ui/` + `hud/` | HTTP statique + websocket d'états ; HUD embarqué dans le package | | STT-server | `stt/server/` (conteneur) | FastAPI : `/healthz`, `/v1/ask` ; `brain.py` → LiteLLM | | Image | `ghcr.io/alkatrazz24/funk-stt-server` | construite par `.github/workflows/build-stt-server.yml` | -| Manifests | `k8s/apps/stt/` | Deployment, Service, IngressRoute (`stt.lab.local`), `litellm-ext` | +| Manifests | `k8s/apps/stt/` | Deployment, Service, IngressRoute (`stt.lab.local`) | | Application ArgoCD | `k8s/apps-of-apps/apps/stt.yaml` | déploie depuis `main` | --- @@ -125,7 +125,7 @@ Côté client, pilotable depuis `stt/client/config/` + l'écran de réglages du | **0 — Cadrage** | Conception validée | ✅ | | **1 — Client voix + HUD** | `stt` : voix locale + HUD + websocket | ✅ | | **2 — STT-server** | FastAPI `/v1/ask` → LiteLLM | ✅ | -| **3 — Déploiement cluster** | image ghcr + manifests k8s + ArgoCD + `litellm-ext` | ✅ (à merger sur `main`) | +| **3 — Déploiement cluster** | image ghcr + manifests k8s + ArgoCD (LiteLLM en IP directe) | ✅ déployé | | **4 — HUD avancé** | visualiseur arc-reactor + thèmes + écran réglages | ⏳ | | **5 — Mémoire serveur** | Qdrant s01 + distillée GitHub + sessions | ⏳ | | **6 — Auto-start client** | `install-service.sh` (systemd --user) + kiosk | ⏳ | diff --git a/k8s/apps/stt/deployment.yaml b/k8s/apps/stt/deployment.yaml index 79058d9..5c1d15d 100644 --- a/k8s/apps/stt/deployment.yaml +++ b/k8s/apps/stt/deployment.yaml @@ -33,9 +33,9 @@ spec: ports: - containerPort: 8000 env: - # LiteLLM (s01) joint via le Service Endpoints litellm-ext + # LiteLLM (s01) joint en IP directe — même pattern qu'open-webui - name: STT_LITELLM_URL - value: "http://litellm-ext:4000/v1/chat/completions" + value: "http://192.168.10.1:4000/v1/chat/completions" - name: STT_LITELLM_KEY value: "lm-studio" - name: STT_MODEL diff --git a/k8s/apps/stt/litellm-external.yaml b/k8s/apps/stt/litellm-external.yaml deleted file mode 100644 index 28528e4..0000000 --- a/k8s/apps/stt/litellm-external.yaml +++ /dev/null @@ -1,22 +0,0 @@ -# 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 diff --git a/stt/README.md b/stt/README.md index 2425228..8bdde9b 100644 --- a/stt/README.md +++ b/stt/README.md @@ -14,7 +14,7 @@ Assistant vocal type *Jarvis* pour le homelab Funk, en **architecture client-ser ┌─ POSTE ──────────┐ ┌─ CLUSTER k8s (ns ai) ──────────────┐ │ client `stt` │ HTTP │ STT-server (Deployment) │ │ • micro + Whisper│ ─────▶ │ POST /v1/ask → LiteLLM │ - │ • Piper (TTS) │ ◀───── │ (litellm-ext → s01:4000) │ + │ • Piper (TTS) │ ◀───── │ (→ s01 192.168.10.1:4000) │ │ • HUD web │ reply │ Ingress: stt.lab.local │ └───────────────────┘ └──────────────┬──────────────────────┘ ▼ @@ -37,8 +37,8 @@ Prérequis poste : micro, Piper + voix dans `~/.local/share/piper/`, `aplay` (al `.github/workflows/build-stt-server.yml` (sur push touchant `stt/server/`). 2. **ArgoCD** : `k8s/apps-of-apps/apps/stt.yaml` → déploie `k8s/apps/stt/` **depuis `main`**. Tant que ce n'est pas mergé sur `main`, le cluster ne le prend pas. -3. Le serveur joint LiteLLM (s01, hors cluster) via le Service `litellm-ext` - (Endpoints manuel → `192.168.10.1:4000`). +3. Le serveur joint LiteLLM (s01, hors cluster) en **IP directe** `192.168.10.1:4000` + (même pattern qu'open-webui — pas de Service/Endpoints intermédiaire). 4. **Image privée** : le Deployment référence un `imagePullSecret` `ghcr-pull`. À créer une fois dans le ns `ai` (même pratique que `ghostfolio-secret`, non versionné) : ```bash diff --git a/stt/server/README.md b/stt/server/README.md index bbafb32..4ab55b2 100644 --- a/stt/server/README.md +++ b/stt/server/README.md @@ -14,7 +14,7 @@ STT et route l'inférence vers LiteLLM (s01) → Qwen3 (g01) / Claude. | Var | Défaut | Rôle | |---|---|---| -| `STT_LITELLM_URL` | `http://litellm-ext:4000/v1/chat/completions` | endpoint LiteLLM (via Service Endpoints) | +| `STT_LITELLM_URL` | `http://192.168.10.1:4000/v1/chat/completions` | endpoint LiteLLM (IP directe s01, cf. open-webui) | | `STT_LITELLM_KEY` | `lm-studio` | clé LiteLLM (valeur exacte attendue) | | `STT_MODEL` | `hermes-default` | alias LiteLLM (bascule Qwen/Claude via `hermes-switch`) | | `STT_SYSTEM_PROMPT` | prompt vocal FR concis | persona | @@ -34,7 +34,7 @@ curl -s localhost:8000/v1/ask -H 'content-type: application/json' -d '{"text":"b - Image construite/poussée par `.github/workflows/build-stt-server.yml` → `ghcr.io/alkatrazz24/funk-stt-server`. - Manifests : `k8s/apps/stt/` ; Application ArgoCD : `k8s/apps-of-apps/apps/stt.yaml` (depuis `main`). -- Accès LiteLLM (hors cluster) : Service + Endpoints `litellm-ext` → `192.168.10.1:4000`. +- Accès LiteLLM (hors cluster) : IP directe `192.168.10.1:4000` (même pattern qu'open-webui). ## À venir diff --git a/stt/server/stt_server/config.py b/stt/server/stt_server/config.py index c7dca04..a40c7cc 100644 --- a/stt/server/stt_server/config.py +++ b/stt/server/stt_server/config.py @@ -6,9 +6,9 @@ import os class Settings: - # LiteLLM (s01) — joint via un Service ExternalName/Endpoints dans le cluster. + # LiteLLM (s01) — joint en IP directe depuis le cluster (cf. open-webui). litellm_url: str = os.getenv( - "STT_LITELLM_URL", "http://litellm-ext:4000/v1/chat/completions" + "STT_LITELLM_URL", "http://192.168.10.1:4000/v1/chat/completions" ) litellm_key: str = os.getenv("STT_LITELLM_KEY", "lm-studio") model: str = os.getenv("STT_MODEL", "hermes-default")