Skip to main content

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.
New to training on Fireworks? Cookbook: Muse Glimmer First Fine-Tune runs a free LoRA SFT job on preloaded example data and compares base versus tuned.

Installation

Use Python 3.11 or newer. Install the published cookbook to import its recipes and utilities:
The distribution is fireworks-training-cookbook; Python imports remain training.*, such as from training.recipes.sft_loop import Config, main. It installs the Fireworks SDK and the cookbook’s runtime dependencies. The cookbook and SDK have separate release versions. Cookbook 2026.11.5.1 uses calendar versioning; SDK 1.2.31 is published as fireworks-ai. To reproduce those releases:

Edit recipes or run source examples

Clone the public repository when you want to modify a recipe or follow an example that runs from the checkout:
An editable install uses your checkout, which can include changes newer than the published PyPI release. For a reproducible source checkout, check out the matching release tag before installing.

Verify the installation

This prints the installed cookbook version. With the pinned release above, it prints 2026.11.5.1.

Authentication

Before running a training job, set your credentials:

Update an existing checkout

The cookbook’s canonical repository is now fw-ai-external/cookbook. In an existing cookbook clone, update the remote:
To use PyPI releases instead of a local checkout, install the package in a fresh Python environment. To update coding-agent skills, use the current installation commands. Skills are installed from GitHub separately from the Python package.

Available recipes

Each recipe follows the same pattern: import Config and main, set your config, and call main(cfg). Dedicated recipes attach or create trainer and deployment resources from TrainerConfig / DeployConfig. Serverless recipes attach to the shared pool and publish session-scoped sampler snapshots instead of provisioning a deployment. 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 a WandBConfig to stream metrics to Weights & Biases:

Vision-language model support

For vision-language training, choose a supported VLM recipe, training shape, and matching tokenizer, and provide multimodal datasets with image_url content. See Vision Inputs for dataset format and examples.

Embedding loop

The embedding_loop recipe trains embedding models with contrastive or supervised embedding objectives. Use it when your base model is an embedding endpoint rather than a chat completion model.

Next steps