Recipes¶
xaytune organizes training workflows into recipes -- high-level functions that encapsulate the full training pipeline for a specific task. Each recipe handles model loading, data preparation, training loop execution, and state management.
Available Recipes¶
| Recipe | Function | Methods | Use Case |
|---|---|---|---|
| Fine-tune | xaytune.finetune() |
full, lora, qlora |
Adapt a pre-trained model to a specific task or domain |
| Pre-train | xaytune.pretrain() |
full |
Train a model from scratch on a large text corpus |
| Align | xaytune.align() |
dpo, grpo, orpo, simpo, ppo, reinforce |
Align a model with human preferences |
How Recipes Work¶
Every recipe follows the same pattern:
- Build or accept a config -- either from keyword arguments or a
TrainConfigobject - Set up components -- model, tokenizer, data loaders, trainer, callbacks, logging
- Run the training loop -- delegate to the trainer
- Return a
TrainState-- final metrics, step count, and training status
import xaytune
# All recipes share the same calling convention:
state = xaytune.finetune(model="...", dataset="...", method="lora")
state = xaytune.pretrain(model="...", dataset="...", format="text")
state = xaytune.align(model="...", dataset="...", method="dpo")
Python API vs. Config¶
Each recipe can be called in two ways:
Recipe Registry¶
Recipes are registered in a global recipe_registry. You can list them:
from xaytune.recipes import recipe_registry
print(recipe_registry.list())
# ['align', 'finetune', 'pretrain']
Or from the CLI:
Next Steps¶
- Fine-tuning -- full, LoRA, and QLoRA fine-tuning
- Pre-training -- training from scratch
- Alignment -- DPO, GRPO, and other alignment methods