Skip to content

About

Ready-to-use ML training recipes to help you build and deploy models on Baseten.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Baseten

Loops docs | Training Jobs docs | Inference docs

Ready-to-use recipes for training models on Baseten. The cookbook covers Baseten's two ways to train:

Loops Training Jobs
What it is An SDK for online training: you write the training loop in plain Python and Baseten runs the trainer and a paired sampler Batch jobs: you package a training script and config.py, then truss train push runs it on GPUs to completion
Best for RL (GRPO, async and multi-turn), agent training, and SFT you want to drive step by step SFT, DPO, full fine-tunes, and multi-node runs on the framework you choose (Axolotl, TRL, MS-Swift, VeRL, Megatron, TorchTitan, ...)
You manage The loop: data, rewards, when to step and sample The script and the GPU config
Start here loops/README.md training-jobs/README.md

Repository layout

loops/                      # Loops recipes: SFT, GRPO (sync + async), multi-turn RL, rollout dashboard
training-jobs/
  examples/                 # runnable model/framework projects, launch with `truss train push`
  recipes/                  # implementation guides and patterns (RL, SFT, robotics, experiment dashboard, ...)
.examples-index.json        # where each example lives; read by `truss train init --examples`

Loops

Loops is Baseten's SDK for online training. You write the training loop in plain Python: forward-backward passes, optimizer steps, and weight sync to a live sampler. Baseten provisions and runs the trainer and sampler. The recipes cover SFT, GRPO (sync, and async with bounded off-policy sampling), and multi-turn RL.

cd loops
export BASETEN_API_KEY="your-api-key"
uv sync
uv run rl/train_grpo.py

See loops/README.md for every recipe and the Loops docs for concepts.

Training Jobs

Training jobs run a training script you package with a config.py on Baseten GPUs, through truss train. Pull any example into a fresh directory and launch it:

pip install -U truss
truss train init --examples qwen3-8b-lora-dpo-trl && cd qwen3-8b-lora-dpo-trl
truss train push config.py

Or clone this repo and push from the example's directory:

git clone https://github.com/basetenlabs/ml-cookbook.git
cd ml-cookbook/training-jobs/examples/qwen3-8b-lora-dpo-trl/training
truss train push config.py

See training-jobs/README.md for the full list of examples and recipes, and the Training Jobs docs for concepts.

Experiment dashboard

training-jobs/recipes/experiment-dashboard is a local, self-hosted dashboard over an S3 experiment store. It syncs runs down and serves loss-curve overlays, hyperparameter filtering, and cross-run comparison, using only the Python standard library. It works with any training source that writes its three-file run contract, including Loops and Training Jobs. For a live view of a single Loops run's rollouts, use loops/rollout-dashboard.

Prerequisites

Contributing

Contributions are welcome. Please open issues or submit pull requests. When you add, rename, or move a Training Jobs example, update .examples-index.json so truss train init --examples can find it; bin/check_examples_index.py checks it in CI.

License

MIT License, except loops/, which is adapted from tinker-cookbook and licensed under Apache 2.0 (see loops/LICENSE).

About

Ready-to-use ML training recipes to help you build and deploy models on Baseten.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages