Skip to content

Install CPU-only torch in the backend image - #160

Merged
rajivpant merged 1 commit into
mainfrom
chore/cpu-torch-image
Nov 6, 2026
Merged

rajivpant merged 1 commit into
mainfrom
chore/cpu-torch-image

Conversation

@rajivpant

Copy link
Copy Markdown
Collaborator

PyPI's Linux torch wheels are the CUDA builds. In the backend image they added 3.3 GB of nvidia-* packages and 0.9 GB of Triton. The image has no GPU to use them: Docker Desktop on a Mac passes none through, and docker-compose.yml reserves none. That made the API image 6.8 GB, and on 2026-11-06 it filled Docker's disk mid-build.

The dependencies stage now installs torch from PyTorch's CPU index with --no-deps. torch's dependencies resolve from PyPI in the following pip install -r requirements.txt, because pip resolves an installed package's dependencies when a requirement (sentence-transformers) pulls it in; PyTorch's index mirrors of those packages can lag PyPI. The build then runs pip check.

Verification (linux/arm64 build)

  • Image 1.94 GB, down from 6.81 GB. torch 2.15.0+cpu (the same release as PyPI's latest), no nvidia-* packages, and pip check clean during the build.

  • harrier-oss-v1-0.6b in this image:

    CUDA image CPU image
    Embedding 1.8 chunks/s 2.4 chunks/s
    Query encoding 145 ms 64 ms
    Peak memory while loading 4.6 GB 4.2 GB

    engines.yaml and the CHANGELOG now quote the 4.2 GB peak.

  • LiteLLM 1.109.0rc1, filelock 4.2.9 and transformers 5.22.2 install as requirements.txt declares.

CI does not build the image. Its Python job still installs PyPI's torch through make install, which is the same torch release.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rajivpant
rajivpant merged commit 33e09cd into main Nov 6, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant