Skip to content

switchcraft: include model weights by default; add missing README.container.md - #2

Merged
pansapiens merged 1 commit into
mainfrom
fix/switchcraft-include-weights-by-default
Aug 12, 2026
Merged

switchcraft: include model weights by default; add missing README.container.md#2
pansapiens merged 1 commit into
mainfrom
fix/switchcraft-include-weights-by-default

Conversation

@pansapiens

Copy link
Copy Markdown
Collaborator

Problem

The published switchcraft:67ffc0d image cannot run any real design out of the box.

The Dockerfile defaulted to ARG DOWNLOAD_WEIGHTS=false, so the image ships with only the CCD ligand database (ccd.pkl) and is missing the required Boltz-1 checkpoint boltz1_conf.ckpt. switchcraft.py hardcodes:

Boltz1.load_from_checkpoint("boltz/boltz1_conf.ckpt", ...)

with no runtime download, so every design run fails at model load.

Reproduction

$ apptainer run --nv switchcraft_67ffc0d.img \
    python3 switchcraft.py --config tasks/pos_allostery.yaml --out /output
...
File ".../torch/serialization.py", in _deserialize
    return obj.to(device=device)
torch.OutOfMemoryError / FileNotFoundError: ... boltz/boltz1_conf.ckpt

I confirmed the image lacks the checkpoint (ls /app/boltz/ → only ccd.pkl symlink). A pos_allostery run only succeeded once the 3.5 GB checkpoint was downloaded from Hugging Face and bind-mounted into /app/boltz/boltz1_conf.ckpt — it then completed a full design (~9 min, valid holo/apo structures with correct ligand placement and confidence metrics).

Fix

This PR makes two changes to dockerfiles/switchcraft/67ffc0d/:

1. Dockerfile — include weights by default

  • ARG DOWNLOAD_WEIGHTS=falseARG DOWNLOAD_WEIGHTS=true
  • Updated the build-comment header accordingly.

This matches the convention already used by the boltz containers in this repo (e.g. boltz/v2.2.1-2), which bake model weights into the image unconditionally. The weight-download logic (DOWNLOAD_WEIGHTS=true branch) is pre-existing, downloading boltz1_conf.ckpt and LigandMPNN params from public URLs (Hugging Face, files.ipd.uw.edu). A slim ~3.5 GB-smaller build is still available via --build-arg DOWNLOAD_WEIGHTS=false (weights then bind-mounted at runtime).

2. Add the missing README.container.md

The Dockerfile does COPY README.container.md /README.md, but that file was never committed (only one commit 44f61b4 "Add SwitchCraft" added this container, without the README). As a result docker build from current HEAD fails at the COPY step. The engens and cf-random containers each ship their own README.container.md next to the Dockerfile; this adds the equivalent for switchcraft, documenting source, weights, GPU usage (apptainer --pwd /app --nv and docker --gpus), the example tasks, and output layout.

Validation

  • docker build --check on the edited Dockerfile → no warnings.
  • End-to-end run of the published image with the checkpoint bind-mounted completed a full pos_allostery design successfully (correct holo ligand placement, sensible Boltz confidence metrics), confirming the only thing the published image was missing is exactly what this PR bakes in.

Trade-off

Image size grows by ~3.5–4 GB (Boltz-1 checkpoint + LigandMPNN params). This is consistent with the other weight-bearing images in this repo and is the price of a self-contained, runnable image. Users who want the smaller image can build with --build-arg DOWNLOAD_WEIGHTS=false.

…tainer.md

The published switchcraft:67ffc0d image was built with DOWNLOAD_WEIGHTS=false
(the Dockerfile default), so it shipped with only the CCD ligand database and was
missing the required Boltz-1 checkpoint (boltz1_conf.ckpt). switchcraft.py
hardcodes Boltz1.load_from_checkpoint("boltz/boltz1_conf.ckpt") with no runtime
download, so the image failed immediately on any real design run (verified: a test
run only succeeded once the 3.5 GB checkpoint was bind-mounted into the image).

Flip DOWNLOAD_WEIGHTS to default to true so the image runs out of the box, matching
the convention used by the boltz containers (which bake weights in). A slim
weights-free build is still available via --build-arg DOWNLOAD_WEIGHTS=false
(weights can then be bind-mounted at runtime).

Also add the missing README.container.md that the Dockerfile COPYs into the image
at /README.md. Without it `docker build` fails at the COPY step; the file was
referenced in 44f61b4 ("Add SwitchCraft") but never committed (cf. engens and
cf-random which ship their own README.container.md alongside the Dockerfile).
@cursor

cursor Bot commented Aug 12, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@pansapiens
pansapiens merged commit ac75fed into main Aug 12, 2026
1 of 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