Datasets
A dataset is a named collection of test cases. Each item has an input, an optional expected output and optional metadata. You run experiments against a dataset to compare prompts, models or versions of your application on the same inputs.
Open it from Gauge AI → Datasets. Every built-in role except Auditor can create datasets and work with the ones they created. See Who can do what.
Who can do what
| Role | Datasets | Experiments |
|---|---|---|
| Owner | Every dataset in the project | Start prompt and remote experiments |
| Department Admin, Security & Compliance, Cost Analyst, Manager Viewer, End User | Create datasets. Edit, duplicate and delete their own datasets, add and change items, upload CSV and delete runs on them. | View runs. Cannot start experiments. |
| Auditor | No access | No access |
- A dataset belongs to the member who created it in the app. Other members with these roles cannot see it.
- Datasets with no recorded creator, such as datasets created before creators were recorded or through the public API, are visible to these roles but read-only for them.
- Starting an experiment calls a model with the project's LLM connection, so among the built-in roles only Owner can do it.
- Custom roles use the Datasets and experiments module: Read & Write gives the own-dataset access above, and Admin gives every dataset and starting prompt and remote experiments. See Custom Roles.
Create a dataset
Create it
On the Datasets page select New dataset. Enter a Name, an optional Description and optional Metadata (JSON). A / in the name groups datasets into folders, for example support/regression.
From code:
Add items
Add items in any of these ways:
- By hand. On the dataset, select Create new dataset item and enter Input, Expected output and Metadata as JSON.
- From CSV. Select Upload CSV, map each column to input, expected output, metadata or not mapped, check the preview and import. Files can be up to 10 MB.
- From a trace. On a trace or observation, select Add to datasets (or Add to more datasets when it is already in one), pick one or more datasets, and select Add to dataset or Add to datasets. The input and output are copied into a new item, which keeps a link to its source trace. To add to a dataset that does not exist yet, select Create new dataset in the form: the new dataset is selected for you and you stay on the trace.
- From code or the API. Use the SDK or
POST /api/public/dataset-items.
Run an experiment
Select New experiment on the dataset. See Experiments.
Item fields
| Field | Required | Notes |
|---|---|---|
input | Yes | Any JSON. For prompt experiments, its keys must match the prompt's variables. |
expected_output | No | The ideal answer, used by evaluators and your own checks. |
metadata | No | Any JSON, such as category or difficulty. |
source_trace_id, source_observation_id | No | Set when the item was created from a trace. |
status | No | ACTIVE or ARCHIVED. Prompt experiments skip archived items. In your own code, check item.status. |
Pass id= to create_dataset_item to update an existing item instead of creating a new one.
The item form in the app warns when Input is empty, because such an item cannot run in an experiment. Items added from chat or Budget AI traces often have a list of messages as input, which prompt experiments cannot use. For those, the form offers Wrap as {"messages": [...]}: use it with a chat prompt that has a message placeholder named messages.
Read a dataset in code
To run your own application over the items and record the results as a run, see Custom experiments.
Runs and comparison
Each experiment creates a run on the dataset. Open the dataset's Runs tab to see them. The runs table shows, per run, the number of run items, average latency, average total cost, aggregated run item scores and run-level scores. Select runs and choose Compare to see outputs and scores for each item side by side. Each run item links to its trace.
Other actions
- Duplicate dataset copies a dataset and its items.
- Edit changes the name, description and metadata.
- Delete a dataset, an item or a run. Deleting cannot be undone.
- Export on the items table exports the items as CSV, JSON or JSONL. Among the built-in roles only Owner can export dataset items; roles without data export access see "Export is not available for your role." See Data Exports.
- Datasets, items and runs are also available through the public API. See API Reference.