Skip to main content
A standalone sampler serves a base model or a saved checkpoint without a trainer. Use one to score a base model before you train, or to evaluate saved weights after a run ends. To sample during training, use the run’s paired sampler instead.
A standalone sampler bills until it’s inactive. It isn’t tied to a run, so deactivating a run doesn’t stop it. Deactivate the sampler when you finish.

Create the sampler

To create a standalone sampler: Call ServiceClient.create_sampling_client() with either model_path or base_model, but not both. To evaluate saved weights, pass the checkpoint’s path as model_path. Replace <checkpoint_path> with the path that save_weights_for_sampler() returned, which has the form bt://loops:<run_id>/sampler_weights/<checkpoint_name>:
To sample from a base model instead, pass its model ID from Supported models as base_model:
sampler_id is the ID you need to deactivate the sampler later. Then call sample() as you would with a paired sampler; see Sample published weights for a complete call. To create a standalone sampler without the SDK, send a Create a sampler request with a session ID and either base_model or model_path. Sampling from it requires the SDK.

Next steps