# FastAPI and server dependencies
fastapi>=0.104.0
uvicorn[standard]>=0.24.0
pydantic>=2.5.0
python-multipart>=0.0.6  # for multipart form data parsing
requests>=2.31.0  # for HTTP requests

# ML dependencies (transformers-based for NVIDIA/CUDA)
transformers>=4.35.0
accelerate>=0.24.0

# System resource detection
psutil>=5.9.0
# procname>=0.3.0  # optional - uncomment to set process name (requires libproc2-dev)
# Context-free GPU memory query (provides `pynvml`). Lets engines report VRAM via
# NVML without creating a CUDA primary context — so an engine that never loads a
# torch model (the GGUF/llama.cpp engine) stays at 0 MiB while idle instead of
# pinning ~256 MiB. Falls back to `nvidia-smi` when absent.
nvidia-ml-py>=12.0.0

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

# Image/video/audio 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
sentence-transformers>=2.7.0  # /v1/embeddings
argostranslate>=1.9.0          # subtitle translation
edge-tts>=6.1.9                # TTS dubbing (primary)
kokoro-tts>=0.9.0              # TTS dubbing (fallback)
soundfile>=0.12.0
realesrgan>=0.3.0
basicsr>=1.4.2
timm>=0.9.0

# 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 is the primary high-quality separator backend.
demucs>=4.0.1
# DeepFilterNet is the primary learned cleanup/restoration backend.
deepfilternet>=0.5.6
# Optional alternates.
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 with NVIDIA GPUs
bitsandbytes>=0.41.0
sentencepiece>=0.1.99
tiktoken>=0.5.0
tokenizers>=0.15.0
protobuf>=3.20.0

# Optional: fast-kernel 4-bit quantization (GPTQ/AWQ via Marlin/ExLlama).
# Much faster than bitsandbytes NF4, especially for MoE models. coderai uses this
# for the per-model `quant_backend` (auto|bnb|gptq|awq) and the on-demand
# "Quantize to 4-bit" button on the model admin page. The feature auto-detects
# GPTQModel and falls back to bitsandbytes when it (or its kernels) are absent.
#
# On bleeding-edge stacks (e.g. CUDA 13 + torch 2.11) install the LATEST from
# source for new-arch support (e.g. gemma-4 MoE). GPTQModel 7.x is a pure-Python
# wheel (no CUDA compile) but pins numpy==2.2.6 in its metadata; do NOT let that
# downgrade a newer numpy your stack needs — install with the deps below and a
# numpy constraint, e.g.:
#   pip install --no-deps "git+https://github.com/ModelCloud/GPTQModel.git"
#   pip install -c <(echo "numpy==<your-version>") \
#       torchao device-smi tokenicer logbar pypcre defuser maturin
# gptqmodel>=7.1.0
# torchao>=0.16.0

# llama-cpp-python with CUDA support (for GGUF files on CUDA backend)
llama-cpp-python>=0.2.0

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

# Optional: fast path for linear attention models (RWKV, Mamba, etc.)
causal-conv1d
# flash-linear-attention requires CUDA and must be installed from source:
# pip install git+https://github.com/fla-org/flash-linear-attention --no-build-isolation
