Files
Effi/docker-compose.litellm.yml
T

89 lines
4.5 KiB
YAML

# ═══════════════════════════════════════════════════════════
# OVERRIDE litellm — Ajoute LiteLLM + jean-proxy a la stack Effi
# + configure open-webui pour parler a LiteLLM en mode OpenAI API
#
# Usage (depuis /home/effi/effi sur serveur Effi) :
# docker compose -f docker-compose.yml -f docker-compose.litellm.yml up -d --build
#
# IMPORTANT : cet override modifie open-webui (ajoute OPENAI_API_BASE_URL +
# OPENAI_API_KEY + remet OLLAMA_BASE_URL sur le wol-proxy originel :3011).
# open-webui sera recree a la prochaine 'up --force-recreate' pour propager.
# LiteLLM expose l'API OpenAI (/v1/*), pas l'API Ollama (/api/*) — donc
# open-webui DOIT etre configure via la section "OpenAI API" (admin UI)
# et non via la section "Ollama".
# ═══════════════════════════════════════════════════════════
services:
# ─────────────────────────────────────────────────────────
# open-webui — repointe vers jean-router (API OpenAI directe)
# jean-router expose dynamiquement les presets Jean + modèles Ollama
# Plus besoin de LiteLLM, routing direct vers jean-router:3014
# ─────────────────────────────────────────────────────────
open-webui:
environment:
- OLLAMA_BASE_URL=http://host.docker.internal:3011
- OPENAI_API_BASE_URL=http://host.docker.internal:3014/v1
- OPENAI_API_KEY=any
- ENABLE_OPENAI_API=True
# ─────────────────────────────────────────────────────────
# jean-proxy — Reverse-proxy vers JeanOrchestrator (.11:8080) + WOL
# L'orchestrateur gere le switch auto MoE/27B.
# Ecoute :3012 sur le host (network_mode: host)
# ─────────────────────────────────────────────────────────
jean-proxy:
build: ./jean-proxy
container_name: jean-proxy
restart: unless-stopped
network_mode: host
environment:
- TARGET_HOST=${OLLAMA_HOST}
- TARGET_PORT=8080
- TARGET_MAC=${PC_GAMING_MAC}
- LISTEN_PORT=3012
- WAKE_TIMEOUT=60
- CHECK_INTERVAL=5
- BROADCAST_IP=${BROADCAST_IP}
- HEALTH_PATH=/health
# ─────────────────────────────────────────────────────────
# jean-router — Proxy dynamique qui interroge Jean pour
# lister les presets et route les requêtes vers Jean
# ou Ollama selon le modèle demandé.
# Ecoute :3014 sur le host (network_mode: host)
# ─────────────────────────────────────────────────────────
jean-router:
build: ./jean-router
container_name: jean-router
restart: unless-stopped
network_mode: host
environment:
- JEAN_WEB_HOST=${OLLAMA_HOST}
- JEAN_WEB_PORT=8090
- JEAN_PROXY_HOST=localhost
- JEAN_PROXY_PORT=3012
- OLLAMA_PROXY_HOST=localhost
- OLLAMA_PROXY_PORT=3011
- ENABLE_OLLAMA=true
- LISTEN_PORT=3014
- SWITCH_TIMEOUT=90
- CHECK_INTERVAL=2
# ─────────────────────────────────────────────────────────
# 2. LiteLLM proxy — Endpoint OpenAI unique pour open-webui
# Ecoute :4000 sur le host (network_mode: host pour joindre
# wol-proxy :3011 et jean-proxy :3012 sur le host)
# ─────────────────────────────────────────────────────────
litellm:
image: ghcr.io/berriai/litellm:main-stable
container_name: litellm
restart: unless-stopped
network_mode: host
volumes:
- ./litellm/config.yaml:/app/config.yaml:ro
command:
- "--config=/app/config.yaml"
- "--port=4000"
- "--num_workers=1"