Worker
As of Aug 10, 2025
The worker exists as a CLI to manage worker admins, worker groups, and worker machines.
Build and start the worker CLI with:
# from thava/
cd crates/worker
cargo run --release -- --help
# or, again from thava/
cargo run --manifest-path crates/worker/Cargo.toml -- --help
The worker use the clap
crate to define control flow for
the CLI. See worker/src/main.rs
for the command definitions
(rustdoc comments become help annotations).
Initialization and Groups
caravan init
allows a worker admin to be created alongside
adding one or more GPUs to the current machine as a worker machine.
These selected options are added to a configuration file that is
read the next time caravan init
is run. Notably, a login method
for the same worker admin from another machine is missing (LOL oops).
Similarly, the group
subcommand has options that allow for the
creation and deletion of groups along with the machine
subcommand
for adding and removing the current machine from this group. The client
subcommand similarly allows adding and removing clients from
each group. Every subcommand has a corresponding file in
subcommands/
. Every object's interface with the distributor is defined
in endpoints
.
Each of these subcommands makes the appropriate gRPC
calls to
the distributor. Just as the gRPC
stubs are generated for
the distributor, they are similarly generated for the worker
in worker/src/endpoints/stubs/
.
Starting
Starting a worker only performs one thing: opening a bidirectional
gRPC
stream with the distributor. It marks the machine
as available.