# /v1/ocr
#
# docTR, in this venv. The image used to install NO OCR engine at all — only
# transformers and pypdfium2 — so an OCR pod could boot, pass its health check,
# accept a request and then have nothing to do it with. Three separate gates
# (subsystem enabled, engine enabled, licence accepted) reported their own
# refusal first, which hid the real problem for three rounds.
#
# docTR and not the others, because it is the only one that runs IN-PROCESS:
# Surya caps pillow<11 and lives in an isolated venv by design, and paddle wants
# paddlepaddle in one of its own. Either would mean a second torch in the image
# — 6 GB to avoid a Pillow conflict. Surya remains available on a local install,
# and can be baked in later with the <profile>.venv-<name>.txt mechanism if a
# pod ever needs its layout quality.
transformers>=4.35.0
pypdfium2>=4.20.0
python-doctr>=0.8.0
ultralytics>=8.1.0
jsonschema>=4.0.0

# Surya too, in THIS venv. Its isolated venv exists because Surya used to cap
# pillow<11 against a main venv on pillow>=12 — no longer true at 0.17.1, which
# imports beside docTR on torch 2.11 with pillow 10.4 and transformers 5.17.
# Verified before adding, because that venv decision was inherited rather than
# re-checked, exactly like audiocraft's torch==2.1.0.
#
# SuryaEngine still runs as a subprocess (it is a SubprocessOcrEngine), so the
# pod points ocr.surya_venv at this interpreter rather than building one.
# surya-ocr is NOT here: it caps pillow<11 against coderai's pillow>=12, and the
# engine runs it in an isolated venv subprocess anyway. See ocr.venv-surya.txt.

# olmOCR-2 needs NOTHING here. It is a document VLM, not a library: it imports only
# PIL and requests, and reaches its model one of three ways — coderai's own model
# manager ("model"), coderai's vLLM engine ("vllm"), or any OpenAI-compatible
# endpoint ("server"). A pod has no vLLM of its own and will not get one: that venv
# is ~10.5 GB against a ~12 GB image ceiling, and it would be a second torch beside
# the one docTR and Surya already need here. So on a pod olmOCR runs in "server"
# mode against an endpoint the renting install configures — a vLLM pod, for
# instance. runpod_worker seeds olmocr_serve/olmocr_server_url when they are set and
# falls back to docTR only when they are not.
