From a5556c475d93800117ecc0a05bed46d25b5aadd0 Mon Sep 17 00:00:00 2001 From: Josh Knapp Date: Fri, 26 Dec 2025 12:13:40 -0800 Subject: [PATCH] Fix uv index configuration: Use PyTorch CUDA as additional index - Changed from 'default' to named additional index - Added tool.uv.sources to specify torch comes from pytorch-cu121 index - Other packages (fastapi, uvicorn, etc.) still come from PyPI - Fixes: 'fastapi was not found in the package registry' error How it works: - PyPI remains the default index for most packages - torch package explicitly uses pytorch-cu121 index - Best of both worlds: CUDA PyTorch + all other packages from PyPI --- pyproject.toml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 5b26bdd..20cdab9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -57,11 +57,15 @@ dev = [ "pyinstaller>=6.17.0", ] -# Use PyTorch CUDA index by default +# Add PyTorch CUDA index as additional source # CUDA builds work on both GPU and CPU systems (fallback to CPU if no GPU) [[tool.uv.index]] +name = "pytorch-cu121" url = "https://download.pytorch.org/whl/cu121" -default = true + +# Tell uv to get torch from the PyTorch CUDA index +[tool.uv.sources] +torch = { index = "pytorch-cu121" } [tool.ruff] line-length = 100