# Video Analysis Module - Docker Compose Configuration # # Port Allocation (Dev AI Vision/Video: 54500-54600): # 54500 - vLLM BusterX (deepfake detection model) # 54600 - Video Analysis API # # Profiles: # api - API server only (requires external vLLM) # api-vllm - API + vLLM BusterX (GPU required) # # Required environment variables (set in deploy/.env file): # HF_TOKEN - Hugging Face token for model downloads # HF_CACHE_DIR - Cache directory for models # VIDEO_ANALYSIS_RUNS_DIR - Directory for analysis artifacts # # Naming Convention: didiAI-{module}-{service} # # Network: # Uses the external didi-network bridge (shared with other AI modules) networks: didi-network: external: true services: # ========================================================================== # vLLM Server - BusterX (Deepfake Detection Model) # ========================================================================== # Vision-language model for video deepfake detection # Runs on GPU 1 (Qwen3.5-35B-A3B uses GPU 0 via llm-inference module) # BusterX is based on Qwen2.5-VL-7B (~17GB VRAM with optimizations) vllm-buster: container_name: didiAI-video-vllm-buster image: vllm/vllm-openai:qwen3_5 ports: - "54500:54500" networks: - didi-network volumes: - ${HF_CACHE_DIR:-/cai2_ds_storage/hf_cache}:/root/.cache/huggingface environment: - HF_HOME=/root/.cache/huggingface - HUGGING_FACE_HUB_TOKEN=${HF_TOKEN} - CUDA_VISIBLE_DEVICES=1 command: > --model l8cv/BusterX_plusplus --host 0.0.0.0 --port 54500 --served-model-name busterx --tensor-parallel-size 1 --max-model-len 32768 --gpu-memory-utilization 0.25 --trust-remote-code --enable-prefix-caching --disable-log-requests deploy: resources: reservations: devices: - driver: nvidia device_ids: ['1'] capabilities: [gpu] healthcheck: test: ["CMD", "curl", "-f", "http://localhost:54500/health"] interval: 30s timeout: 10s retries: 10 start_period: 600s restart: unless-stopped profiles: - api-vllm # ========================================================================== # Video Analysis API Server # ========================================================================== video-analysis-api: container_name: didiAI-video-api image: didiai-video-api build: context: .. dockerfile: deploy/Dockerfile ports: - "54600:54600" networks: - didi-network environment: # Server settings - VIDEO_ANALYSIS_HOST=0.0.0.0 - VIDEO_ANALYSIS_PORT=54600 # External URL for OpenAPI spec (REQUIRED) - VIDEO_ANALYSIS_EXTERNAL_URL=${VIDEO_ANALYSIS_EXTERNAL_URL} # vLLM connection (points to vllm-buster container) - VIDEO_ANALYSIS_VLLM_BASE_URL=${VIDEO_ANALYSIS_VLLM_BASE_URL:-http://didiAI-video-vllm-buster:54500} - VIDEO_ANALYSIS_VLLM_MODEL=${VIDEO_ANALYSIS_VLLM_MODEL:-busterx} - VIDEO_ANALYSIS_RUNS_DIR=${VIDEO_ANALYSIS_RUNS_DIR:-/app/runs} # Optional tuning - VIDEO_ANALYSIS_FRAMES=${VIDEO_ANALYSIS_FRAMES:-16} - VIDEO_ANALYSIS_MAX_SIDE=${VIDEO_ANALYSIS_MAX_SIDE:-960} - VIDEO_ANALYSIS_JPEG_QUALITY=${VIDEO_ANALYSIS_JPEG_QUALITY:-85} - VIDEO_ANALYSIS_MAX_TOKENS=${VIDEO_ANALYSIS_MAX_TOKENS:-750} - VIDEO_ANALYSIS_TEMPERATURE=${VIDEO_ANALYSIS_TEMPERATURE:-0.000001} - VIDEO_ANALYSIS_REPETITION_PENALTY=${VIDEO_ANALYSIS_REPETITION_PENALTY:-1.05} # Runtime config polling - VIDEO_ANALYSIS_DASHBOARD_URL=${VIDEO_ANALYSIS_DASHBOARD_URL:-http://didiAI-dashboard:51300} # Semantic analysis settings - VIDEO_ANALYSIS_SEMANTIC_LLM_BASE_URL=${VIDEO_ANALYSIS_SEMANTIC_LLM_BASE_URL} - VIDEO_ANALYSIS_SEMANTIC_AGGREGATION_MODEL=${VIDEO_ANALYSIS_SEMANTIC_AGGREGATION_MODEL} - VIDEO_ANALYSIS_SEMANTIC_LLM_API_KEY=${VIDEO_ANALYSIS_SEMANTIC_LLM_API_KEY} volumes: # Persist artifacts on the host (module-root runs/ folder) - ../runs:/app/runs healthcheck: test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:54600/health')"] interval: 30s timeout: 10s retries: 3 start_period: 20s restart: unless-stopped profiles: - api - api-vllm