> ## Documentation Index
> Fetch the complete documentation index at: https://docs.freesolo.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Explore the directory

> Every file flash env setup creates, what it's for, and when Flash reads it.

`flash env setup` scaffolds a starter project into the **current directory**. A
run is fully described by what lands on disk: an **environment** (your task and
how it's scored) and a [**config**](/reference/configuration) (how to train on it). Every file is plain text
you can read, diff, and version-control. Rerunning is safe: existing files stay untouched.

```
./
├── environment.py        # the task + reward (a Freesolo environment)
├── dataset/
│   └── train.jsonl       # a tiny starter dataset (input/output rows)
├── configs/
│   ├── sft.toml          # an SFT (supervised) training config
│   ├── rl.toml           # a GRPO (RL) training config
│   └── opd.toml          # an OPD (distillation) training config
└── TRAINING.md           # a playbook for the AI agent driving your runs
```

### environment.py

**What it is:** your [environment](/environment-model), the single source of
truth for what the model practices on and how it's graded. It defines
`load_environment()`, which returns a Freesolo `EnvironmentSingleTurn` (or
`EnvironmentMultiTurn`) carrying a dataset and a `score_response` reward. This
is the file you edit first.

**When Flash reads it:** `flash env push` packages and uploads it, and every
training worker imports it and calls `load_environment(**params)`. Local
`flash train --cost` parses the config without executing environment code. The
scaffolded starter loads its rows from `dataset/train.jsonl`.

See the full scaffolded file — `StarterEnv` with `build_prompt_messages`
and `score_response` — in [Environments](/guides/environments/overview#scaffold-one).

### dataset/train.jsonl

**What it is:** a tiny starter dataset of `input`/`output` rows that the
scaffolded `environment.py` loads. Replace it with your training rows before a real run. See [Datasets](/guides/datasets).

**When Flash reads it:** your `environment.py` reads it on the worker at run
time. Local `flash train --cost` parses the configured `max_examples` without
reading the dataset. Authenticated server-side `--dry-run` runs submit-time
preflights without a GPU worker, so it does not execute the environment;
`flash env push` uploads the `dataset/` folder.

```jsonl dataset/train.jsonl theme={null}
{"input":"What is 2 + 2?","output":"4"}
{"input":"What is 3 + 5?","output":"8"}
```

### configs/sft.toml

**What it is:** an [SFT training config](/guides/training#choose-a-training-algorithm)
for supervised fine-tuning on the `input`/`output` pairs in your environment's
dataset. You set `model`, the `[environment] id`, and the `[train]` knobs
(epochs, lora\_rank); the
training infrastructure and artifact storage are [managed for you](/reference/configuration). Copy
it per experiment.

**When Flash reads it:** every `flash train`, `--dry-run`, and `--cost` parses
this file. Dry-run sends the spec to the authenticated server for submit-time
preflights; `--cost` stays local.

```toml configs/sft.toml theme={null}
model = "Qwen/Qwen3.5-4B"
algorithm = "sft"

[environment]
id = ""   # paste the id returned by `flash env push --name my-env .`

[train]
epochs = 3
max_examples = 1000
lora_rank = 32
```

### configs/rl.toml

**What it is:** the same config shape with `algorithm = "grpo"`, for GRPO
(RL) training that optimizes against your environment's `score_response`
reward. Keep the configs you need and pick one at train time.

**When Flash reads it:** same as `sft.toml`; pass it to `flash train` to run
GRPO instead of SFT.

```bash theme={null}
flash train configs/rl.toml
```

### configs/opd.toml

**What it is:** the same config shape with `algorithm = "opd"`, for
[on-policy distillation](/guides/training#choose-a-training-algorithm) — a managed
teacher model grades your model's own completions and training pulls the model
toward it. It uses `epochs` over the retained prompt pool, and Flash derives the
optimizer-step count internally. Warm-start from a finished SFT run with
`init_from_adapter` for best results.

**When Flash reads it:** same as `sft.toml`; pass it to `flash train` to run OPD.

```bash theme={null}
flash train configs/opd.toml
```

### TRAINING.md

**What it is:** a playbook for the AI coding agent you point at this project,
including the OPD teacher preflight, rollout reasoning budgets, reward design,
run interpretation, and common Flash issue mitigations.

**When it travels:** if you publish the whole scaffolded folder,
`flash env push` includes `.md` sidecars, so
`TRAINING.md` can travel with the environment source in the Hub for humans and
coding agents.

## Packaging an environment as a folder

The scaffolded `environment.py` is enough to publish on its own. Once your task
grows data files or helper modules, move it into a folder with
`environment.py` at the root and publish the whole folder.

```
math/
├── environment.py        # defines load_environment()
├── helpers.py            # optional sibling modules, imported by environment.py
└── dataset/
    ├── train.jsonl       # input/output records
    └── eval.jsonl
```

### helpers.py

**What it is:** any sibling Python modules your `environment.py` imports. Import only from installed packages or from files in the folder you publish.

**When Flash reads it:** uploaded with the folder by `flash env push` and
importable on the worker.

### dataset/

**What it is:** sidecar data files (`.jsonl`, `.json`, `.csv`, and more)
that your environment loads. See
[Datasets](/guides/datasets#what-gets-uploaded) for the full list.

**When Flash reads it:** your environment code reads it (for example via
`load_task_examples(...)`); `flash env push` includes the `dataset/` folder
in the uploaded artifact.

```jsonl dataset/train.jsonl theme={null}
{"input":"What is 2 + 2?","output":"4"}
{"input":"What is 3 + 5?","output":"8"}
```

## Next steps

<CardGroup cols={2}>
  <Card title="Single-turn environments" icon="flask" href="/guides/environments/single-turn">
    Fill in the environment class the scaffold starts you with.
  </Card>

  <Card title="Training" icon="dumbbell" href="/guides/training">
    Point a config at your environment and submit a run.
  </Card>
</CardGroup>
