95 lines
2.7 KiB
YAML
95 lines
2.7 KiB
YAML
# Audio Module - Docker Compose Configuration
|
|
#
|
|
# Port Allocation (Dev AI Audio: 54300):
|
|
# 54300 - Audio API (Whisper STT service)
|
|
#
|
|
# Profiles:
|
|
# api - API server only
|
|
#
|
|
# Required environment variables (set in deploy/.env file):
|
|
# AUDIO_MODEL - Whisper model name (e.g., large-v3-turbo)
|
|
# AUDIO_DEVICE - Device: cuda or cpu
|
|
# AUDIO_COMPUTE_TYPE - Compute type: int8, float16, int8_float16
|
|
# AUDIO_CACHE_DIR - Model cache directory
|
|
#
|
|
# GPU Configuration:
|
|
# - Runs on GPU 0 (shared with Qwen3.5-35B-A3B)
|
|
# - Requires ~6GB VRAM for large-v3-turbo with int8
|
|
#
|
|
# Naming Convention: didiAI-{module}-{service}
|
|
#
|
|
# Network:
|
|
# Uses the external didi-network bridge (shared with other AI modules)
|
|
|
|
networks:
|
|
didi-network:
|
|
external: true
|
|
|
|
services:
|
|
# ==========================================================================
|
|
# Audio Transcription API Server
|
|
# ==========================================================================
|
|
audio-api:
|
|
container_name: didiAI-audio
|
|
image: didiai-audio:audit
|
|
build:
|
|
context: ..
|
|
dockerfile: deploy/Dockerfile
|
|
|
|
ports:
|
|
- "54300:54300"
|
|
networks:
|
|
- didi-network
|
|
|
|
environment:
|
|
# GPU configuration
|
|
- CUDA_VISIBLE_DEVICES=0
|
|
|
|
# External URL for OpenAPI spec (REQUIRED)
|
|
- AUDIO_EXTERNAL_URL=${AUDIO_EXTERNAL_URL}
|
|
|
|
# Whisper model configuration
|
|
- AUDIO_MODEL=${AUDIO_MODEL:-large-v3-turbo}
|
|
- AUDIO_DEVICE=${AUDIO_DEVICE:-cuda}
|
|
- AUDIO_COMPUTE_TYPE=${AUDIO_COMPUTE_TYPE:-int8}
|
|
- AUDIO_CACHE_DIR=${AUDIO_CACHE_DIR:-/root/.cache/huggingface}
|
|
|
|
# Transcription settings
|
|
- AUDIO_BEAM_SIZE=${AUDIO_BEAM_SIZE:-5}
|
|
- AUDIO_BEST_OF=${AUDIO_BEST_OF:-5}
|
|
- AUDIO_TEMPERATURE=${AUDIO_TEMPERATURE:-0.0}
|
|
|
|
# Server settings
|
|
- AUDIO_HOST=0.0.0.0
|
|
- AUDIO_PORT=54300
|
|
- AUDIO_LOG_LEVEL=${AUDIO_LOG_LEVEL:-INFO}
|
|
|
|
# Runtime config polling
|
|
- AUDIO_DASHBOARD_URL=${AUDIO_DASHBOARD_URL:-http://didiAI-dashboard:51300}
|
|
|
|
# Upload limits
|
|
- AUDIO_MAX_FILE_SIZE_MB=${AUDIO_MAX_FILE_SIZE_MB:-500}
|
|
|
|
volumes:
|
|
# Model cache (shared with other modules)
|
|
- ${AUDIO_CACHE_DIR:-/root/.cache/huggingface}:/root/.cache/huggingface
|
|
|
|
deploy:
|
|
resources:
|
|
reservations:
|
|
devices:
|
|
- driver: nvidia
|
|
device_ids: ['0']
|
|
capabilities: [gpu]
|
|
|
|
healthcheck:
|
|
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:54300/health')"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 60s
|
|
|
|
restart: unless-stopped
|
|
profiles:
|
|
- api
|
|
|