This commit is contained in:
2026-07-12 12:30:20 -05:00
parent 888c5c1543
commit 0989c06b8f
23 changed files with 3324 additions and 119 deletions

View File

@@ -1,47 +1,140 @@
# llama.cpp + Gemma-4-12B (Vision) auf CUDA (AWS G7e / RTX PRO 6000).
# llama-server für Qwen3.6 Vision — zwei Profile:
# docker compose --profile cuda up -d --build (EC2, RTX PRO 6000 Blackwell)
# docker compose --profile vulkan up -d --build (inhouse, Radeon AI Pro R9700)
#
# Bewusst SCHLANK gehalten: keine ROCm/Vulkan-Workarounds. Wir testen, ob
# CUDA die Instabilitaeten von vornherein vermeidet. Nur die inhaltlich noetigen
# Flags (--reasoning off gegen leeres content) bleiben.
# Modelle nach ./models legen (Haupt-GGUF + zugehöriger mmproj aus demselben Repo!):
# CUDA: unsloth/Qwen3.6-27B-GGUF → Qwen3.6-27B-UD-Q4_K_XL.gguf + mmproj-BF16.gguf
# Vulkan: unsloth/Qwen3.6-35B-A3B-GGUF → Qwen3.6-35B-A3B-UD-Q4_K_XL.gguf + mmproj-BF16.gguf
#
# Voraussetzung: DLAMI mit NVIDIA Container Toolkit (docker --gpus all funktioniert).
#
# Start: docker compose -f docker-compose-cuda.yml up -d
# Logs: docker compose -f docker-compose-cuda.yml logs -f
# Bewusst KEIN MTP: --mmproj + MTP ist laut Unsloth nicht unterstützt und hat
# offene OOM-/Hänger-Bugs (llama.cpp #23371, #23430). Für Batch-Extraktion
# irrelevant, da die Zeit im Image-Encoding steckt, nicht in der Generierung.
services:
llamacpp-gemma12b:
image: ghcr.io/ggml-org/llama.cpp:server-cuda
container_name: llamacpp-gemma12b
restart: unless-stopped
init: true
# GPU-Zugriff ueber das NVIDIA Container Toolkit
llama-cuda:
profiles: ["cuda"]
build:
context: .
dockerfile: Dockerfile.cuda
ports:
- "8000:8000"
volumes:
- ./models:/models
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
count: all
capabilities: [gpu]
ports:
- "8000:8080"
volumes:
- ~/.cache/llama.cpp:/root/.cache/llama.cpp
command:
- -hf
- unsloth/gemma-4-12b-it-GGUF:UD-Q4_K_XL
- -m
- /models/Qwen3.6-27B-UD-Q4_K_XL.gguf
- --mmproj
- /models/mmproj-BF16.gguf
- --host
- 0.0.0.0
- --port
- "8080"
- "8000"
- --alias
- qwen3.6
- -ngl
- "99"
- --ctx-size
- "16384"
- -fa
- "on"
- -c
- "32768"
- --parallel
- "1"
- --jinja
- --reasoning
- "off"
# Erlernte Stabilitäts-Settings (Vision + Checkpoints = OOM-Bug):
- --ctx-checkpoints
- "0"
# Qwen-VL braucht min. 1024 Image-Tokens für korrektes Grounding:
- --image-min-tokens
- "1024"
- --image-max-tokens
- "4096"
# Extraktion: niedrige Temperatur, kein Repeat-Penalty
- --temp
- "0.1"
- --top-p
- "0.95"
- --top-k
- "20"
- --repeat-penalty
- "1.0"
healthcheck:
test: ["CMD", "curl", "-sf", "http://localhost:8000/health"]
interval: 15s
timeout: 5s
retries: 40
start_period: 60s
restart: unless-stopped
llama-vulkan:
profiles: ["vulkan"]
build:
context: .
dockerfile: Dockerfile.vulkan
ports:
- "8000:8000"
volumes:
- ./models:/models
devices:
- /dev/dri:/dev/dri
- /dev/kfd:/dev/kfd
group_add:
- video
- render
security_opt:
- seccomp:unconfined
command:
- -m
- /models/Qwen3.6-35B-A3B-UD-Q4_K_XL.gguf
- --mmproj
- /models/mmproj-BF16.gguf
- --host
- 0.0.0.0
- --port
- "8000"
- --alias
- gemma-4-12b
- qwen3.6
- -ngl
- "99"
- -fa
- "on"
- -c
- "32768"
- --parallel
- "1"
# KV-Cache quantisieren — 32GB VRAM, 35B-A3B + mmproj + Bildkontext:
- -ctk
- q8_0
- -ctv
- q8_0
- --jinja
- --ctx-checkpoints
- "0"
- --image-min-tokens
- "1024"
- --image-max-tokens
- "4096"
- --temp
- "0.1"
- --top-p
- "0.95"
- --top-k
- "20"
- --repeat-penalty
- "1.0"
# NOTFALL-Fallback bei Vision-Hängern/OOM unter RADV — mmproj auf CPU,
# Bildverarbeitung wird DEUTLICH langsamer. Nur aktivieren wenn nötig:
# - --no-mmproj-offload
healthcheck:
test: ["CMD", "curl", "-sf", "http://localhost:8000/health"]
interval: 15s
timeout: 5s
retries: 40
start_period: 120s
restart: unless-stopped