From f9ae1c9b3a2787f3d0e9bab19fb5570f8fd995da Mon Sep 17 00:00:00 2001 From: Vadym Samoilenko Date: Thu, 19 Mar 2026 19:57:08 +0000 Subject: [PATCH] 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 --- backend/pyproject.toml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/backend/pyproject.toml b/backend/pyproject.toml index d9aaeac..d66017c 100644 --- a/backend/pyproject.toml +++ b/backend/pyproject.toml @@ -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*"]