> ## Documentation Index
> Fetch the complete documentation index at: https://docs.intellikon.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Datasets and evaluations

> Collect sample inputs, run prompts against them, score the answers and evaluate every new version automatically.

An evaluation runs a prompt against sample inputs and, if you add scorers, scores each answer, so you can see whether a new version or a different model does better before you release it. The inputs come from a dataset or from values you type in. The scores come from scorers: marking guides that an AI judge applies to each answer. Nucleus includes **Coherence**, **Faithfulness** and **Relevance** scorers, and you can write your own.

## Before you start

Tenant Owners, Workspace Admins and Workspace Members can create datasets and run evaluations. Only Tenant Owners and Workspace Admins can create or change scorers. The models you can compare are the ones your workspace allows for Nucleus in Studio settings, under **AI Models**.

## Start a dataset

<Frame>
  <img src="https://mintcdn.com/intellikon-ai-ltd/wM16d87Um0QW2CyJ/images/nucleus/create-a-dataset.png?fit=max&auto=format&n=wM16d87Um0QW2CyJ&q=85&s=47bef7aca4e0119cb756655dbc9f98ab" alt="The top of the New dataset form, with the three sources, From Observability chosen, and Name & Tags." width="2210" height="760" data-path="images/nucleus/create-a-dataset.png" />
</Frame>

A dataset is a named set of input rows, each holding a value for the prompt's variables and, if you want, the answer you expect.

<Steps>
  <Step title="Start a dataset">
    Select **Datasets**, then **New dataset**.
  </Step>

  <Step title="Choose where the rows come from">
    Choose **From Observability** to use real requests, **Manual** to type rows yourself, or **Upload CSV / JSONL** to use a file.
  </Step>

  <Step title="Name it">
    Enter a **Name**. The **Slug** fills in from it.
  </Step>

  <Step title="Describe it">
    Add a **Description** if you want.
  </Step>

  <Step title="Tag it">
    Add **Tags** if you want.
  </Step>
</Steps>

