Skip to main content
Every cookbook recipe passes a config object to a training function. This page lists the recipes the cookbook ships and every field on its three config classes: GRPOConfig, SFTConfig, and DPOConfig. For the API fields behind these settings, see the post-training API reference. For the limits that apply to them, see Limits. The cookbook renders prompts with a codec for each model family and loads each model’s tokenizer from Hugging Face by its catalog ID. It has codecs for the Qwen models, moonshotai/Kimi-K3, MiniMaxAI/MiniMax-M3, and zai-org/GLM-5.3.

Recipes

Run a recipe from a cookbook checkout with uv run python <path>. To set up a checkout, see the RL quickstart. Each recipe is a single script with its config at the top. Edit the values there to change a run, or copy the file to start a new recipe.

Load a config from YAML

Each config class is a Python dataclass, so recipes set fields as keyword arguments. Every class also loads from a YAML file with the same field names:
from_yaml raises ValueError on any key that isn’t a field. Every run writes its config to runs/<run_name>/config.yaml, which loads back the same way.

Shared fields

GRPOConfig, SFTConfig, and DPOConfig all take these fields. Where a default differs between the configs, the table lists each one.

GRPOConfig

Configures train_single_turn and train_multi_turn in post_training_cookbook.grpo.train. Set exactly one of model and model_resources_id. It also takes the fields every config shares.

Model and resource

Schedule

Sampling and loss

Token budgets

For single-turn runs, set max_sample_tokens or max_prompt_length. If both are None, the prompt budget is 0 and every prompt is dropped.

Thinking

preserve_thinking values: Set preserve_thinking to match inference. Use True only when the model also sees its earlier reasoning at inference. Otherwise, the run trains on history that inference never reproduces. Reasoning in conversation history explains why stripping splits a conversation.

Optimizer

Under Muon, the shared AdamW fields still apply to the parameters Muon doesn’t optimize: embeddings, norm layers, and the output head.

Weight sync

Validation

Checkpoints and resume

Logging

Single-turn only

Multi-turn runs ignore these fields.

Multi-turn only

Single-turn runs ignore these fields, except max_steps_off_policy, which train_single_turn rejects. They take effect when max_turns is set.

SFTConfig

Configures train in post_training_cookbook.sft.train. SFT runs on a trainer-only resource, so it has no generator settings. Set exactly one of model and model_resources_id. It also takes the fields every config shares. train also takes a keyword-only to_messages function, which maps a dataset row to its list of messages. The default reads the messages column. train returns the ID of the latest training checkpoint, or None if the run saved none.

DPOConfig

Configures train in post_training_cookbook.dpo.train. DPOConfig has no model_resources_id field, so every DPO run provisions its own trainer-only resource. It also takes the fields every config shares. train also takes a keyword-only to_pair function, which maps a dataset row to a (chosen_messages, rejected_messages) tuple, or to None to skip the row. The default, helpsteer3_pair, reads HelpSteer3’s columns. See Use your own preference dataset.