uvx synth-ai serve) or remotely on Modal (uvx synth-ai deploy). For SFT the goal is to produce rich traces and SFT-ready JSONL dumps without manual intervention. The math demo in the quickstart is a concrete reference implementation you can copy when wiring your own app.
For CLI deep dives, see Run Task Apps Locally, Run Task Apps on Modal, Deploy Task Apps, and Run Evaluations.
Minimum contract
Every task app must provide:- A
TaskAppConfigobject registered throughregister_task_app. - Implementations of
/health,/task_info, and/rollout(the Synth helpers wire these up for you). - Access to an environment API key (read from
ENVIRONMENT_API_KEYor its aliases). - Optional rubrics and dataset metadata so rollouts can be judged and filtered later.
uvx synth-ai eval it expects to:
- Fetch
/task_infoto understand actions, observations, and limits. - POST
/rolloutrequests for each seed with policy + environment parameters. - Receive a
RolloutResponsecontaining trajectories and/or a v3 trace payload.
Enable tracing and SFT dumps
The easiest way to keep your dataset in sync is to enable tracing and SFT sinks by default. The Crafter task app in the SDK uses the following pattern:TASKAPP_TRACING_ENABLED=1– turns on trace recording and ensuresSessionTraceris created.TASKAPP_SFT_OUTPUT_DIR=ft_data– writes per-run JSONL to that directory after each rollout.ENVIRONMENT_API_KEY– used byrequire_api_key_dependencyto protect/rollout.
- A persistent session trace in
traces/v3/synth_ai.db. - An SFT dump with system/user/assistant messages and optional tool-call metadata.
Local iteration checklist
eval command is idempotent—agents can re-run it whenever you need fresh data. Because evaluation and rollouts are the same API, you can reuse the same path for benchmarking later.
Remote deployments (Modal)
For remote training you typically deploy the task app to Modal:uvx synth-ai eval --task-url https://<modal-subdomain>.modal.run --seeds 1-2 to execute a smoke rollout. Once /health and /task_info respond with HTTP 200, you can safely collect production traces and kick off training jobs. The rest of the SFT pipeline assumes the task app is reachable at the URL you supply in your TOML configs.
Tip: pass --env-file only when you want to override the automatically-discovered .env. You can repeat the flag if you need to merge multiple files.