Under **Rows**, the form shows the fields for the source you chose. Next, [add the rows](#add-the-rows).

## Add the rows

<Steps>
  <Step title="Choose the prompt">
    If you chose **From Observability**, choose the **Prompt**.
  </Step>

  <Step title="Choose how far back to look">
    If you chose **From Observability**, choose how many days back to look under **Window (days)**.
  </Step>

  <Step title="Fill in the rows">
    If you chose **Manual**, fill in each row.
  </Step>

  <Step title="Add more rows">
    If you chose **Manual** and need more rows, select **Add row**.
  </Step>

  <Step title="Add the file">
    If you chose **Upload CSV / JSONL**, drop the file in.
  </Step>

  <Step title="Check the file">
    If you added a file, select **Preview** to check it.
  </Step>

  <Step title="Create it">
    Select **Create dataset**.
  </Step>
</Steps>

For **Manual** rows, write the inputs under **input\_variables (JSON)** with one entry per variable, such as `{ "ticket": "The van will not start" }`. Add the answer you hope for under **expected\_output (optional)**.

The dataset opens, and it is listed in **Datasets** with its number of rows. Next, [set up an evaluation](#set-up-an-evaluation) with it.

## Set up an evaluation

<Frame>
  <img src="https://mintcdn.com/intellikon-ai-ltd/wM16d87Um0QW2CyJ/images/nucleus/run-an-evaluation.png?fit=max&auto=format&n=wM16d87Um0QW2CyJ&q=85&s=192e953be75a8e56242fea14f2b39c21" alt="The New Evaluation tab, with the three evaluation types to choose from, then Configure, Scorers and Input, and the name box and Run evaluation button at the bottom." width="2880" height="1952" data-path="images/nucleus/run-an-evaluation.png" />
</Frame>

<Steps>
  <Step title="Start an evaluation">
    Select **Evaluations**, then **New Evaluation**.
  </Step>

  <Step title="Choose what to compare">
    Choose **Model comparison** to try one version on several models, **Version comparison** to try several versions on one model, or **Full matrix** to try every combination.
  </Step>

  <Step title="Choose the prompt">
    Pick the **Prompt**.
  </Step>

  <Step title="Choose the versions">
    Pick the versions to compare.
  </Step>

  <Step title="Choose the models">
    Pick the models to compare.
  </Step>

  <Step title="Add scorers">
    Under **Scorers**, select the scorers to mark each answer with. This is optional.
  </Step>
</Steps>

**Input** is next on the form. Next, [add input and run the evaluation](#add-input-and-run-the-evaluation).

## Add input and run the evaluation

<Steps>
  <Step title="Choose the input">
    Under **Input**, stay on **Manual** or choose **From dataset**.
  </Step>

  <Step title="Fill in the values">
    If you stayed on **Manual**, fill in the values.
  </Step>

  <Step title="Pick the dataset">
    If you chose **From dataset**, pick the **Dataset**.
  </Step>

  <Step title="Pick the dataset version">
    If you chose **From dataset**, pick its **Version**.
  </Step>

  <Step title="Name it">
    Change the name if you want.
  </Step>

  <Step title="Run it">
    Select **Run evaluation**.
  </Step>
</Steps>

**Results** shows the run's progress, then the answers once it finishes. The run is also listed under **Runs**. Every answer is a real request to the model, and each scorer adds a request to its judge. Next, [read the results](#read-the-results).

## Read the results

Select a run under **Runs** to open it. Each result shows the model and version, the answer, its scores and how long it took. **Mean per scorer** at the bottom gives the average score for each scorer across the run.

To record which result you prefer, select the thumbs-up on it. The result is marked with a crown, and the run's **Winner** column in **Runs** shows it. Next, [evaluate every new version automatically](#evaluate-every-new-version-automatically).

## Create a scorer

<Frame>
  <img src="https://mintcdn.com/intellikon-ai-ltd/wM16d87Um0QW2CyJ/images/nucleus/create-a-scorer.png?fit=max&auto=format&n=wM16d87Um0QW2CyJ&q=85&s=b8ac9ad82fba55ad21b30a2f4a316018" alt="The New scorer window, with Slug, Name, Description and the Rubric." width="1480" height="644" data-path="images/nucleus/create-a-scorer.png" />
</Frame>

<Steps>
  <Step title="Open the scorers">
    Select **Evaluations**, then the **Scorers** tab, then **New scorer**.
  </Step>

  <Step title="Name it">
    Enter a **Name**.
  </Step>

  <Step title="Give it a slug">
    Enter a **Slug**.
  </Step>

  <Step title="Describe it">
    Enter a **Description** that helps your team pick it.
  </Step>

  <Step title="Write the rubric">
    Under **Rubric**, describe what each score means. The judge sees exactly this, so be specific.
  </Step>

  <Step title="Choose the judge">
    Pick the **Judge model**.
  </Step>

  <Step title="Choose the scale">
    Pick the **Scale**.
  </Step>

  <Step title="Create it">
    Select **Create scorer**.
  </Step>
</Steps>

The scorer appears under **Workspace scorers**, and you can add it to any evaluation in this workspace. Next, [set up an evaluation](#set-up-an-evaluation) with it.

## Evaluate every new version automatically

<Frame>
  <img src="https://mintcdn.com/intellikon-ai-ltd/wM16d87Um0QW2CyJ/images/nucleus/evaluate-automatically.png?fit=max&auto=format&n=wM16d87Um0QW2CyJ&q=85&s=3c4748f9dcfe425964be8b6fd76b9280" alt="Advanced configuration open on a prompt, with the Auto-evaluation switch, the Auto-evaluate on save box, the Default dataset menu, the Pass threshold field, the Default scorers and Save auto-eval settings." width="1060" height="730" data-path="images/nucleus/evaluate-automatically.png" />
</Frame>

With automatic evaluation on, every version you save is run against a dataset and scored, and Nucleus uses the result when you promote.

<Steps>
  <Step title="Open the prompt">
    Select **Prompts**, then the prompt.
  </Step>

  <Step title="Open the settings">
    Select **Advanced configuration**.
  </Step>

  <Step title="Turn it on">
    Tick **Auto-evaluate on save**.
  </Step>

  <Step title="Choose the dataset">
    Pick a **Default dataset**.
  </Step>

  <Step title="Choose the scorers">
    Select one or more **Default scorers**.
  </Step>

  <Step title="Set a pass mark if you want one">
    Under **Pass threshold (optional)**, enter the average score a version needs.
  </Step>

  <Step title="Save">
    Select **Save auto-eval settings**.
  </Step>
</Steps>

From now on, each version you save is evaluated. Next, [promote the version](/products/nucleus/releasing-prompts).

## Troubleshooting

<Accordion title="Run evaluation stays greyed out">
  Choose a prompt, and as many models and versions as the evaluation type asks for. **Model comparison** needs at least two models, and **Version comparison** at least two versions.
</Accordion>

<Accordion title="A manual row says &#x22;input_variables is not valid JSON&#x22;">
  Check the row's braces and quotation marks. Each entry needs its name and its value in double quotes, such as `{ "ticket": "The van will not start" }`.
</Accordion>

<Accordion title="Nucleus says &#x22;Slug must be kebab-case&#x22;">
  Use only lower-case letters, numbers and hyphens in the **Slug**, such as `van-breakdown-tickets`.
</Accordion>

<Accordion title="Advanced configuration says &#x22;saves will skip&#x22;">
  Automatic evaluation needs a **Default dataset** and at least one **Default scorer**. Pick both, then select **Save auto-eval settings**.
</Accordion>

<Accordion title="New scorer is not there">
  Only Tenant Owners and Workspace Admins can create scorers. You can still use the ones listed in any evaluation.
</Accordion>
