# πŸ€– Effi - Assistant IA Personnel Self-Hosted Effi est un assistant IA personnel **100% auto-hΓ©bergΓ©**, avec mΓ©moire persistante, discussion vocale, gΓ©nΓ©ration d'images/audio, et surveillance systΓ¨me. --- ## πŸ—οΈ Architecture ### Infrastructure Multi-Machines | Machine | IP | RΓ΄le | Services | |---------|-----|------|----------| | **effi-server** | `192.168.1.27` | Serveur Docker principal | OpenWebUI, Qdrant, n8n, llm-proxy, TTS | | **folzo-Corp** | `192.168.1.11` | Station GPU (LLM + STT) | llama.cpp, Ollama, ComfyUI, effi-stt, kreuzberg | | **NAS Synology** | `192.168.1.25` | Monitoring | Beszel Hub | ### SchΓ©ma Global ``` β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ NAS SYNOLOGY (192.168.1.25) β”‚ β”‚ Beszel Hub :8090 β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ β”‚ β”‚ Monitoring β”‚ Monitoring β”‚ Monitoring β–Ό β–Ό β–Ό β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ EFFI SERVER (192.168.1.27) β”‚ β”‚ FOLZO-CORP (192.168.1.11) β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ β”‚ Open WebUI β”‚ β”‚ llm-proxy β”‚ β”‚ β”‚ β”‚ llama.cpp A β”‚ β”‚ Ollama β”‚ β”‚ β”‚ β”‚ Port 3000 β”‚ β”‚ :3011 Ollama β”‚ β”‚ β”‚ β”‚ :8080 β”‚ β”‚ :11434 β”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ :3012 llama.cppβ”‚ β”‚ β”‚ β”‚ (Q4_K_M) β”‚ β”‚ (vision, β”‚ β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ :3015 STT β”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ embeddings) β”‚ β”‚ β”‚ β”‚ Qdrant β”‚ β”‚ :3016 TTS β”‚ β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ β”‚ Port 6333 β”‚ β”‚ :3017 UI switchβ”‚ β”‚ β”‚ β”‚ llama.cpp B β”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ + Wake-on-LAN β”‚ β”‚ β”‚ β”‚ :8081 β”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ β”‚ (IQ4_XS) β”‚ β”‚ β”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ β”‚ β”‚ β”‚ ComfyUI β”‚ β”‚ effi-stt β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ :8188 β”‚ β”‚ :8200 β”‚ β”‚ β”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ ``` **Note :** `llm-proxy` est le point d'entrΓ©e unique vers la station GPU. Il fait du Wake-on-LAN : si le PC est Γ©teint, il envoie un paquet magic avant d'attendre que le service cible soit prΓͺt. Voir [WOL et dΓ©marrage auto](./docs/WOL-ET-DEMARRAGE-AUTO.md). --- ## πŸ“¦ Services ### FolzoCorp (192.168.1.11) | Service | Port | Image | RΓ΄le | RAM/VRAM | Auto-unload | |---------|------|-------|------|----------|-------------| | **llama.cpp A** | 8080 | Native | LLM principal β€” qwen3.8-27b **Q4_K_M** (17,5GB) | ~28GB | DΓ©marrΓ© au boot | | **llama.cpp B** | 8081 | Native | LLM alternatif β€” qwen3.8-27b **IQ4_XS** (14,2GB) | ~24GB | DΓ©marrΓ© au boot | | **Ollama** | 11434 | Native | LLM vision + embeddings | ~4-6GB | 5min aprΓ¨s dernier usage | | **ComfyUI** | 8188 | `yanwk/comfyui-boot:rocm` | Image + Audio generation | 18GB shm | βœ… aprΓ¨s 10min idle | | **effi-stt** | 8200 | Build local | Whisper STT | ~20MB | βœ… aprΓ¨s 5min idle | | **kreuzberg** | 8300 | `ghcr.io/kreuzberg-dev/kreuzberg:latest` | Document extraction | ~5MB | βœ… aprΓ¨s 10min idle | | **beszel-agent** | - | `henrygd/beszel-agent:latest` | Monitoring | ~5MB | Auto-start | ### EffiServer (192.168.1.27) | Service | Port | Image | RΓ΄le | |---------|------|-------|------| | **Open WebUI** | 3000 | `ghcr.io/open-webui/open-webui:main` | Interface IA | | **Qdrant** | 6333 | `qdrant/qdrant:latest` | Vector DB (RAG) | | **n8n** | 5678 | `docker.n8n.io/n8nio/n8n:latest` | Automatisation | | **llm-proxy** | 3011/3012/3015/3016/3017 | Build local | Proxy unique + Wake-on-LAN + UI switch | | **openedai-speech** | 8100 | `ghcr.io/matatonic/openedai-speech` | TTS | | **beszel-agent** | - | `henrygd/beszel-agent:latest` | Monitoring | ### NAS Synology (192.168.1.25) | Service | Port | Image | RΓ΄le | |---------|------|-------|------| | **Beszel Hub** | 8090 | `henrygd/beszel:latest` | Monitoring central | --- ## 🎯 FonctionnalitΓ©s ### πŸ’¬ Chat IA - **Interface**: Open WebUI - **LLM principal**: llama.cpp (`qwen3.8-27b`) via `llm-proxy:3012` - **Switch d'instance** : 2 instances llama.cpp (8080 Q4_K_M, 8081 IQ4_XS), bascule via l'UI du proxy sans toucher aux configs - **LLM vision / embeddings**: Ollama via `llm-proxy:3011` - **Wake-on-LAN automatique**: le proxy rΓ©veille la station GPU si elle est Γ©teinte ### πŸ”Œ llm-proxy β€” Proxy unique + Wake-on-LAN + UI switch - **5 routes** : Ollama (`:3011`), llama.cpp (`:3012`), STT (`:3015`), TTS (`:3016`), UI de gestion (`:3017`) - **Route virtuelle `:3012`** : pointe vers l'instance llama.cpp active (8080 ou 8081), choix persistΓ© dans `llm-proxy/state/active.json` - **Alias modΓ¨le** : les harnais envoient toujours `qwen3.8-27b` ; le proxy réécrit l'id rΓ©el dans les 2 sens (requΓͺtes, `/v1/models`, streaming SSE) β†’ le switch est invisible pour OpenWebUI/OpenFox/Hermes - **Wake-on-LAN** : si le PC est Γ©teint, envoie 3 paquets magic (MAC `04:D9:F5:D1:EC:DF`) puis attend le service - **Anti-spam WOL** : un seul rΓ©veil en cours Γ  la fois, pas de re-envoi pendant l'attente - **Fail-fast** : PC up mais instance cible Γ©teinte β†’ 503 aprΓ¨s 20s (pas de WOL) - **API OpenAI-compatible** : `/v1/models` et `/v1/chat/completions` sur les routes LLM - **Streaming** : passthrough des rΓ©ponses SSE (alias réécrit par ligne) - **UI `:3017`** : statut des 2 instances, bouton *Activer* (persistΓ©), bouton *Tester* (latence + rΓ©ponse) #### Switcher entre les 2 versions de qwen3.8 1. Sur le PC : dΓ©marrer l'instance voulue (et arrΓͺter l'autre β€” une seule tient dans la VRAM) 2. Ouvrir http://192.168.1.27:3017 β†’ *Tester* pour vΓ©rifier que l'instance rΓ©pond β†’ *Activer* 3. TerminΓ© : `:3012` sert dΓ©sormais la nouvelle instance, zΓ©ro changement de config cΓ΄tΓ© harnais ```bash # Alternative sans UI curl -X POST http://192.168.1.27:3017/api/activate -d '{"real":"qwen3.8-27b"}' # instance A (8080) curl -X POST http://192.168.1.27:3017/api/activate -d '{"real":"qwen3.8-27b-iq4xs"}' # instance B (8081) curl http://192.168.1.27:3017/api/status ``` ### 🎀 Pipeline Vocal - **STT**: Whisper large-v3 via effi-stt (CPU, dΓ©chargement auto) - **TTS**: openedai-speech (serveur, voix Piper + XTTS) ### πŸ–ΌοΈ GΓ©nΓ©ration Images/Audio - **ComfyUI**: Workflows pour image et audio - **ModΓ¨le audio**: ACE-Step (gΓ©nΓ©ration musicale) - **ModΓ¨les image**: Multiples checkpoints disponibles ### πŸ“„ Extraction Documents - **Kreuzberg**: Extraction 90+ formats (PDF, DOCX, images, etc.) - IntΓ©grΓ© Γ  OpenWebUI via CONTENT_EXTRACTION_ENGINE=docling ### 🧠 MΓ©moire - **Type**: MΓ©moire manuelle via OpenWebUI (snippets) - **RAG**: Qdrant pour embeddings sΓ©mantiques ### πŸ“Š Monitoring - **URL Beszel**: http://192.168.1.25:8090 - **Agents actifs**: - FolzoCorp (192.168.1.11) - GPU AMD RX 7800 XT - EffiServer (192.168.1.27) - Intel J5040 ### πŸ› οΈ Tool OpenWebUI - Beszel Outil custom pour interroger Beszel depuis OpenWebUI via Effi. **FonctionnalitΓ©s actuelles**: - `get_system_stats` β†’ retourne CPU, RAM, GPU (%) - DonnΓ©es temps rΓ©el depuis `info` (cpu, mp=gpu, g=gpu, dt=timestamp) **Documentation**: [Tool Beszel OpenWebUI](./docs/TOOL-BESZEL-OPENWEBUI.md) ### Scripts Memory | Script | Condition | Action | |--------|-----------|--------| | comfyui-memory-manager.py | 10min idle + VRAM<1% + RAM>5GB | Restart container | | kreuzberg-memory-manager.py | 10min idle + RAM>2GB | Restart container | | effi-stt | 5min idle | DΓ©chargement modΓ¨le Whisper | ### Commandes Utiles ```bash # Statut services docker ps docker logs -f llm-proxy # Tester le proxy (PC allumΓ©) curl http://192.168.1.27:3012/health curl http://192.168.1.27:3011/api/version # MΓ©triques Beszel python3 scripts/beszel_client.py --system folzocorp --check stats ``` --- ## πŸ“š Documentation - [WOL et dΓ©marrage auto](./docs/WOL-ET-DEMARRAGE-AUTO.md) - [Installation Beszel](./docs/BESZEL-INSTALLATION.md) - [Gestion MΓ©moire](./docs/MEMOIRE-GESTION.md) - [Session 2026-04-12](./docs/SESSION-2026-04-12-RAM-BESZEL.md) - [Guide ACE-Step](./docs/guide-ace-step.md) - [Guide ComfyUI](./comfyui/README.md) --- ## πŸ”— Technologies | Domaine | Technologies | |---------|-------------| | **LLM** | llama.cpp (principal), Ollama (vision + embeddings) | | **Proxy / WOL** | llm-proxy (Flask, proxy multi-cibles + Wake-on-LAN) | | **Interface** | Open WebUI | | **STT** | Faster Whisper (CPU) | | **TTS** | openedai-speech (Piper + XTTS) | | **Image/Audio** | ComfyUI + ACE-Step | | **Vector DB** | Qdrant | | **Document** | Kreuzberg (docling) | | **Automatisation** | n8n | | **GPU** | AMD RX 7800 XT (ROCm) | | **Monitoring** | Beszel | --- ## πŸ“ Structure du Projet ``` effi/ β”œβ”€β”€ llm-proxy/ # Proxy unique + Wake-on-LAN + UI switch β”‚ β”œβ”€β”€ app.py β”‚ β”œβ”€β”€ Dockerfile β”‚ └── state/ # Persistance instance active (active.json) β”‚ β”œβ”€β”€ beszel/ # Configuration Beszel β”‚ β”œβ”€β”€ docker-compose-hub.yml # Hub (Synology) β”‚ β”œβ”€β”€ docker-compose-agent-folzocorp.yml # Agent FolzoCorp β”‚ └── docker-compose-agent-effiserver.yml # Agent EffiServer β”‚ β”œβ”€β”€ comfyui/ # ComfyUI (Image/Audio) β”‚ β”œβ”€β”€ docker-compose.yml β”‚ β”œβ”€β”€ custom_nodes/ # Nodes personnalisΓ©s β”‚ β”œβ”€β”€ models/ # ModΓ¨les checkpoints, VAE, LoRA β”‚ └── workflows/ # Workflows JSON β”‚ β”œβ”€β”€ effi-stt/ # STT Whisper β”‚ β”œβ”€β”€ docker-compose.yml β”‚ β”œβ”€β”€ Dockerfile β”‚ └── main.py # API avec timeout auto-unload β”‚ β”œβ”€β”€ effi-kreuzberg/ # Documentation Kreuzberg β”‚ β”œβ”€β”€ README.md β”‚ └── MIGRATION.md β”‚ β”œβ”€β”€ scripts/ # Scripts utilitaires β”‚ β”œβ”€β”€ beszel_client.py # Client API Beszel β”‚ β”œβ”€β”€ comfyui-memory-manager.py # Restart ComfyUI aprΓ¨s idle β”‚ β”œβ”€β”€ kreuzberg-memory-manager.py # Restart Kreuzberg si >2GB β”‚ └── start-memory-monitors.sh β”‚ β”œβ”€β”€ systemd/ # Services systemd β”‚ β”œβ”€β”€ comfyui-memory-manager.service β”‚ β”œβ”€β”€ kreuzberg-memory-manager.service β”‚ └── beszel-agent-wake.service β”‚ β”œβ”€β”€ docs/ # Documentation β”‚ β”œβ”€β”€ WOL-ET-DEMARRAGE-AUTO.md β”‚ β”œβ”€β”€ BESZEL-INSTALLATION.md β”‚ β”œβ”€β”€ MEMOIRE-GESTION.md β”‚ └── TOOL-BESZEL-OPENWEBUI.md β”‚ └── docker-compose.yml # Stack principale (effi-server) ``` --- ## πŸ“ Historique **Septembre 2026** - Switch d'instance llama.cpp - 2 instances llama.cpp sur folzo-Corp (8080 Q4_K_M, 8081 IQ4_XS) - Route virtuelle `:3012` + alias modΓ¨le `qwen3.8-27b` : switch transparent, zΓ©ro re-config harnais - UI de gestion `:3017` (statut, Activer, Tester) - Fail-fast 503 (20s) quand l'instance active est Γ©teinte, sans spam WOL **AoΓ»t 2026** - Simplification : proxy unique + Wake-on-LAN ### llm-proxy βœ… - Un seul service remplace jean-router, jean-proxy, jean-proxy-moe, wol-proxy - 4 routes : Ollama (`:3011`), llama.cpp (`:3012`), STT (`:3015`), TTS (`:3016`) - Wake-on-LAN intΓ©grΓ© avec anti-spam (un seul rΓ©veil en cours) - Suppression de tout le code Jean (plus besoin de routing dynamique) - OpenWebUI pointe vers `llm-proxy:3011` (Ollama) et `llm-proxy:3012` (llama.cpp) **Juillet 2026** - Routing dynamique (abandonnΓ©) - jean-router : routing dynamique Jean/Ollama + gestion VRAM (supprimΓ©) **Avril 2026** - Optimisation RAM + Monitoring + Tool OpenWebUI - Scripts dΓ©chargement mΓ©moire avec restart container (ComfyUI, Kreuzberg) - Timeout inactivitΓ© 300s pour effi-stt avec dΓ©chargement Whisper - Beszel Monitoring (Hub NAS + agents FolzoCorp/EffiServer) - Tool OpenWebUI Beszel **FΓ©vrier 2026** - Stack Vocale - effi-stt avec Whisper large-v3 - openedai-speech avec XTTS v2 - Kreuzberg pour extraction documents --- ## πŸ™‹ Auteur **Folzo** - [gitea.folzocorp.fr/Folzo](https://gitea.folzocorp.fr/Folzo) --- *DerniΓ¨re mise Γ  jour : AoΓ»t 2026*