# Desktop inference sidecar dependencies.
#
# PLATFORM SPLIT (PEP 508 markers): the mlx* / torch stack is Apple-Silicon
# only — pip cannot resolve it on Windows or Linux, and an unmarked list made
# `pip install -r` fail there, which took the WHOLE sidecar down (no local
# transcription, no image gen, and the bundled acestep music runtime became
# unreachable because media_server never started).
#
# Cross-platform core + faster-whisper (CTranslate2) install everywhere; the
# Apple-only accelerated stack installs only where it exists.

# ── Cross-platform core ──────────────────────────────────────────────────────
fastapi>=0.136.0
uvicorn>=0.47.0
pydantic>=2.0.0
requests>=2.34.0
tqdm>=4.67.0
Jinja2>=3.1.0
pillow>=12.0.0
numpy>=2.0.0
huggingface_hub>=1.14.0

# ── Speech-to-text ───────────────────────────────────────────────────────────
# Tier 1 (default): NVIDIA Parakeet TDT 0.6B v3 via sherpa-onnx. ~600M params
# vs Whisper large-v3's 1.55B, and it runs on ONNX Runtime — one codepath for
# Windows/macOS/Linux, CPU by default (no CUDA bundle, see DirectML note in
# inference_server.py). Covers 25 European languages.
#   sherpa-onnx: Apache-2.0 · Parakeet TDT weights: CC-BY-4.0 (attribution
#   required — see LICENSES-MODELS.md).
sherpa-onnx>=1.10.0
soundfile>=0.12.1

# Tier 2 (fallback): Whisper for everything Parakeet does not cover — 99
# languages. faster-whisper (CTranslate2) is CPU/CUDA and works everywhere;
# on Apple Silicon mlx-whisper is preferred because CTranslate2 has NO Metal
# backend and would be stuck on CPU there.
faster-whisper>=1.1.0

# ── Apple Silicon only (Metal-accelerated) ───────────────────────────────────
mlx>=0.31.0 ; sys_platform == "darwin" and platform_machine == "arm64"
mlx-lm>=0.31.0 ; sys_platform == "darwin" and platform_machine == "arm64"
mlx-vlm>=0.5.0 ; sys_platform == "darwin" and platform_machine == "arm64"
mlx-tune>=0.4.0 ; sys_platform == "darwin" and platform_machine == "arm64"
mlx-whisper>=0.4.0 ; sys_platform == "darwin" and platform_machine == "arm64"

# transformers/torch back the mlx vision + tuning paths. Keeping them
# Apple-only avoids a multi-GB torch download on Windows/Linux, where the LLM
# runs through llama-server (llama.cpp) rather than torch.
transformers>=5.5.0 ; sys_platform == "darwin" and platform_machine == "arm64"
torch>=2.11.0 ; sys_platform == "darwin" and platform_machine == "arm64"
torchvision>=0.27.0 ; sys_platform == "darwin" and platform_machine == "arm64"
sentencepiece>=0.2.0 ; sys_platform == "darwin" and platform_machine == "arm64"
protobuf>=5.29.0 ; sys_platform == "darwin" and platform_machine == "arm64"
opencv-python>=4.13.0 ; sys_platform == "darwin" and platform_machine == "arm64"
datasets>=3.6.0 ; sys_platform == "darwin" and platform_machine == "arm64"
