# ๐ŸŽ™๏ธ Studio IA Multimodal โ€” Architecture & Spรฉcifications ## Version 3 โ€” VM Vast.ai + Docker Compose --- ## 1. Principe gรฉnรฉral Sur Vast.ai, utiliser le mode **VM** (Virtual Machine) au lieu du mode Container. Cela donne un accรจs root complet ร  une vraie machine, avec Docker Engine installรฉ nativement. Chaque modรจle IA tourne dans son propre container Docker, orchestrรฉ par Docker Compose. ``` โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ VM Vast.ai (RTX A4000 16Go / 130Go SSD) โ”‚ โ”‚ โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”‚ โ”‚ open-webui โ”‚ โ”‚ ollama โ”‚ โ”‚ โ”‚ โ”‚ :3000 โ”‚ โ”‚ :11434 โ”‚ โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”‚ โ”‚ Tools API โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”‚ โ”‚ Docker Network โ”‚ โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ” โ”Œโ”€โ”€โ”ดโ”€โ”€โ”€โ” โ”Œโ”ดโ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”‚ โ”‚ace-stepโ”‚ โ”‚heart โ”‚ โ”‚zonos โ”‚ โ”‚index โ”‚ โ”‚huny โ”‚ โ”‚ โ”‚ โ”‚ :7860 โ”‚ โ”‚:7861 โ”‚ โ”‚:7862 โ”‚ โ”‚:7863 โ”‚ โ”‚:7864โ”‚ โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”‚ โ”‚ comfyui โ”‚ โ”‚ โ”‚ โ”‚ :8188 โ”‚ โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ ``` --- ## 2. Template Vast.ai โ€” Mode VM | Paramรจtre | Valeur | |---|---| | **Type** | VM (Virtual Machine) | | **GPU** | RTX A4000 16 Go | | **Disk** | 130 Go minimum (200 Go recommandรฉ) | | **Launch mode** | VM | | **OS** | Ubuntu 22.04 | | **PROVISIONING_SCRIPT** | URL Gitea โ†’ installe Docker + lance compose | --- ## 3. Structure du dรฉpรดt Gitea ``` VASTAI-STUDIO-AUDIO/ โ”œโ”€โ”€ docker-compose.yml โ† Orchestration principale โ”œโ”€โ”€ provisioning_script.sh โ† Installation Docker + lancement โ”œโ”€โ”€ .env โ† Variables (ports, tokens...) โ”‚ โ”œโ”€โ”€ services/ โ”‚ โ”œโ”€โ”€ open-webui/ โ”‚ โ”‚ โ””โ”€โ”€ Dockerfile โ”‚ โ”œโ”€โ”€ ace-step/ โ”‚ โ”‚ โ”œโ”€โ”€ Dockerfile โ”‚ โ”‚ โ””โ”€โ”€ server.py โ”‚ โ”œโ”€โ”€ heart-mula/ โ”‚ โ”‚ โ”œโ”€โ”€ Dockerfile โ”‚ โ”‚ โ””โ”€โ”€ server.py โ”‚ โ”œโ”€โ”€ zonos/ โ”‚ โ”‚ โ”œโ”€โ”€ Dockerfile โ”‚ โ”‚ โ””โ”€โ”€ server.py โ”‚ โ”œโ”€โ”€ indextts/ โ”‚ โ”‚ โ”œโ”€โ”€ Dockerfile โ”‚ โ”‚ โ””โ”€โ”€ server.py โ”‚ โ”œโ”€โ”€ hunyuan-foley/ โ”‚ โ”‚ โ”œโ”€โ”€ Dockerfile โ”‚ โ”‚ โ””โ”€โ”€ server.py โ”‚ โ””โ”€โ”€ comfyui/ โ”‚ โ””โ”€โ”€ Dockerfile โ”‚ โ””โ”€โ”€ models/ โ† Scripts de tรฉlรฉchargement โ”œโ”€โ”€ download_audio.sh โ”œโ”€โ”€ download_tts.sh โ””โ”€โ”€ download_image.sh ``` --- ## 4. docker-compose.yml ```yaml version: '3.8' networks: studio-network: driver: bridge volumes: ollama-data: openwebui-data: models-audio: models-image: models-tts: outputs: services: # โ”€โ”€โ”€ INTERFACE & LLM โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ ollama: image: ollama/ollama:latest container_name: ollama runtime: nvidia environment: - NVIDIA_VISIBLE_DEVICES=all volumes: - ollama-data:/root/.ollama ports: - "11434:11434" networks: - studio-network restart: unless-stopped open-webui: image: ghcr.io/open-webui/open-webui:main container_name: open-webui depends_on: - ollama environment: - OLLAMA_BASE_URL=http://ollama:11434 - WEBUI_SECRET_KEY=${WEBUI_SECRET_KEY} - ENABLE_SIGNUP=true volumes: - openwebui-data:/app/backend/data ports: - "3000:8080" networks: - studio-network restart: unless-stopped # โ”€โ”€โ”€ Gร‰Nร‰RATION MUSICALE โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ ace-step: build: ./services/ace-step container_name: ace-step runtime: nvidia environment: - NVIDIA_VISIBLE_DEVICES=all volumes: - models-audio:/models - outputs:/outputs ports: - "7860:7860" networks: - studio-network restart: unless-stopped heart-mula: build: ./services/heart-mula container_name: heart-mula runtime: nvidia environment: - NVIDIA_VISIBLE_DEVICES=all volumes: - models-audio:/models - outputs:/outputs ports: - "7861:7861" networks: - studio-network restart: unless-stopped # โ”€โ”€โ”€ VOIX OFF โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ zonos: build: ./services/zonos container_name: zonos runtime: nvidia environment: - NVIDIA_VISIBLE_DEVICES=all volumes: - models-tts:/models - outputs:/outputs ports: - "7862:7862" networks: - studio-network restart: unless-stopped indextts: build: ./services/indextts container_name: indextts runtime: nvidia environment: - NVIDIA_VISIBLE_DEVICES=all volumes: - models-tts:/models - outputs:/outputs ports: - "7863:7863" networks: - studio-network restart: unless-stopped # โ”€โ”€โ”€ FOLEY โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ hunyuan-foley: build: ./services/hunyuan-foley container_name: hunyuan-foley runtime: nvidia environment: - NVIDIA_VISIBLE_DEVICES=all volumes: - models-audio:/models - outputs:/outputs ports: - "7864:7864" networks: - studio-network restart: unless-stopped # โ”€โ”€โ”€ Gร‰Nร‰RATION IMAGE โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ comfyui: build: ./services/comfyui container_name: comfyui runtime: nvidia environment: - NVIDIA_VISIBLE_DEVICES=all volumes: - models-image:/root/ComfyUI/models - outputs:/outputs ports: - "8188:8188" networks: - studio-network restart: unless-stopped ``` --- ## 5. Dockerfile type par service Chaque service a son propre Dockerfile avec ses dรฉpendances exactes. Exemple pour ACE-Step : ```dockerfile # services/ace-step/Dockerfile FROM nvidia/cuda:12.1.1-cudnn8-runtime-ubuntu22.04 ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get install -y \ python3.11 python3.11-pip python3.11-venv \ ffmpeg libsndfile1 git wget RUN python3.11 -m pip install --upgrade pip # Dรฉpendances spรฉcifiques ACE-Step RUN python3.11 -m pip install \ torch==2.2.0 torchaudio==2.2.0 \ --index-url https://download.pytorch.org/whl/cu121 RUN python3.11 -m pip install ace-step gradio fastapi uvicorn COPY server.py /app/server.py WORKDIR /app EXPOSE 7860 CMD ["python3.11", "server.py"] ``` Mรชme structure pour chaque service, avec les versions exactes requises par chaque modรจle. --- ## 6. Provisioning Script VM ```bash #!/bin/bash # ============================================================= # Studio IA โ€” Provisioning Script VM Vast.ai # ============================================================= set -eo pipefail echo "๐Ÿš€ Installation de Docker..." curl -fsSL https://get.docker.com | bash systemctl enable docker systemctl start docker echo "๐ŸŽฎ Installation NVIDIA Container Toolkit..." curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | \ gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | \ sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \ tee /etc/apt/sources.list.d/nvidia-container-toolkit.list apt-get update && apt-get install -y nvidia-container-toolkit nvidia-ctk runtime configure --runtime=docker systemctl restart docker echo "๐Ÿ“ฆ Clonage du dรฉpรดt Studio IA..." git clone https://git.syoul.fr/nicoboy/VASTAI-STUDIO-AUDIO.git /root/studio-ai cd /root/studio-ai echo "๐Ÿ“ฅ Tรฉlรฉchargement des modรจles..." bash models/download_audio.sh bash models/download_tts.sh bash models/download_image.sh echo "๐Ÿ—๏ธ Build et lancement des containers..." docker compose up -d --build echo "" echo "โœ… Studio IA prรชt !" echo " Open WebUI โ†’ http://[IP]:3000" echo " ComfyUI โ†’ http://[IP]:8188" echo " ACE-Step โ†’ http://[IP]:7860" ``` --- ## 7. Modรจles โ€” ร‰tat de l'art 2026 ### ๐ŸŽต Musique | Modรจle | VRAM | Qualitรฉ | Vitesse | |---|---|---|---| | **ACE-Step 1.5** | 8-12 Go | โญโญโญโญ | Trรจs rapide | | **Heart Mula** | 12-16 Go | โญโญโญโญโญ | Lente | ### ๐ŸŽค Voix Off | Modรจle | VRAM | Spรฉcialitรฉ | |---|---|---| | **Zonos-v0.1** | 8-12 Go | ร‰motion, clone voix 10s, 44kHz | | **IndexTTS-2** | 8 Go | Sync animation, contrรดle durรฉe ms | ### ๐Ÿ”Š Foley | Modรจle | VRAM | Spรฉcialitรฉ | |---|---|---| | **HunyuanVideo-Foley** | 12-16 Go | Analyse vidรฉo โ†’ son synchronisรฉ | ### ๐Ÿ–ผ๏ธ Image | Modรจle | VRAM | Qualitรฉ | |---|---|---| | **Flux.1** | 12-16 Go | โญโญโญโญโญ | | **SDXL** | 8-12 Go | โญโญโญโญ | --- ## 8. Estimation disque | ร‰lรฉment | Taille | |---|---| | Images Docker (tous services) | ~20 Go | | Modรจles LLM (Mistral + CodeLlama) | ~12 Go | | Modรจles Audio (ACE-Step, Heart Mula) | ~10 Go | | Modรจles TTS (Zonos, IndexTTS-2) | ~8 Go | | HunyuanVideo-Foley | ~8 Go | | ComfyUI + Flux.1 + SDXL | ~20 Go | | Outputs utilisateurs | ~10 Go | | **Total** | **~88 Go** | > โœ… **130 Go = juste suffisant** > โญ **200 Go = recommandรฉ pour รชtre ร  l'aise** --- ## 9. Configuration Open WebUI (ร  faire avec Claude) ### 9.1 Connexions ร  configurer - Ollama : `http://ollama:11434` - ACE-Step : `http://ace-step:7860` - Heart Mula : `http://heart-mula:7861` - Zonos : `http://zonos:7862` - IndexTTS : `http://indextts:7863` - HunyuanVideo : `http://hunyuan-foley:7864` - ComfyUI : `http://comfyui:8188` > Sur le rรฉseau Docker interne, les services se parlent par nom de container. ### 9.2 Tools ร  crรฉer (Functions Open WebUI) - `generate_music(prompt, duration, model)` - `generate_voice(text, emotion, speaker_sample)` - `generate_foley(video_path, prompt)` - `generate_image(prompt, width, height, model)` - `generate_code(prompt, language)` ### 9.3 System Prompt ``` Tu es un assistant crรฉatif expert en production multimรฉdia. Tu disposes des outils suivants : - generate_music : composition musicale (ACE-Step ou Heart Mula) - generate_voice : voix off avec contrรดle รฉmotionnel (Zonos ou IndexTTS) - generate_foley : bruitage synchronisรฉ vidรฉo (HunyuanVideo-Foley) - generate_image : gรฉnรฉration d'images (Flux.1 ou SDXL) - generate_code : รฉcriture de code (CodeLlama) Avant chaque gรฉnรฉration, tu clarifies la demande. Aprรจs chaque gรฉnรฉration, tu proposes des ajustements. ``` --- ## 10. Checklist projet - [x] Architecture dรฉfinie (VM + Docker Compose) - [x] ร‰tat de l'art 2026 intรฉgrรฉ - [ ] **Dockerfiles ร— 7 โ†’ Gemini** - [ ] **docker-compose.yml final โ†’ Gemini** - [ ] Build + push DockerHub (image par service) - [ ] Test VM Vast.ai + Docker Compose - [ ] Scripts tรฉlรฉchargement modรจles - [ ] **Configuration Open WebUI โ†’ Claude** - [ ] **Tools API (Functions) โ†’ Claude** - [ ] **System Prompts โ†’ Claude** - [ ] Tests utilisateur finaux --- ## 11. Avantages de cette architecture | Critรจre | Venv unique | VM + Docker Compose | |---|---|---| | Isolation dรฉpendances | โš ๏ธ Partielle | โœ… Totale | | Conflits de versions | โŒ Frรฉquents | โœ… Impossibles | | Mise ร  jour d'un modรจle | โŒ Risquรฉ | โœ… Indรฉpendante | | Un service plante | โŒ Tout plante | โœ… Les autres continuent | | Maintenabilitรฉ | โŒ Difficile | โœ… Simple | | Coรปt Vast.ai | โœ… Une instance | โœ… Une VM |