mirror of
https://github.com/Alkatrazz24/Funk-lab.git
synced 2026-07-10 23:44:42 +02:00
* feat(stt): cadrage + squelette assistant vocal Jarvis Conception validée du projet STT — assistant vocal/HUD du homelab Funk : - HUD web sur-mesure + STT/TTS local (faster-whisper + Piper) - Packaging commande pipx (stt), démarrage auto systemd --user - Cerveau 3 modes + auto-détection LAN : hermes / local-direct / claude-direct - Mémoire 3 tiers : SQLite local + Qdrant s01 + GitHub (distillée, versionnée) Réutilise tools/hermes-voice, LiteLLM, Hermes Agent. Squelette + doc admin/ia/stt.md, implémentation par phases (roadmap dans le doc). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013FmcxGsyXZXogiAHQLjnZT * feat(stt): phase 1-2 — commande, backend vocal, routeur cerveau, HUD MVP - cli.py : commande `stt` (--setup, --mode, --no-tts) - config.py : défauts embarqués + ~/.config/stt/stt.toml - voice/engine.py : refactor de hermes-voice en classe avec callbacks d'état - brain/router.py : 3 modes (hermes SSH / local LiteLLM / claude API) + auto-détection LAN - server/app.py : HTTP statique (HUD) + websocket (états → HUD) - memory/store.py : tier local SQLite (Qdrant + sync GitHub = phase 4) - hud/index.html : HUD MVP (visualiseur d'état + conversation) Vérifié hors-LAN : py_compile, --help, config, routeur (→ claude), mémoire SQLite. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013FmcxGsyXZXogiAHQLjnZT * fix(stt): embarquer le HUD dans le package (404 après pipx install) Le HUD était à la racine du projet (stt/hud/) donc absent du package installé par pipx → HTTP 404 sur /. Déplacé dans le package (stt/stt/hud/) + package-data, HUD_DIR ajusté. Vérifié : le wheel contient bien stt/hud/index.html. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013FmcxGsyXZXogiAHQLjnZT * 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 --------- Co-authored-by: Claude <noreply@anthropic.com>
49 lines
1.6 KiB
Python
49 lines
1.6 KiB
Python
"""Tier mémoire local : journal de conversation en SQLite (brut, gitignoré).
|
|
|
|
Phase 1 : on persiste juste les tours de conversation. La distillation vers GitHub
|
|
et l'embedding Qdrant (s01) arrivent en phase 4.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
import sqlite3
|
|
import time
|
|
from pathlib import Path
|
|
|
|
|
|
class LocalMemory:
|
|
def __init__(self, db_path: str):
|
|
self.path = Path(db_path).expanduser()
|
|
self.path.parent.mkdir(parents=True, exist_ok=True)
|
|
self._db = sqlite3.connect(str(self.path), check_same_thread=False)
|
|
self._db.execute(
|
|
"""CREATE TABLE IF NOT EXISTS turns (
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
ts REAL NOT NULL,
|
|
role TEXT NOT NULL,
|
|
content TEXT NOT NULL,
|
|
mode TEXT
|
|
)"""
|
|
)
|
|
self._db.commit()
|
|
|
|
def log(self, role: str, content: str, mode: str | None = None) -> None:
|
|
self._db.execute(
|
|
"INSERT INTO turns (ts, role, content, mode) VALUES (?, ?, ?, ?)",
|
|
(time.time(), role, content, mode),
|
|
)
|
|
self._db.commit()
|
|
|
|
def recent(self, limit: int = 20) -> list[dict]:
|
|
cur = self._db.execute(
|
|
"SELECT ts, role, content, mode FROM turns ORDER BY id DESC LIMIT ?",
|
|
(limit,),
|
|
)
|
|
rows = [
|
|
{"ts": ts, "role": role, "content": content, "mode": mode}
|
|
for ts, role, content, mode in cur.fetchall()
|
|
]
|
|
return list(reversed(rows))
|
|
|
|
def close(self) -> None:
|
|
self._db.close()
|