What is the Cookbook?
The Fireworks Cookbook is a collection of training recipes and utilities built on top of the Training API. It provides config-driven training loops that handle trainer provisioning, data loading, tokenization, gradient accumulation, checkpointing, and cleanup automatically. The cookbook is optional — everything it does can be done with the API directly. Use the cookbook when you want a working training loop quickly; use the API when you need full control.Installation
Available recipes
Each recipe follows the same pattern: import
Config and main, set your config, and call main(cfg). Trainer and deployment provisioning is handled internally by the recipe — you describe what you want with TrainerConfig / DeployConfig, and the SDK attaches or creates the resources.
All launch examples below use trainer=TrainerConfig(training_shape_id=...) for explicit shape selection. Cookbook recipes can also auto-select validated shapes when training_shape_id is unset. The main run-level trainer knob you may set alongside a shape is replica_count for replicated HSDP launches; reference shapes can usually be left unset because the cookbook auto-selects or uses a shared-session reference when appropriate.
If you want field-level details about what a training shape controls and what stays configurable, see Training Shapes and the Cookbook Reference.
InfraConfig and the standalone setup_infra / ResourceCleanup helpers are deprecated and removed from the recipe surface. Recipes now take trainer=TrainerConfig(...) (and deployment=DeployConfig(...) for RL). See Migrating from the deprecated managed infra.Quick example: SFT
Quick example: GRPO
W&B logging
All cookbook recipes accept aWandBConfig to stream metrics to Weights & Biases:
Vision-language model support
All cookbook recipes support VLM fine-tuning. Use a VLM training shape and tokenizer, and provide multimodal datasets withimage_url content. See Vision Inputs for dataset format and examples.
Next steps
- Cookbook SFT — supervised fine-tuning
- Cookbook DPO — preference optimization with pairwise data
- Cookbook RL (GRPO) — full GRPO walkthrough with reward functions
- Cookbook Distillation — OPD, routed MOPD, and top-K SDFT
- Vision Inputs — fine-tune VLMs with image and text data
- Cookbook Reference — all config classes and parameters