fix(deps): make torch/ML stack opt-in instead of a mandatory install

requirements-amd.txt/requirements-nvidia.txt were pulling a multi-GB
torch wheel by default even though nothing in synapse/ imports torch,
transformers, accelerate, bitsandbytes, or PySide6 - dead weight that
made the pip batch fragile (one failed download could take unrelated
base deps down with it on a slow connection). Split the unused ML/GUI
stack out of requirements-base.txt into a new opt-in requirements-ml.txt,
and dropped the torch lines from the AMD/NVIDIA overlays and generator.

Also: recreate the venv if it exists but pip is missing, instead of
silently reusing a half-built one (ensurepip can fail during venv
creation and leave an interpreter with no pip).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Jon Wingender
2026-07-30 11:43:17 -05:00
co-authored by Claude Sonnet 5
parent 409e384be0
commit 3b0354735c
6 changed files with 40 additions and 22 deletions
+20
View File
@@ -0,0 +1,20 @@
# --- Optional: local ML inference stack ---
# Nothing in synapse/ imports any of this — Ollama handles all inference over
# HTTP. Only install this if you're doing local model work outside Ollama
# (fine-tuning, direct transformers inference, etc). Skipping it is what keeps
# the default install light and out of a multi-GB torch download.
#
# This file has no --index-url of its own, so torch resolves as CPU-only
# unless you combine it with the GPU overlay that sets one:
# pip install -r requirements-amd.txt -r requirements-ml.txt # ROCm
# pip install -r requirements-nvidia.txt -r requirements-ml.txt # CUDA
# pip install -r requirements-ml.txt # CPU only
transformers
accelerate
bitsandbytes
safetensors
sentencepiece
torch
torchaudio
torchvision