Skip to main content
Every cookbook recipe passes a config object to a training function. This page lists every field on the cookbook’s three config classes: GRPOConfig for group relative policy optimization (GRPO), SFTConfig for supervised fine-tuning (SFT), and DPOConfig for direct preference optimization (DPO). For the API fields behind them and the limits that apply, see the post-training API reference and Limits. The cookbook renders prompts in each model family’s chat format through a codec for that family, and loads each model’s tokenizer from Hugging Face by its catalog ID. Supported models lists each catalog model’s codec. It also names the models that need HF_TOKEN because their Hugging Face repository is gated.

Load a config from YAML

Each config class is a Python dataclass, so recipes set fields as keyword arguments. Each class also loads from a YAML file whose keys are the 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

All three config classes take these fields. Where a default differs between classes, 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 stay at their None defaults, the prompt budget is 0 and every prompt is dropped.

Thinking

SFTConfig also takes these three fields. DPOConfig takes only enable_thinking. Supported models lists each model’s thinking default, effort levels, and whether its template keeps earlier reasoning. Each preserve_thinking value sets how the history is rendered and how many training sequences a conversation becomes: 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.

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.

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. 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. Pass your own function to train on another preference dataset.