Date: 17/01/2026 Auteur: Claude Status: En attente de validation
Les outils IA sur win11 (RTX 3090 24 Go VRAM) ne peuvent pas tourner simultanément car ils partagent la VRAM. Actuellement:
Créer un AI Orchestrator qui:
┌─────────────────────────────────────────────────────────────────────────┐
│ DASHBOARD (O2switch) │
│ dashboard.nowhere84.com/ai.html │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ Status GPU │ │ Tool Switch │ │ Queue View │ │ Job History │ │
│ └─────────────┘ └─────────────┘ └─────────────┘ └─────────────┘ │
└────────────────────────────────────┬────────────────────────────────────┘
│ HTTPS
▼
┌─────────────────────────────────────────────────────────────────────────┐
│ AI ORCHESTRATOR (prod-portainer) │
│ 192.168.1.12:5500 │
│ ┌─────────────────────────────────────────────────────────────────┐ │
│ │ FastAPI Server │ │
│ │ /api/tools - Liste outils + status │ │
│ │ /api/tools/{id}/start - Démarrer un outil │ │
│ │ /api/tools/{id}/stop - Arrêter un outil │ │
│ │ /api/queue - Voir/ajouter à la queue │ │
│ │ /api/queue/{id} - Status d'un job │ │
│ │ /api/gpu - Status GPU (VRAM, process) │ │
│ └─────────────────────────────────────────────────────────────────┘ │
│ │ │
│ ┌───────────────┐ ┌───────┴───────┐ ┌─────────────────────────┐ │
│ │ Redis Queue │ │ Job Processor │ │ WebSocket (live status) │ │
│ │ (jobs pending)│ │ (async worker)│ │ (dashboard updates) │ │
│ └───────────────┘ └───────────────┘ └─────────────────────────┘ │
└────────────────────────────────────┬────────────────────────────────────┘
│ SSH
▼
┌─────────────────────────────────────────────────────────────────────────┐
│ WIN11 (192.168.1.30) │
│ RTX 3090 24 Go │
│ ┌─────────────────────────────────────────────────────────────────┐ │
│ │ AI Tools (un seul actif) │ │
│ │ Ollama (11434) | ComfyUI (8188) | Fooocus (7865) | Wan2.1 (7860)│ │
│ │ Applio (6969) | Bark (7866) | MusicGen (7867)| SadTalker │ │
│ │ FaceFusion | TripoSR (7870) | │ │
│ └─────────────────────────────────────────────────────────────────┘ │
│ │ │
│ ┌─────────────────────────────────────────────────────────────────┐ │
│ │ Agent Local (Python) │ │
│ │ - Reçoit commandes SSH de l'orchestrator │ │
│ │ - Start/Stop processes │ │
│ │ - Monitore VRAM (nvidia-smi) │ │
│ │ - Reporte status │ │
│ └─────────────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────────────┘
Stack: Python FastAPI + Redis + WebSocket
Endpoints:
| Endpoint | Méthode | Description |
|---|---|---|
/api/tools |
GET | Liste tous les outils avec leur status |
/api/tools/{tool_id}/start |
POST | Démarre un outil (arrête l'actif si besoin) |
/api/tools/{tool_id}/stop |
POST | Arrête un outil |
/api/gpu |
GET | Status GPU (VRAM libre, process actifs) |
/api/queue |
GET | Liste des jobs en attente |
/api/queue |
POST | Ajoute un job à la queue |
/api/queue/{job_id} |
GET | Status d'un job spécifique |
/api/queue/{job_id} |
DELETE | Annule un job |
/api/ws |
WebSocket | Updates temps réel |
Modèle de données:
# Tool
{
"id": "bark",
"name": "Bark TTS",
"port": 7866,
"category": "audio",
"status": "stopped|starting|running|stopping",
"vram_usage": "~4 Go",
"start_command": "I:\\Bark\\start_bark.bat",
"health_endpoint": "http://192.168.1.30:7866/"
}
# Job (queue)
{
"id": "uuid",
"tool": "bark",
"type": "tts",
"payload": {"text": "Hello world", "voice": "v2/en_speaker_0"},
"status": "pending|processing|completed|failed",
"created_at": "2026-01-17T14:00:00Z",
"started_at": null,
"completed_at": null,
"result": null,
"error": null
}
Stack: Python script léger
Fonctions:
nvidia-smi --query-gpu=memory.used,memory.free --format=csvAlternative sans agent: L'orchestrator exécute tout via SSH (plus simple mais moins réactif)
Nouvelle page: dashboard.nowhere84.com/ai.html
Sections:
Status GPU
Tool Switcher
Queue Manager
Job History
1. User clique "Start Bark" sur dashboard
2. Dashboard → POST /api/tools/bark/start
3. Orchestrator vérifie si un outil tourne
4. Si oui → arrête l'outil actif (graceful shutdown)
5. SSH → win11: démarre Bark
6. Attente health check OK
7. WebSocket → Dashboard: status "running"
8. User peut utiliser https://bark.33800.nowhere84.com
1. User soumet un job TTS via API
2. POST /api/queue {tool: "bark", payload: {text: "Hello"}}
3. Job ajouté à Redis queue, status "pending"
4. Si Bark pas actif:
- Orchestrator démarre Bark
- Attend health check
5. Job processor prend le job
6. Appelle API Bark pour générer audio
7. Stocke résultat, status "completed"
8. WebSocket → notifie completion
9. Si queue vide et timeout → peut arrêter l'outil
{
"tools": {
"ollama": {
"name": "Ollama",
"category": "llm",
"port": 11434,
"autostart": true,
"vram": "variable",
"start_cmd": null,
"stop_cmd": null,
"health": "http://192.168.1.30:11434/api/tags"
},
"bark": {
"name": "Bark TTS",
"category": "audio",
"port": 7866,
"autostart": false,
"vram": "4 Go",
"start_cmd": "I:\\Bark\\start_bark.bat",
"stop_cmd": "taskkill /F /IM python.exe /FI \"WINDOWTITLE eq Bark*\"",
"health": "http://192.168.1.30:7866/",
"startup_time": 120
},
"comfyui": {
"name": "ComfyUI",
"category": "image",
"port": 8188,
"autostart": false,
"vram": "8-12 Go",
"start_cmd": "I:\\ComfyUI_clean\\start_comfyui.bat",
"health": "http://192.168.1.30:8188/system_stats"
}
// ... autres outils
},
"settings": {
"idle_timeout": 1800,
"max_queue_size": 100,
"priority_tools": ["ollama"]
}
}
ai-orchestrator sur GitLab| Composant | Techno | Justification |
|---|---|---|
| API | FastAPI (Python) | Async, simple, WebSocket natif |
| Queue | Redis | Déjà sur prod-portainer, léger |
| Worker | Celery ou asyncio | Processing async des jobs |
| Dashboard | HTML/JS vanilla | Cohérent avec dashboard existant |
| Config | JSON | Simple, versionnable |
| Logs | Loki | Déjà en place |
| Risque | Mitigation |
|---|---|
| Outil ne s'arrête pas | Timeout + kill forcé après 30s |
| VRAM non libérée | nvidia-smi vérifie avant start |
| SSH connection fail | Retry avec backoff, alerte |
| Job bloqué | Timeout par job, status "failed" |
| Queue overflow | Limite 100 jobs, FIFO |
| Phase | Temps estimé |
|---|---|
| Phase 1 | 2-3h |
| Phase 2 | 1-2h |
| Phase 3 | 2-3h |
| Phase 4 | 2-4h (optionnel) |
| Total | 5-8h (sans phase 4) |
Agent local vs SSH pur?
Priorité des outils?
Stockage résultats?
Domaine API?
ai-orchestrator.33800.nowhere84.com?