# Quickstart

This guide walks you through using the Distributional SDK to create your first project, submit two runs and create a test session to compare the behavior of your AI application over time.

{% stepper %}
{% step %}

### Install the `dbnl` SDK.

First, if you haven't done so already, install the DBNL Python SDK.

```bash
pip install dbnl
```

{% endstep %}

{% step %}

### Export the DBNL environment variables

If you haven't done so already, create a personal access token by going to **☰ > Personal Access Tokens**.&#x20;

Run this command to export the path to the API for your deployment and your personal access token as environment variables.

```bash
export DBNL_API_URL="YOUR_DBNL_API_URL"
export DBNL_API_TOKEN="YOUR_PERSONAL_ACCESS_TOKEN"
```

{% endstep %}

{% step %}

### Create and test two Runs

In a Python script or notebook, add the following code to create two Runs and test them in a Test Session using the first Run as the baseline and the second Run as the experiment.

```python
import random
from datetime import datetime

import dbnl
import pandas as pd

# Login to dbnl.
dbnl.login()

# Create a new project
now = datetime.now().isoformat()
project = dbnl.get_or_create_project(name=f"quickstart-{now}")

# Submit a first run (baseline)
run1 = dbnl.report_run_with_results(
    project=project,
    display_name="run1",
    column_data=pd.DataFrame([
        {
            "question": f"Is {i} an even or odd number?",
            "answer": random.choice(["even", "odd"]),
        }
        for i in range(20)
    ]).astype({"question": "string", "answer": "category"}),
)

# Submit a second run (experiment)
run2 = dbnl.report_run_with_results(
    project=project,
    display_name="run2",
    column_data=pd.DataFrame([
        {
            "question": f"Is {i} an even or odd number?",
            "answer": random.choice(["even", "odd"]),
        }
        for i in range(20)
    ]).astype({"question": "string", "answer": "category"}),
)

# Create a test session.
dbnl.set_run_as_baseline(run=run1)
dbnl.create_test_session(experiment_run=run2)
```

{% endstep %}

{% step %}

### View your Test Session results

Congratulations! You ran your first Test Session. You can see the results of the Test Session by navigating to your project in the DBNL app and selecting your Test Session from the Test Session table.

By default, a Similarity Index test is added that tests whether your application has changed between the Baseline and Experiment Run.

<figure><img src="https://content.gitbook.com/content/OMjGNg2NTV4gBwKOIb1S/blobs/HZowXBHfIDe90B0rGhuw/Screenshot%202025-04-11%20at%2012.04.10%E2%80%AFPM.png" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

## Next Steps

* Create a [Project](https://docs.dbnl.com/v0.23.x/using-distributional/projects) for your own AI application.
* Upload your own data as [Runs](https://docs.dbnl.com/v0.23.x/using-distributional/runs) to your Project.
* Define [Metrics](https://docs.dbnl.com/v0.23.x/using-distributional/metrics) to augment your Runs with novel quantities.
* Add more [Tests](https://docs.dbnl.com/v0.23.x/using-distributional/tests) to ensure your application behaves as expected.
* Learn more about [Similarity Index](https://docs.dbnl.com/v0.23.x/using-distributional/tests/reviewing-tests/what-is-a-similarity-index).
* Use [Notifications](https://docs.dbnl.com/v0.23.x/using-distributional/notifications) to be alerted when tests fail.
