Files
LLM-Server/docker-compose.yml
T
haylanandClaude-Bot 5cb34b19f3 Migrate Open WebUI and coding CLIs to the AI proxy (resolves #15)
Open WebUI now points at litellm instead of llama-server directly, using a
provisioned virtual key. llama-server's host port is dropped (internal-only
on the ai-stack network) since the proxy is the only intended entry point
now. docs/coding-cli-setup.md repointed at the proxy's endpoints/ports with
per-CLI virtual keys instead of the old shared dummy key.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-25 07:18:03 +02:00

132 lines
4.3 KiB
YAML

services:
llama-server:
image: ghcr.io/ggml-org/llama.cpp:server-rocm
container_name: llama-server
devices:
- /dev/kfd
- /dev/dri
group_add:
- video
- render
security_opt:
- seccomp=unconfined
ipc: host
volumes:
- models:/models
command: >
-m /models/${LLAMA_MODEL_FILE:-Qwen3.8-27B-UD-Q4_K_XL.gguf}
--host 0.0.0.0
--port 8080
--n-gpu-layers ${LLAMA_GPU_LAYERS:-999}
--ctx-size ${LLAMA_CTX_SIZE:-65536}
--jinja
# No published host port: llama-server is reached only via the litellm
# proxy on the ai-stack docker network now — see issue #15. Its
# unauthenticated API no longer needs to be LAN-reachable directly.
expose:
- "8080"
restart: unless-stopped
networks: [ai-stack]
labels:
# ponytail: idle-timeout tuning lives here, not in a separate lazytainer config file —
# one place to look. Raise LAZYTAINER_INACTIVE_TIMEOUT if 15 min proves too eager.
- "lazytainer.group.llamaserver.sleepMethod=stop"
- "lazytainer.group.llamaserver.ports=8080"
- "lazytainer.group.llamaserver.inactiveTimeout=${LAZYTAINER_INACTIVE_TIMEOUT:-900}"
- "lazytainer.group.llamaserver.minPacketThreshold=2"
# ponytail: one-off downloader, not a standing service — run via
# `docker compose --profile tools run --rm downloader` (see scripts/download-model.sh).
# Keeps the model file inside the named `models` volume instead of a host bind-mount.
downloader:
image: curlimages/curl:latest
profiles: ["tools"]
volumes:
- models:/models
entrypoint: ["sh", "-c"]
command:
- >
curl -L --fail --create-dirs -o /models/${LLAMA_MODEL_FILE:-Qwen3.8-27B-UD-Q4_K_XL.gguf}
https://huggingface.co/unsloth/Qwen3.8-27B-GGUF/resolve/main/${LLAMA_MODEL_FILE:-Qwen3.8-27B-UD-Q4_K_XL.gguf}
qdrant:
image: qdrant/qdrant:latest
container_name: qdrant
volumes:
- qdrant-data:/qdrant/storage
restart: unless-stopped
networks: [ai-stack]
open-webui:
image: ghcr.io/open-webui/open-webui:main
container_name: open-webui
depends_on:
- qdrant
- litellm
volumes:
- openwebui-data:/app/backend/data
environment:
- WEBUI_AUTH=True
# Routed through the litellm proxy, not llama-server directly — see issue #15.
# OPENAI_API_KEY must be a virtual key created for Open WebUI per
# docs/proxy-key-onboarding.md (name it "openwebui"), set in .env.
- OPENAI_API_BASE_URL=http://litellm:4000/v1
- OPENAI_API_KEY=${OPENWEBUI_LITELLM_KEY:?set to the openwebui virtual key from LiteLLM's Admin UI}
- VECTOR_DB=qdrant
- QDRANT_URI=http://qdrant:6333
ports:
- "${WEBUI_PORT:-3000}:8080"
restart: unless-stopped
networks: [ai-stack]
litellm:
image: ghcr.io/berriai/litellm:main-stable
container_name: litellm
depends_on:
- litellm-db
- llama-server
volumes:
- ./litellm-config.yaml:/app/config.yaml:ro
environment:
- LITELLM_MASTER_KEY=${LITELLM_MASTER_KEY:?set a real master key in .env — see docs/proxy-key-onboarding.md}
- LITELLM_SALT_KEY=${LITELLM_SALT_KEY:?set a real salt key in .env, do not change after first run}
- DATABASE_URL=postgresql://litellm:${LITELLM_DB_PASSWORD:-litellm}@litellm-db:5432/litellm
command: ["--config", "/app/config.yaml", "--port", "4000"]
ports:
# published for LAN access (proxy.ai.home) and, via NPM, proxy.ai.haylan.ch —
# NPM must deny the /ui path on the external host. See docs/network-access.md.
- "${LITELLM_PORT:-4000}:4000"
restart: unless-stopped
networks: [ai-stack]
litellm-db:
image: postgres:16-alpine
container_name: litellm-db
environment:
- POSTGRES_USER=litellm
- POSTGRES_PASSWORD=${LITELLM_DB_PASSWORD:-litellm}
- POSTGRES_DB=litellm
volumes:
- litellm-db-data:/var/lib/postgresql/data
restart: unless-stopped
networks: [ai-stack]
lazytainer:
image: ghcr.io/vmorganp/lazytainer:master
container_name: lazytainer
network_mode: host
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
restart: unless-stopped
depends_on:
- llama-server
networks:
ai-stack:
volumes:
models:
qdrant-data:
openwebui-data:
litellm-db-data: