99 lines
3.3 KiB
YAML
99 lines
3.3 KiB
YAML
# docker-compose.yml – Hermes Agent + vLLM (Qwen3-14B-AWQ)
|
||
# Host: Cortex (eigenständiger Server, 2x RTX 3060 12GB)
|
||
#
|
||
# Beide Services laufen im selben Docker-Netz "cortex-net" auf diesem Host.
|
||
# Hermes spricht vLLM intern über http://vllm:8000/v1 an – kein extra
|
||
# Netzwerk-Routing nötig, alles lokal auf Cortex.
|
||
#
|
||
services:
|
||
vllm:
|
||
image: vllm/vllm-openai:latest
|
||
container_name: cortex-vllm
|
||
restart: unless-stopped
|
||
runtime: nvidia
|
||
ipc: host
|
||
ports:
|
||
- "8005:8000"
|
||
environment:
|
||
- NVIDIA_VISIBLE_DEVICES=0,1
|
||
- HUGGING_FACE_HUB_TOKEN=${HF_TOKEN:-}
|
||
# Reduziert Fragmentierung im CUDA-Allocator – hilft bei knappem VRAM
|
||
- PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True
|
||
volumes:
|
||
- ${HOME:-/root}/.cache/huggingface:/root/.cache/huggingface
|
||
deploy:
|
||
resources:
|
||
reservations:
|
||
devices:
|
||
- driver: nvidia
|
||
count: 2
|
||
capabilities: [gpu]
|
||
command:
|
||
- --model=Qwen/Qwen3-14B-AWQ
|
||
- --quantization=awq
|
||
- --tensor-parallel-size=2
|
||
# Von 0.90 auf 0.82 gesenkt: lässt Platz für CUDA-Graph-Pools
|
||
# und NCCL all_reduce Buffer, die zusätzlich zum KV-Cache-Pool anfallen
|
||
- --gpu-memory-utilization=0.82
|
||
# 32768 ist die native Context-Länge von Qwen3-14B – YaRN entfernt,
|
||
# da hier gar keine Erweiterung über die native Länge hinaus stattfindet
|
||
- --max-model-len=32768
|
||
# Begrenzt parallele Sequenzen -> kleinerer KV-Cache-Bedarf,
|
||
# wichtig bei nur 12GB pro GPU. Bei Bedarf hochsetzen, wenn stabil.
|
||
- --max-num-seqs=16
|
||
# FP8 KV-Cache spart ca. 50% Speicher gegenüber FP16 bei minimalem
|
||
# Qualitätsverlust – gerade bei 32k Context relevant
|
||
- --kv-cache-dtype=fp8
|
||
- --served-model-name=qwen3-14b-awq
|
||
healthcheck:
|
||
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
|
||
interval: 30s
|
||
timeout: 10s
|
||
retries: 5
|
||
start_period: 180s
|
||
networks:
|
||
- cortex-net
|
||
hermes-gateway:
|
||
image: nousresearch/hermes-agent:latest
|
||
container_name: cortex-hermes-gateway
|
||
restart: unless-stopped
|
||
depends_on:
|
||
vllm:
|
||
condition: service_healthy
|
||
command: ["gateway", "run"]
|
||
shm_size: 1g
|
||
ports:
|
||
- "8642:8642"
|
||
volumes:
|
||
- ${HOME:-/root}/.hermes:/opt/data
|
||
environment:
|
||
- HERMES_UID=${HERMES_UID:-10000}
|
||
- HERMES_GID=${HERMES_GID:-10000}
|
||
# Zeigt Hermes auf den lokalen vLLM-Server
|
||
- OPENAI_BASE_URL=http://vllm:8000/v1
|
||
- OPENAI_API_KEY=dummy
|
||
# Gateway-API nur aktivieren, wenn du sie extern brauchst:
|
||
# - API_SERVER_HOST=0.0.0.0
|
||
# - API_SERVER_KEY=${API_SERVER_KEY}
|
||
networks:
|
||
- cortex-net
|
||
hermes-dashboard:
|
||
image: nousresearch/hermes-agent:latest
|
||
container_name: cortex-hermes-dashboard
|
||
restart: unless-stopped
|
||
depends_on:
|
||
- hermes-gateway
|
||
command: ["dashboard", "--host", "0.0.0.0", "--no-open"]
|
||
ports:
|
||
- "127.0.0.1:9119:9119" # nur lokal auf Cortex, kein LAN-Expose
|
||
volumes:
|
||
- ${HOME:-/root}/.hermes:/opt/data
|
||
environment:
|
||
- HERMES_UID=${HERMES_UID:-10000}
|
||
- HERMES_GID=${HERMES_GID:-10000}
|
||
- GATEWAY_HEALTH_URL=http://cortex-hermes-gateway:8642
|
||
networks:
|
||
- cortex-net
|
||
networks:
|
||
cortex-net:
|
||
driver: bridge |