fix(stt): joindre LiteLLM en IP directe (192.168.10.1:4000) (#6)

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 <noreply@anthropic.com>
This commit is contained in:
ALI YESILKAYA 2026-06-17 13:19:51 +02:00 committed by GitHub
parent 35f37bd293
commit 47936b0088
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 14 additions and 36 deletions

View file

@ -58,7 +58,7 @@ Maillon réellement manquant : **l'interface graphique HUD** + le packaging + la
│ • Piper (TTS) │ POST │ POST /v1/ask {text} → {reply} │ │ • Piper (TTS) │ POST │ POST /v1/ask {text} → {reply} │
│ • HUD web (ui/ + hud/) │ /v1/ask│ brain → LiteLLM (httpx) │ │ • HUD web (ui/ + hud/) │ /v1/ask│ brain → LiteLLM (httpx) │
│ • api.py → ServerClient │ ◀───── │ IngressRoute : stt.lab.local │ │ • 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) 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 cerveau — côté serveur
Le STT-server appelle **LiteLLM `:4000`** (OpenAI-compatible), joint depuis le cluster via Le STT-server appelle **LiteLLM `:4000`** (OpenAI-compatible), joint depuis le cluster en
un Service sans sélecteur + Endpoints manuel (`litellm-ext``192.168.10.1:4000`). LiteLLM **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`. 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 > **« 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 | | — 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 | | 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` | | 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` | | 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 | ✅ | | **0 — Cadrage** | Conception validée | ✅ |
| **1 — Client voix + HUD** | `stt` : voix locale + HUD + websocket | ✅ | | **1 — Client voix + HUD** | `stt` : voix locale + HUD + websocket | ✅ |
| **2 — STT-server** | FastAPI `/v1/ask` → LiteLLM | ✅ | | **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 | ⏳ | | **4 — HUD avancé** | visualiseur arc-reactor + thèmes + écran réglages | ⏳ |
| **5 — Mémoire serveur** | Qdrant s01 + distillée GitHub + sessions | ⏳ | | **5 — Mémoire serveur** | Qdrant s01 + distillée GitHub + sessions | ⏳ |
| **6 — Auto-start client** | `install-service.sh` (systemd --user) + kiosk | ⏳ | | **6 — Auto-start client** | `install-service.sh` (systemd --user) + kiosk | ⏳ |

View file

@ -33,9 +33,9 @@ spec:
ports: ports:
- containerPort: 8000 - containerPort: 8000
env: 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 - 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 - name: STT_LITELLM_KEY
value: "lm-studio" value: "lm-studio"
- name: STT_MODEL - name: STT_MODEL

View file

@ -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

View file

@ -14,7 +14,7 @@ Assistant vocal type *Jarvis* pour le homelab Funk, en **architecture client-ser
┌─ POSTE ──────────┐ ┌─ CLUSTER k8s (ns ai) ──────────────┐ ┌─ POSTE ──────────┐ ┌─ CLUSTER k8s (ns ai) ──────────────┐
│ client `stt` │ HTTP │ STT-server (Deployment) │ │ client `stt` │ HTTP │ STT-server (Deployment) │
│ • micro + Whisper│ ─────▶ │ POST /v1/ask → LiteLLM │ │ • 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 │ │ • 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/`). `.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`**. 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. 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` 3. Le serveur joint LiteLLM (s01, hors cluster) en **IP directe** `192.168.10.1:4000`
(Endpoints manuel → `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`. 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é) : À créer une fois dans le ns `ai` (même pratique que `ghostfolio-secret`, non versionné) :
```bash ```bash

View file

@ -14,7 +14,7 @@ STT et route l'inférence vers LiteLLM (s01) → Qwen3 (g01) / Claude.
| Var | Défaut | Rôle | | 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_LITELLM_KEY` | `lm-studio` | clé LiteLLM (valeur exacte attendue) |
| `STT_MODEL` | `hermes-default` | alias LiteLLM (bascule Qwen/Claude via `hermes-switch`) | | `STT_MODEL` | `hermes-default` | alias LiteLLM (bascule Qwen/Claude via `hermes-switch`) |
| `STT_SYSTEM_PROMPT` | prompt vocal FR concis | persona | | `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`. - 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`). - 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 ## À venir

View file

@ -6,9 +6,9 @@ import os
class Settings: 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( 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") litellm_key: str = os.getenv("STT_LITELLM_KEY", "lm-studio")
model: str = os.getenv("STT_MODEL", "hermes-default") model: str = os.getenv("STT_MODEL", "hermes-default")