X-API-Key header set to your ENVIRONMENT_API_KEY (run uvx synth-ai setup to provision credentials).
SFT task apps exist primarily to generate high-quality training data. Unlike RL, the training backend does not call your task app directly; instead, you use the app to gather rollouts/traces, export them to JSONL, and feed those files to synth-ai train --type sft. The app still exposes the standard HTTP interface so tools like uvx synth-ai eval, uvx synth-ai filter, and tracing_v3 know how to talk to it.
Supervised data capture
- Serialize conversations in the schema enforced by
synth_ai.learning.sft.data(validate_training_jsonl,validate_jsonl_or_raise). Each JSONL line should resemble: - Honour the tracing hooks used by
synth_ai.task.tracing_utils:TASKAPP_TRACING_ENABLED=1turns tracing on.TASKAPP_SFT_OUTPUT_DIR(orSFT_OUTPUT_DIR) tellsresolve_sft_output_dir()/unique_sft_path()where to write JSONL batches.TURSO_LOCAL_DB_URL,LIBSQL_URL,SYNTH_TRACES_DB, andSQLD_DB_PATHsteer the tracing_v3 database so downstream tools can read rollouts.
- Provide
[filter]knobs compatible withsynth_ai.task.config.FilterConfig(splits, score thresholds, model filters, limits) souvx synth-ai filtercan export curated JSONL.
- Ship SFT TOML configs that
build_sft_payloadaccepts (dataset paths, model allowlist, hyperparameters, validation strategy). - After filtering, the SDK flow is
FtClient.upload_training_file()→FtClient.create_sft_job()→FtClient.start_job().
- Expose a
TaskAppConfigwhosebase_task_info,describe_taskset(), andprovide_task_instances()describe the dataset (task descriptor, environment id, dataset metadata, rubric, inference defaults, limits). These values surface through/infoand/task_info. rollout()responses must satisfysynth_ai.task.validators.validate_rollout_response_for_rl:pipeline_metadata.inference_urland everytrajectory.steps[*].info.meta.inference_urlneed a?cid=...token for trace correlation.- Hosting on Modal? Publish a
modal.Appscript that imports your task app and call it withuvx synth-ai deploy --runtime modal(same requirements as RL deployments).
- /
- Method: GET
- Returns:
- /health
- Method: GET
- Returns:
- /info
- Method: GET
- Returns:
- /task_info
- Method: GET
- Query params:
seed(int, repeatable) orseeds(array[int]) - No seed returns:
- With seed(s) returns:
- A single
TaskInfoobject (or a list of them) describing the seed-specific task (fields:task,environment,dataset,rubric,inference,limits,task_metadata).
- A single
- /rollout
- Method: POST
- Body:
RolloutRequest - Returns
RolloutResponse: