> This page is for version v5.0 (default).
> For other versions, use one of these documentation indexes:
> - v5.0 (default): https://humanloop.com/docs/v5/llms.txt
> - v4.0: https://humanloop.com/docs/v4/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://humanloop.com/docs/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://humanloop.com/docs/_mcp/server.

> Learn how to create Datasets in Humanloop to define fixed examples for your projects, and build up a collection of input-output pairs for evaluation and fine-tuning.

[Datasets](/docs/explanation/datasets) are a collection of input-output pairs that can be used to evaluate your Prompts, Tools or even Evaluators.

### Prerequisites

You should have an existing [Prompt](/docs/explanation/prompts) on Humanloop with a variable defined with our double curly bracket syntax `{{variable}}`. If not, first follow our guide on [creating a Prompt](../prompts/create-prompt).

In this example, we'll use a Prompt that categorises user queries about Humanloop's product and docs by which feature they relate to.

![An example Prompt with a variable \`\{\{query}}\`.](/docs/_fern-img/c472e1a18df70a05953765e200c66067d5acac3d2a87b44fe73c3b3592483421.webp)

## Steps

To create a dataset from a CSV file, we'll first create a CSV in Google Sheets that contains values for our Prompt variable `{{query}}` and then upload it to a Dataset on Humanloop.

### Create a CSV file.

* In our Google Sheets example below, we have a column called `query` which contains possible values for our Prompt variable `{{query}}`. You can include as many columns as you have variables in your Prompt template.
* There is additionally a column called `target` which will populate the target output for the classifier Prompt. In this case, we use simple strings to define the target.
* More complex Datapoints that contain `messages` and structured objects for targets are supported, but are harder to incorporate into a CSV file as they tend to be hard-to-read JSON. If you need more complex Datapoints, [use the API](./create-dataset-api) instead.

![A CSV file in Google Sheets defining query and target pairs for our Classifier Prompt.](/docs/_fern-img/9179d48b3837925296c836395af00e86379a235c0126c2f739bb53b662ad97fd.webp)

### Export the Google Sheet to CSV

In Google Sheets, choose **File** → **Download** → **Comma-separated values (.csv)**

### Create a new Dataset File

On Humanloop, select *New* at the bottom of the left-hand sidebar, then select *Dataset*.

![Create a new File from the sidebar on Humanloop.](/docs/_fern-img/e5cd589777e20bb4271d11d6bd0faadaaa3d60aaa3866338fed070b33fb7db40.webp)

### Click **Upload CSV**

First name your dataset when prompted in the sidebar, then select the **Upload CSV** button and drag and drop the CSV file you created above using the file explorer.
Press **Upload Dataset from CSV...**.

![Uploading a CSV file to create a dataset.](/docs/_fern-img/bf4091a4e9ef288b81577e4ed1d5d01941ab06d56415a2ca03b1bc686490e9b7.webp)

### Map the CSV columns

Map each of the CSV columns into one of `input`, `message`, `target`. To avoid uploading a column of your CSV you can map it to the `exclude` option.

To map in columns to Messages, they need to be in a specific format. An example of this can be seen in our example Dataset or below:

```
"[{""role"": ""user"", ""content"": ""Tell me about the weather""}]"
```

Once you have mapped your columns, press **Extend Current Dataset**

![Mapping columns of a CSV into specific values of a dataset.](/docs/_fern-img/b2ccce3f5967682dd30acdef1fe5b75b5b15e54ef77cf7214892d14192cdb42a.webp)

### Review your uploaded datapoints

You'll see the input-output pairs that were included in the CSV file and you can review the rows to inspect and edit the individual Datapoints.

![Inspect the Dataset created from the CSV file.](/docs/_fern-img/77772fffd3f1703ab6dfc78774853d4a24c24f1d7be4f2d30f2d1314b30e3746.webp)

### Save the Dataset

Click the **Save** button at the top of the Dataset editor and optionally provide a name and description for this version. Press **Save** again.

![Save a Dataset.](/docs/_fern-img/19f56d66ec18fd6694de316052b8461cf96f9709362a383153bb763cdcbb770a.webp)

Your dataset is now uploaded and ready for use.

## Next steps

🎉 Now that you have Datasets defined in Humanloop, you can leverage our [Evaluations](./overview) feature to systematically measure and improve the performance of your AI applications.
See our guides on [setting up Evaluators](./llm-as-a-judge) and [Running an Evaluation](/docs/guides/evals/run-evaluation-ui) to get started.

For different ways to create datasets, see the links below:

* [Create a Dataset from existing Logs](./create-dataset-from-logs) - useful for curating Datasets based on how your AI application has been behaving in the wild.
* [Upload via API](./create-dataset-api) - useful for uploading more complex Datasets that may have nested JSON structures, which are difficult to represent in tabular .CSV format, and for integrating with your existing data pipelines.