feat(whisper): add CUDA Blackwell server, promote to primary on :18801

Adds a custom whisper.cpp Docker image built with CMAKE_CUDA_ARCHITECTURES=120
so it actually initializes on the RTX 5070 Ti — the upstream
ghcr.io/ggml-org/whisper.cpp:main-cuda only ships kernels for sm_75/80/86/90.

Compose changes:
- New whisper-init one-shot service downloads ggml-medium.bin and ggml-small.bin
  into the shared volume on first run, fixing the original crash where
  whisper-server tried to load a model that was never fetched.
- New whisper-server-gpu service (image whisper.cpp:cuda-blackwell, built
  locally from ./whisper-cuda-blackwell/Dockerfile) on port 18801 — the
  benchmarked path (~150 ms per short clip, ~93x faster than CPU/medium with
  identical WER on JFK + 4 TTS samples).
- Existing whisper-server (CPU/medium) moves to port 18811 as the fallback
  for when GPU is unavailable. Container names unchanged so monitoring and
  volume bindings keep working.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
William Valentin
2026-04-30 01:12:58 -07:00
parent f0c84a8f05
commit 50f2640846
2 changed files with 190 additions and 9 deletions
+99 -9
View File
@@ -30,31 +30,121 @@ services:
# start_period: 15s
# retries: 3
# Optional local dependency: whisper.cpp server for audio transcription.
# Start with: docker compose --profile voice up -d whisper-server
whisper-server:
image: ghcr.io/ggml-org/whisper.cpp@sha256:3a39e86d5a0e911086b5cbebc9029cac71b02fbd08e217b775857de1490f55bf
container_name: whisper-server
# One-shot init: download whisper models into the shared volume if missing.
# The base image only ships ggml-base.en.bin; the servers below require:
# - ggml-medium.bin for the CPU server
# - ggml-small.bin for the GPU server (small fits in the limited VRAM left after gemma)
whisper-init:
image: ghcr.io/ggml-org/whisper.cpp:main
container_name: whisper-init
profiles: ["voice"]
restart: "no"
volumes:
- whisper-models:/app/models
entrypoint: ["sh", "-c"]
command:
- |
set -e
for m in medium small; do
if [ -f /app/models/ggml-$$m.bin ]; then
echo "Model ggml-$$m.bin already present, skipping download."
else
echo "Downloading ggml-$$m.bin..."
sh /app/models/download-ggml-model.sh $$m /app/models
fi
done
# Primary whisper.cpp server: NVIDIA RTX 5070 Ti via CUDA (Blackwell sm_120).
# Uses ggml-small.bin (~850 MiB VRAM) — fits alongside gemma 3 12b which runs
# with `--parallel 1` (frees ~900 MiB of VRAM). Benchmarked at ~150 ms per
# short clip, ~93x faster than the CPU server below with identical WER.
#
# The official `ghcr.io/ggml-org/whisper.cpp:main-cuda` ships kernels only
# for sm_75/80/86/90 and fails to init CUDA on Blackwell. We build a custom
# image with `CMAKE_CUDA_ARCHITECTURES=120` from the local Dockerfile.
# Build manually with: docker build -t whisper.cpp:cuda-blackwell ./whisper-cuda-blackwell
# Or `docker compose --profile voice build whisper-server-gpu`.
whisper-server-gpu:
image: whisper.cpp:cuda-blackwell
build:
context: ./whisper-cuda-blackwell
dockerfile: Dockerfile
container_name: whisper-server-gpu
restart: unless-stopped
profiles: ["voice"]
ports:
- "18801:8080"
volumes:
- whisper-models:/app/models
# Override image entrypoint so args are passed directly to whisper-server.
entrypoint: ["whisper-server"]
command:
- --model
- /app/models/ggml-base.en.bin
- /app/models/ggml-small.bin
- --host
- 0.0.0.0
- --port
- "8080"
- --convert
- --language
- en
- auto
- --inference-path
- /v1/audio/transcriptions
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
depends_on:
whisper-init:
condition: service_completed_successfully
healthcheck:
test:
[
"CMD-SHELL",
"curl -f http://localhost:8080/ >/dev/null 2>&1 || exit 1",
]
interval: 30s
timeout: 5s
start_period: 30s
retries: 3
labels:
agentmon.monitor: "true"
agentmon.role: "voice"
agentmon.port: "18801"
# Fallback whisper.cpp server: CPU-only, medium model.
# Kept around for resilience — runs if the GPU server is down (driver issue,
# gemma takes all VRAM, custom image broken, etc.). Uses no GPU resources.
# ~14 s per short clip (medium-on-CPU is 90x slower than small-on-GPU above).
# Start with: docker compose --profile voice up -d whisper-server
whisper-server:
image: ghcr.io/ggml-org/whisper.cpp:main
container_name: whisper-server
restart: unless-stopped
profiles: ["voice"]
ports:
- "18811:8080"
volumes:
- whisper-models:/app/models
# Override image entrypoint so args are passed directly to whisper-server.
entrypoint: ["whisper-server"]
command:
- --model
- /app/models/ggml-medium.bin
- --host
- 0.0.0.0
- --port
- "8080"
- --convert
- --language
- auto
- --inference-path
- /v1/audio/transcriptions
depends_on:
whisper-init:
condition: service_completed_successfully
healthcheck:
test:
[
@@ -68,7 +158,7 @@ services:
labels:
agentmon.monitor: "true"
agentmon.role: "voice"
agentmon.port: "18801"
agentmon.port: "18811"
# kokoro TTS
kokoro-tts: