# FastAPI and server dependencies
fastapi>=0.104.0
uvicorn[standard]>=0.24.0
pydantic>=2.5.0

# CLI dependencies
requests>=2.31.0  # for the coder CLI tool
python-multipart>=0.0.6  # for multipart form data parsing

# PyTorch - Uncomment the appropriate version for your system.
# IMPORTANT: Use quotes around version specifiers to prevent shell interpretation!
# The >= operator will be interpreted as output redirection without quotes!
#
# Option 1: Use exact versions (recommended for requirements.txt)
# Option 2: Use quotes: pip install "torch>=2.0.0"

# For NVIDIA (CUDA):
# torch==2.0.0
# torchvision==0.15.0
# torchaudio==2.0.0

# For AMD (ROCm) - see available versions at https://pytorch.org/get-started/locally/
# rocm6.0 is recommended for newer AMD GPUs, rocm5.6 for older ones
# --index-url https://download.pytorch.org/whl/rocm6.0
# torch==2.0.0
# torchvision==0.15.0
# torchaudio==2.0.0

# For CPU only:
torch>=2.5.0
torchvision
torchaudio

# ML dependencies
transformers>=4.35.0
accelerate>=0.24.0
diffusers>=0.25.0  # For Stable Diffusion image generation
safetensors>=0.4.0  # Required by diffusers
# stable-diffusion-cpp-python is installed by build.sh with CMAKE_ARGS to fix the libwebm submodule issue

# System resource detection
psutil>=5.9.0
setproctitle>=1.1  # Process naming (replaces procname, Python 3.13 compatible)

# Optional: Audio transcription dependencies
faster-whisper>=0.10.0  # For NVIDIA/CUDA whisper transcription
whispercpp>=0.0.17  # Alternative whisper library (works without PyTorch)

# LiteLLM for standardized API responses
litellm>=1.40.0

# Image/video processing utilities
Pillow>=10.0.0
numpy>=1.24.0
imageio[ffmpeg]>=2.33.0       # frame I/O + ffmpeg bridge for video generation
scipy>=1.11.0                  # audio/signal processing (wav export in audio_gen)

# Embeddings
sentence-transformers>=2.7.0  # /v1/embeddings with sentence-transformer models

# Video/audio post-processing (all optional – features degrade gracefully if absent)
openai-whisper>=20231117       # subtitle generation via Whisper transcription
argostranslate>=1.9.0          # subtitle translation
edge-tts>=6.1.9                # TTS for video dubbing (primary)
kokoro-tts>=0.9.0              # TTS for video dubbing (fallback)
soundfile>=0.12.0              # audio file I/O for kokoro TTS output

# Image upscaling / restoration
realesrgan>=0.3.0              # Real-ESRGAN upscaler
basicsr>=1.4.2                 # backbone required by realesrgan
timm>=0.9.0                    # vision model backbones (depth/segment endpoints)

# Audio generation (optional – only needed for /v1/audio/generate)
# audiocraft is Meta's MusicGen/AudioGen library; install separately if desired:
#   pip install audiocraft
# AudioLDM2 is available via diffusers (already listed above)

# Voice cloning (F5-TTS zero-shot voice cloning)
f5-tts>=1.1.0

# Voice conversion / singing voice conversion (Seed-VC — preserves pitch/melody)
seed-vc>=0.4.0

# Audio ML separation / restoration
# Demucs provides real source separation for vocals/instrumental and multi-stem workflows.
demucs>=4.0.1
# DeepFilterNet provides learned denoise/restoration for higher-quality cleanup than ffmpeg-only filters.
deepfilternet>=0.5.6
# Optional alternate restoration backends.
rnnoise>=0.2.1
voicefixer>=0.1.3

# Face swap (insightface INSwapper — downloads inswapper_128.onnx on first use)
insightface>=0.7.3
onnxruntime-gpu>=1.20.0        # GPU-accelerated ONNX runtime for insightface

# Optional: for better performance
# bitsandbytes>=0.41.0  # for 4-bit/8-bit quantization
# sentencepiece>=0.1.99  # for some tokenizers
# protobuf>=3.20.0  # for some models

# Optional: Flash Attention 2 for faster inference on supported GPUs
# Requires specific CUDA/ROCm versions and may need manual installation
# Install with: pip install flash-attn --no-build-isolation
# flash-attn>=2.5.0

# Installation instructions:
# IMPORTANT: Always use quotes or exact versions to avoid shell redirection issues!
#
# 1. For NVIDIA GPUs (CUDA 12.1):
#    pip install torch torchvision torchaudio
#
# 2. For AMD GPUs (ROCm 6.0 recommended):
#    pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/rocm6.0
#
# 3. For CPU only:
#    pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
#
# If you see "No such file or directory: '0.0'" errors, you forgot to use quotes!
# The shell interprets >= as redirection. Fix: pip install "torch>=2.0.0" (with quotes)
