# Core web framework
fastapi>=0.104.0
uvicorn[standard]>=0.24.0
pydantic>=2.0.0
pydantic-settings>=2.0.0
python-multipart>=0.0.6

# ML/Training frameworks
# IMPORTANT: torch, torchvision, torchaudio, and xformers are NOT listed here.
# GPU environments (RunPod, Colab, Lambda, etc.) ship pre-installed CUDA-matched
# builds. Pip will silently replace them with generic PyPI builds that break
# torchvision. Use whatever torch is pre-installed, or install manually first:
#   pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu128
# Requires torch >= 2.5.0 (for transformers 5.x compatibility).
# torchvision IS required for VLM training (image processors need it) — make sure
# your pre-installed torch stack includes a matching torchvision build.
transformers>=5.0.0
# Fused kernels for hybrid linear-attention models (Qwen3.5/3.6/3.8). Pure Python
# plus Triton, so it installs anywhere. Its partner causal_conv1d needs nvcc and is
# built as a wheel in the Dockerfile's first stage — transformers requires BOTH
# before it will use the fused path, so this alone changes nothing.
flash-linear-attention>=0.5.0
accelerate>=0.24.0
# Grimoire RL training engine. Published as `grimoire-rl` on PyPI; import
# name stays `grimoire`. 1.2.0 added the APIs Merlina depends on.
grimoire-rl>=1.2.0
# ArtemisVLM model classes (Project Artemis); only loaded when training_mode
# starts with "vlm_". Published as `artemis-vlm` on PyPI.
artemis-vlm>=0.1.2
# Diffusion training engine (sister project to grimoire). Drives the
# 'diffusion' model_type path via src/training_runner_diffusion.py.
# Published as `atelier-diffusion` on PyPI; import name stays `atelier`.
# 0.1.1 surfaces DoRA via peft.use_dora (Merlina UI checkbox at
# diffusion-lora-use-dora — see PR #84).
atelier-diffusion>=0.1.1
diffusers>=0.34.0   # required by atelier (Qwen-Image pipelines need >=0.34)
peft>=0.6.0
bitsandbytes>=0.41.0
datasets>=2.14.0

# Utilities
wandb>=0.15.0
huggingface-hub>=0.19.0
sentencepiece>=0.1.99
protobuf>=3.20.0
scipy>=1.10.0
einops>=0.7.0
Pillow>=10.0.0    # Required for VLM image processors (Qwen-VL, LLaVA, etc.)
# Generates the shareable config QR image (merlina_config.png). Pure-Python,
# depends only on Pillow (already required above). Decoding the embedded QR is
# optional (uses OpenCV when present); the PNG-metadata channel needs only
# Pillow, so QR decoding is never a hard requirement.
qrcode>=7.4.2

# MCP server (mcp_server.py / `merlina-mcp`) — optional. Exposes the Merlina
# REST API as Model Context Protocol tools. Thin HTTP client, no torch needed.
# Install with `pip install 'merlina[mcp]'` or uncomment below.
#   mcp[cli]>=1.2.0
#   httpx>=0.24.0

# Optional but recommended
# xformers is tightly coupled to torch+CUDA. Install manually after torch:
#   pip install xformers
ninja>=1.11.0     # For faster builds
packaging>=23.0   # Version handling
pynvml>=11.5.0    # For detailed GPU monitoring