Managed, remote, or local training
ART provides three backend classes:ServerlessBackend
- train remotely on autoscaling GPUsSkyPilotBackend
- train remotely on self-managed infraLocalBackend
- run your agent and training code on the same machine
LocalBackend
. If your agent is running on a machine without an advanced GPU (this includes most personal computers and production servers), use SkyPilotBackend
or ServerlessBackend
instead. ServerlessBackend
optimizes speed and cost by autoscaling across managed clusters. SkyPilotBackend
lets you use your own infra.
All three backend types implement the art.Backend
class and the client interacts with all three in the exact same way. Under the hood, SkyPilotBackend
configures a remote machine equipped with a GPU to run LocalBackend
, and forwards requests from the client to the remote instance. ServerlessBackend
runs within W&B Training clusters and autoscales GPUs to meet training and inference demand.
ServerlessBackend
Setting upServerlessBackend
requires a W&B API key. Once you have one, you can provide it to ServerlessBackend
either as an environment variable or initialization argument.
ServerlessBackend
automatically saves your LoRA checkpoints as W&B Artifacts and deploys them for production inference on W&B Inference.
SkyPilotBackend
To use SkyPilotBackend, you’ll need to install the optional dependency:SkyPilotBackend
instance is initialized, it does a few things:
- Provisions a remote machine with an advanced GPU (by default on RunPod)
- Installs
openpipe-art
and its dependencies - Initializes a
LocalBackend
instance with vLLM and a training server (unsloth or torchtune) - Registers the
LocalBackend
instance to forward requests to it over http
SkyPilotBackend
instance, follow the code sample below:
LocalBackend
TheLocalBackend
class runs a vLLM server and either an Unsloth or torchtune instance on whatever machine your agent itself is executing. This is a good fit if you’re already running your agent on a machine with a GPU.
To declare a LocalBackend
instance, follow the code sample below:
Using a backend
Once initialized, a backend can be used in the same way regardless of whether it runs locally or remotely.LocalBackend
and ServerlessBackend
in action, try the examples below.