How the cookbook relates to the SDK
Post-training code works at three levels: recipes, helpers, and the SDK. The cookbook supplies the recipes and helpers, and both call the SDK to train:
Some features exist only in the cookbook’s recipes, not in the post-training service, so a loop you write with the SDK has them only if you implement them:
- Dynamic sampling, overlong handling, and length budgets.
- Async rollout collection.
- The dataset registry and its built-in rewards.
- The
Envabstraction and the multi-turn episode loop. - Run directories and Weights & Biases (W&B) logging.
- Continuing a run where its data and learning-rate schedule stopped.
Install
Clone to run recipes
Recipes and notebooks run from a checkout of the repository. Clone it and install its dependencies, including the Together Python SDK, with uv:notebooks/ walk step by step through GRPO, SFT, and training several low-rank adapters (LoRAs) on one model resource, using the SDK’s async calls. To add a notebook kernel, run uv sync --locked --group notebooks in your checkout.
Install as a library
To import the helpers into your own project, install the cookbook from GitHub, since it isn’t published to PyPI. It requires Python 3.11 or later and pulls in PyTorch, Transformers, and version 3 of the Together Python SDK as dependencies:post_training_cookbook.
Recipes
Run a recipe withuv run python <path> from a cookbook checkout. Each recipe is a single script with its config at the top. To change a run, edit the config. To start a new recipe, copy an existing one.
Run outputs
Run artifacts
Every cookbook recipe writes a record of the run to a run directory,runs/<run_name>/:
metrics.jsonl, so you can analyze a run offline without W&B. To see what the model is producing, read the per-step step_NNNN_*.json files.
Weights & Biases
When a config setswandb_project, the cookbook logs every step to that project. GRPOConfig defaults it to post-training-cookbook. SFTConfig and DPOConfig leave it unset.
To run without a W&B account, set WANDB_MODE=offline to keep the W&B logs on disk, or set wandb_project=None to turn W&B off.
To compare related runs side by side, such as the arms of a sweep, give them the same wandb_group.
The cookbook forwards wandb_project, wandb_entity, wandb_group, and wandb_run_name to the session as metadata, and the console shows them on the session’s page. It doesn’t send the run’s ID or URL, so the page doesn’t link to the run. To open the run, use the W&B URL in manifest.json.
Next steps
Run GRPO recipes
Train a GRPO recipe on a built-in dataset or your own.
Run multi-turn GRPO recipes
Train a tool-use agent on an environment you write.
Monitor training runs
Watch a run in the console and read the metrics each recipe logs.
Cookbook config reference
Look up every config field and its default.