Skip to main content
A dataset is a named collection of cases — each with an input, an optional expected answer, and optional metadata. You build it in code, save it to disk, and publish it to the platform when you’re ready.

Create a dataset

key is what identifies the dataset — it defaults to the name. Set it explicitly on any dataset you’ll re-run, so you can rename the dataset later without starting a new history.

Add cases

  • add(input, …) — add a case and return it.
  • upsert(case) — add or replace by id, so re-running your authoring script never duplicates a case.
  • update(id, …) — edit a case in place.
  • archive(id) / remove(id) — retire a case, or delete it outright.
A case’s id is derived from its content, so adding or reordering cases never renumbers the others. Pass id= to use your own identifier instead — a ticket number, or a row id from your warehouse.

Save and load

save(path) writes the dataset to disk and load(path) reads it back. Use a .jsonl path for a format that diffs cleanly in a pull request.

Publish a version

push() publishes the dataset to the platform as one immutable version. Re-pushing unchanged cases is a no-op; changed cases publish a new version of the same dataset.
Publishing into a dataset that already exists asks for confirmation on an interactive terminal. Pass on_existing=lambda info: True (Python) / { onExisting: () => true } (TypeScript), or set TRACEROOT_ASSUME_YES=1, to skip the prompt in CI. A declined prompt raises DatasetPublishAborted. You don’t need to publish before running an eval — evaluate() publishes a local dataset for you and never prompts. See Running evals.

Pull a dataset

Pull a published dataset back down as an ordinary local Dataset — iterate it, edit it, save it, or evaluate against it.
To reproduce a past run, pull the version that run recorded (result.dataset.dataset_version_id) and re-run it with your own task and scorers.

Next steps

Scorers

Turn a case’s output into a metric.

Running Evals

Point a task and scorers at a dataset and run it.