composte-hermes.yml aktualisiert

This commit is contained in:
Marc Blatter 2026-07-22 07:22:34 +00:00
parent 48e4054c2e
commit 6dae3f11e7
1 changed files with 28 additions and 47 deletions

View File

@ -1,10 +1,7 @@
# docker-compose.yml Hermes Agent + vLLM (Qwen3-14B-AWQ) # docker-compose.yml Hermes Agent + vLLM (Qwen3-14B-AWQ)
# Host: Cortex (eigenständiger Server, 2x RTX 3060 12GB) # Host: Cortex (2x RTX 3060 12GB)
# # Daten liegen unter /opt/vllm und /opt/hermes (Sicherung/Backup)
# 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: services:
vllm: vllm:
image: vllm/vllm-openai:latest image: vllm/vllm-openai:latest
@ -16,11 +13,10 @@ services:
- "8005:8000" - "8005:8000"
environment: environment:
- NVIDIA_VISIBLE_DEVICES=0,1 - NVIDIA_VISIBLE_DEVICES=0,1
- HUGGING_FACE_HUB_TOKEN=${HF_TOKEN:-} - HUGGING_FACE_HUB_TOKEN=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
# Reduziert Fragmentierung im CUDA-Allocator hilft bei knappem VRAM
- PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True - PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True
volumes: volumes:
- ${HOME:-/root}/.cache/huggingface:/root/.cache/huggingface - /opt/vllm/huggingface:/root/.cache/huggingface
deploy: deploy:
resources: resources:
reservations: reservations:
@ -32,25 +28,13 @@ services:
- --model=Qwen/Qwen3-14B-AWQ - --model=Qwen/Qwen3-14B-AWQ
- --quantization=awq - --quantization=awq
- --tensor-parallel-size=2 - --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 - --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 - --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 - --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 - --kv-cache-dtype=fp8
- --served-model-name=qwen3-14b-awq - --served-model-name=qwen3-14b-awq
# Fehlten bisher: ohne diese beiden Flags lehnt vLLM jeden Request
# mit tool_choice="auto" ab ("auto tool choice requires ...")
- --enable-auto-tool-choice - --enable-auto-tool-choice
- --tool-call-parser=hermes - --tool-call-parser=hermes
# Trennt <think>-Reasoning-Content vom eigentlichen Tool-Call-Parsing,
# sonst kann der hermes-Parser bei aktiviertem Denk-Modus stolpern
- --reasoning-parser=deepseek_r1 - --reasoning-parser=deepseek_r1
healthcheck: healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"] test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
@ -60,47 +44,44 @@ services:
start_period: 180s start_period: 180s
networks: networks:
- cortex-net - cortex-net
hermes-gateway:
hermes-agent:
image: nousresearch/hermes-agent:latest image: nousresearch/hermes-agent:latest
container_name: cortex-hermes-gateway container_name: cortex-hermes-agent
restart: unless-stopped restart: unless-stopped
depends_on: depends_on:
vllm: vllm:
condition: service_healthy condition: service_healthy
command: ["gateway", "run"]
shm_size: 1g shm_size: 1g
ports: ports:
- "8642:8642" - "9119:9119" # Dashboard, jetzt im LAN erreichbar
- "8642:8642" # Gateway-API, im LAN erreichbar
volumes: volumes:
- ${HOME:-/root}/.hermes:/opt/data - /opt/hermes:/opt/data
environment: environment:
- HERMES_UID=${HERMES_UID:-10000} - HERMES_UID=${HERMES_UID:-10000}
- HERMES_GID=${HERMES_GID:-10000} - HERMES_GID=${HERMES_GID:-10000}
# Zeigt Hermes auf den lokalen vLLM-Server
- OPENAI_BASE_URL=http://vllm:8000/v1 - OPENAI_BASE_URL=http://vllm:8000/v1
- OPENAI_API_KEY=dummy - OPENAI_API_KEY=dummy
# Gateway-API nur aktivieren, wenn du sie extern brauchst: - GATEWAY_HEALTH_URL=http://localhost:8642
# - API_SERVER_HOST=0.0.0.0 entrypoint: ["/bin/sh", "-c"]
# - API_SERVER_KEY=${API_SERVER_KEY} command:
networks: - |
- cortex-net hermes-agent gateway run &
hermes-dashboard: GATEWAY_PID=$!
image: nousresearch/hermes-agent:latest until curl -sf http://localhost:8642 >/dev/null 2>&1; do sleep 1; done
container_name: cortex-hermes-dashboard hermes-agent dashboard --host 0.0.0.0 --no-open &
restart: unless-stopped DASHBOARD_PID=$!
depends_on: wait -n $GATEWAY_PID $DASHBOARD_PID
- hermes-gateway healthcheck:
command: ["dashboard", "--host", "0.0.0.0", "--no-open"] test: ["CMD", "curl", "-f", "http://localhost:8642"]
ports: interval: 30s
- "127.0.0.1:9119:9119" # nur lokal auf Cortex, kein LAN-Expose timeout: 10s
volumes: retries: 5
- ${HOME:-/root}/.hermes:/opt/data start_period: 60s
environment:
- HERMES_UID=${HERMES_UID:-10000}
- HERMES_GID=${HERMES_GID:-10000}
- GATEWAY_HEALTH_URL=http://cortex-hermes-gateway:8642
networks: networks:
- cortex-net - cortex-net
networks: networks:
cortex-net: cortex-net:
driver: bridge driver: bridge