Fix: force torch CPU-only build to avoid 5-8GB NVIDIA CUDA packages

Without [tool.uv.sources] binding torch to the pytorch-cpu index,
docling/layoutparser pull the full CUDA torch from PyPI, which includes
nvidia-nccl, nvidia-cusparselt, nvidia-cudnn etc (~5-8GB of GPU libs
useless on CPU-only servers). This caused "no space left on device"
during Docker layer extraction on the production server.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Vadym Samoilenko 2026-03-19 19:57:08 +00:00
parent 1fe15a1cec
commit f9ae1c9b3a

View file

@ -47,6 +47,11 @@ name = "pytorch-cpu"
url = "https://download.pytorch.org/whl/cpu"
explicit = true
[tool.uv.sources]
torch = { index = "pytorch-cpu" }
torchvision = { index = "pytorch-cpu" }
torchaudio = { index = "pytorch-cpu" }
[tool.setuptools.packages.find]
where = ["."]
include = ["api*", "enums*", "models*", "services*", "constants*", "utils*", "scripts*", "workers*", "migrations*"]