When to use each mode
Start with the serverless mode if your model is available in it. Use the dedicated mode when you need a model or configuration serverless doesn’t support, or when you need to control a run’s throughput with replica counts. The serverless mode fits experimentation:- Self-serve. Start runs, and start more of them, without contacting Baseten.
- Billed for usage. You pay for the tokens you train and sample, so time spent reading results or revising a reward function between steps costs nothing.
- Nothing to manage. You create a run and train, with no deployments to size, start, or shut down.
- Models and configurations serverless doesn’t support. Every model in the catalog trains in the dedicated mode, including models, sequence lengths, and LoRA ranks that serverless doesn’t support.
- Scaling out a run, especially asynchronous RL. Add trainer replicas for update throughput and sampler replicas for rollout throughput, and use spot capacity for interruptible runs that resume from checkpoints.
- Planned, sustained runs. In the dedicated mode, a run’s deployments belong to it for its whole duration. To plan for a large run, request more access.
How Loops chooses a mode
By default, a run uses the serverless mode when your workspace has serverless access to the model and serverless supports the run’s LoRA rank and sequence length. Otherwise, the run uses the dedicated mode. A run that reuses another run’s deployments stays in the dedicated mode. A run’s paired sampler uses the same mode as the run.Choose a mode
Setscope to serverless when you create a run or a standalone sampler. If serverless can’t accept the run, the request fails instead of falling back to dedicated GPU billing.
string
default:"default"
Where the run or standalone sampler trains and samples.
default: Loops chooses, as described above.serverless: the serverless mode. Creating the run fails, instead of falling back to the dedicated mode, if your workspace doesn’t have serverless access to the model, serverless doesn’t support the requested configuration, or serverless can’t start the run.deployment: the dedicated mode, with trainer and paired sampler deployments for the run, billed for GPU time. Use it to scale out a model that’s also available in the serverless mode.
- Python SDK
- Environment variable
- REST API
To use the serverless mode:Pass
scope when you create the training client:ServiceClient.create_sampling_client() takes the same scope argument for a standalone sampler.availability_model configure deployments; they don’t select the mode. Set scope to deployment to make sure they apply. For more information, see Dedicated Loops.
To check which models and sequence lengths your workspace can use, see Supported models.