Skip to main content
A training recipe stores a complete training configuration as a reusable template. The configuration names the base model, the datasets, the training method, the hyperparameters, and the parameter-efficient fine-tuning (PEFT) settings. To save and run recipes in the app, see Recipes. Request and response fields use camelCase. The API rejects unknown fields.

REQUEST


RECIPE CONFIG

recipeConfig selects the recipe type and holds the training configuration.

TRAINING CONFIG

trainingConfig contains four sections. Only model is required. Oumi fills the omitted settings from the preset recipe for the selected model and training method.

MODEL

model defines the base model and the tokenizer.

INIT MODEL

model.initModel starts training from the weights of an existing model version in your project instead of the base model weights.

DATA

data lists the datasets for each split. Each split is an object with a datasets array. A split that you omit has no datasets. Each split contains one field.

DATASET REFERENCE

DPO training requires preference datasets. The other training methods reject preference datasets.

TRAINING

training selects the training method and sets the hyperparameters. Omitted fields take the preset value for the model and method.

TRAINER TYPE

The API also accepts the legacy values trl_sft, trl_gold, and verl_grpo, and stores them as sft, opd, and grpo. When you omit trainerType, Oumi infers it from the method settings. onPolicyDistillation selects opd, grpo selects grpo, and preferenceOptimization selects dpo. Without any of these settings, the preset trainer for the model applies. GRPO and DPO are behind feature flags. The API rejects grpo and dpo in environments where these flags are off.

ENUMERATED VALUES


ON-POLICY DISTILLATION

training.onPolicyDistillation configures on-policy distillation. Use it with trainerType opd.

GRPO

training.grpo configures GRPO training. Use it with trainerType grpo.

PREFERENCE OPTIMIZATION

training.preferenceOptimization configures DPO training. Use it with trainerType dpo. Omitted fields take the preset value.

PEFT

peft configures parameter-efficient fine-tuning. Omit peft, or omit peftMethod, for full fine-tuning.

VALIDATION RULES

  • trainingConfig.model.modelName is the only required training field.
  • A request can set at most one of onPolicyDistillation, grpo, and preferenceOptimization.
  • When trainerType is set, it must match the method settings. For example, grpo settings require trainerType grpo.
  • numTrainEpochs must be from 1 to 30.
  • A fractional evalSteps must be greater than 0 and less than 1. GRPO training accepts only an integer.
  • GRPO training requires training.grpo.evaluatorId.
  • grpo.evaluatorVersion requires grpo.evaluatorId.
  • DPO training requires preference datasets. Other trainer types reject preference datasets.
  • onPolicyDistillation.teacherModelName must be a teacher model listed for the student model.

EXAMPLES

SUPERVISED FINE-TUNING WITH LORA

LoRA uses less GPU memory and trains faster than full fine-tuning. Use it as the starting point for most fine-tuning tasks.

FULL FINE-TUNING

Full fine-tuning updates all model parameters. Use it when LoRA quality is not sufficient for your task.

ON-POLICY DISTILLATION INTO A SMALLER MODEL

On-policy distillation trains a smaller student model with guidance from a larger teacher model. See On-policy distillation.

DIRECT PREFERENCE OPTIMIZATION

DPO trains a model to prefer the chosen response over the rejected response in each row of a preference dataset. This example uses full fine-tuning. See Direct preference optimization.

GRPO WITH AN EVALUATOR REWARD

GRPO samples several completions for each prompt and scores them with an evaluator. Set evaluatorId to an evaluator in the same project.
Set seed in training for reproducible runs. Set enableGradientCheckpointing to true when GPU memory is limited.