Scaffold one
environment.py, a
tiny dataset/train.jsonl, three configs (configs/sft.toml for SFT,
configs/rl.toml for GRPO, and configs/opd.toml for OPD), and a TRAINING.md
playbook for the coding agent you point at the project. The starter load_environment() returns a Freesolo
EnvironmentSingleTurn with a sample dataset and reward.
On an interactive terminal, flash env setup first runs a short survey: whether
the model handles your task in a single turn or a bounded multi-turn episode, and
whether to train with reasoning. Answer up front with --single-turn /
--multi-turn and --reasoning / --no-reasoning, or pass -y to take the
defaults (single-turn, no reasoning); non-interactive runs (no TTY or CI) always
take the defaults. --multi-turn scaffolds a runnable EnvironmentMultiTurn
starter with the episode hooks wired end-to-end instead of the single-turn class,
and --reasoning sets thinking = true in the generated configs.
environment.py
- Dataset: the prompts (and any gold answers) your model trains and is evaluated on.
- Reward:
score_responsereturns aRewardResult. GRPO optimizes that score; SFT trains directly on your dataset answers instead; OPD distills a teacher’s token-level grading of the model’s own completions. See how Flash works.
EnvironmentMultiTurn
and implement the episode hooks. See Multi-turn environments below.
Use the SDK
Your environment code imports from thefreesolo package. The managed flow
needs no local install. Training workers already have the SDK when they import
your published environment. Install it locally only to run or test
environment.py yourself. Local flash train --cost uses the configured SFT
max_examples and does not import the environment:
Next steps
Package & publish
Structure the folder and push it to the Hub.
Single-turn environments
Write the dataset, prompts, and reward.