load(), from a path the runtime gives it.
load() runs once when the container starts and reads the weights the runtime mounted. Everything after that is sessions.
Loading
get_weights_path() returns the folder your checkpoints live under.
How the runtime finds your weights
The model needs its weights in both places. On Reactor, the runtime pointsget_weights_path() at
the bundle uploaded with the release, so there is nothing to configure. Locally, you tell
reactor run where they are, in one of three ways. When more than one is set, the first in this
list wins:
1
The --weights flag
Pass
--weights to run with the weights in that directory.2
$REACTOR_WEIGHTS_PATH in your shell
Set
REACTOR_WEIGHTS_PATH once to use the same directory for every run.3
runtime.weights_path in reactor.yaml
Put the path in A relative path resolves against the workspace folder, so
reactor.yaml when the weights live inside the workspace, so anyone who clones
it can run the model with no flags. This is what the scaffold uses.reactor.yaml
./weights is
<workspace>/weights wherever you launch from.get_weights_path() returns that folder inside the container, so the loading
code above needs no change. reactor run does this by mounting the folder and setting
REACTOR_WEIGHTS_PATH to the mount point. With none set, nothing is mounted and the runtime falls
back to ~/.cache/reactor_registry inside the container.
To use weights from a Hugging Face repository, pass hf://org/repo[@rev] in place of a folder in
any of the three. reactor run pins the revision, fetches it through your Hugging Face cache, and
mounts the result. See reactor run for the cache rules and
the download prompt.
When
reactor run itself runs inside a container, set REACTOR_HOST_WEIGHTS_PATH to the real
path on the host so the mount works. reactor run lists
what it overrides.Shipping weights with a release
Publishing a release uploads the weights alongside the image, andreactor weights upload swaps
the weights on a release without rebuilding it. Size is not a limit: the upload streams files, and
bundles of hundreds of gigabytes are fine.
Publish a release
How publish picks up weights, uploading them later with
reactor weights upload, pinning a
Hugging Face revision, and carrying a previous release’s weights over.Next
Managing State
The state object your model reads on every step, and how clients set it.
Session Recording
Record sessions and let clients capture clips.