> This page is for version v4.0.
> 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.

> This guide demonstrates how to run a batch generation using a large language model across all the datapoints in a dataset.

This guide demonstrates how to run a batch generation across all the datapoints in a dataset.

**Prerequistes**

* A [Prompt](/docs/explanation/prompts)) in Humanloop
* A [dataset](/docs/explanation/datasets) in that project

## Create a model config

It's important that the model config we use to perform the batch generation is consistent with the dataset. We're going to use the simple customer support dataset that we uploaded in the previous [Create a dataset guide](/docs/v4/guides/create-dataset). As a reminder, the dataset looks like this

![The underlying data for our \`customer\_queries\` dataset.](/docs/_fern-img/346ec171ede357009e83f4d99c7c27a5fb45602a4ebbc87abe56e31338fe487a.webp)

We want to get the model to classify the customer support query into the appropriate category. For this dataset, we have specified the correct category for each datapoint, so we'll be able to know easily if the model produced the correct output.

### In Editor, create a simple completion model config as below.

![](/docs/_fern-img/bd943240df6585f4edc90ed1644384511ada1c0dffcc6d8c6928d3937a1ca9d1.webp)

We've used the following prompt:

```
You are a customer support classifier for Humanloop, a platform for building applications with LLMs.

Please classify the following customer support query into one of these categories:
[datasets, docs, evaluators, feedback, fine-tuning, model configs, model providers]

{{user_query}}

The most important thing here is that we have included a **prompt variable** - `{{ user_query }}` which corresponds to the input key on all the datapoints in our dataset. This was the first column header in the CSV file we used to upload the dataset.
```

### Save the model config by clicking the **Save** button. Call the config `support_classifier`.

### Go to the **Datasets** tab

### Click the menu icon in the top-right corner of the dataset you want to perform a batch generation across.

### In that menu, choose **Batch Generate & Eval**

![Trigger a batch generation on a dataset from this menu.](/docs/_fern-img/2c39c564fa56cfdbad0424159aa8bef873a41172126aecb86c8361905155f3c8.webp)

### In the dialog window, choose the `support_classifier` model config created in step 2.

### You can also optionally select an evaluator to use to compare the model's generation output to the target output in each datapoint. We set up the `Exact match` offline evaluator in our project (it's one of the builtins and requires no further configuration).

### Click **Batch generate**

### Follow the link in the pop-up to the batch generation run which is under the **Evaluations** tab.

![The batch generate output view, including an \*\*exact match\*\* evaluator.](/docs/_fern-img/9ec382154ed8c14417d1a1dd859ce79a1875ee087af9fa73d11795bd2daf872e.webp)

The output the model produced is shown in the **output** column, and the exact match column shows that the model produced the expected (target) output in most cases. From here, we could inspect the failing cases and iterate on our model config before testing again to see if the accuracy across the whole dataset has improved.