# /v1/embeddings and /v1/rerank
transformers>=4.35.0
sentence-transformers>=2.7.0
# NOT optional, and its absence does not look like a missing dependency.
# sentence-transformers loads under a `device_map`/`torch.device` context, and
# transformers refuses that without accelerate -- so the pod boots healthy,
# answers /v1/models, and then fails EVERY embedding request with
#   Model 'BAAI/bge-m3' failed to load: Using a `device_map` ... requires `accelerate`
# which reads as a model problem rather than an image problem. Measured on a
# real A40: 303s of boot paid before anyone could find out.
accelerate>=0.26.0
geoclip>=1.2.0
geopy>=2.4
geographiclib>=2.0

# DINOv2-SALAD and the VPR embedders need pytorch_lightning. The local install
# keeps them in a venv (`/cache/salad-venv`) because of an old conflict; both
# import cleanly on torch 2.11 now, so a pod carries them directly and place
# recognition works without one.
pytorch_lightning>=2.0.0
pytorch_metric_learning>=2.0.0

# ---------------------------------------------------------------------------
# bge-m3 MULTI-VECTOR (dense + sparse + colbert) runs HERE, and only here.
#
# Hybrid retrieval wants dense AND sparse from one pass. Those extra vectors
# come from linear heads (sparse_linear.pt / colbert_linear.pt) applied to the
# last hidden state -- a transformers forward pass, not an embedding server's
# output.
# So:
#
#   * THIS image serves them. It is FULL core, so torch and transformers are in
#     the main venv, and codai/api/embeddings._is_bge_m3() picks the native
#     multi-vector backend automatically from the presence of sparse_linear.pt
#     in the repo. Nothing to configure.
#
#   * `coderai-vllm` CANNOT, and not for want of a setting: it is a LIGHT-core
#     image with no torch in its main venv by design, so _load_bge_m3 cannot
#     even import. vLLM serves embeddings dense only. Asking that pod for
#     sparse now returns a 400 naming this, rather than a normal-looking
#     dense-only response that quietly halves a hybrid search.
#
# transformers is already pinned above for exactly this (and the heads are plain
# Linear layers, so FlagEmbedding -- which pins older transformers/peft -- is
# deliberately NOT a dependency).
