1

Install the Atla Python Library

Start by installing the Atla Python library. From the terminal run the following:

pip install atla
2

Set up your API key

To use Atla, you’ll need to provide your Atla API key. You can set the environment variable with your API key or create a local .env file which contains the API key.

If you haven’t set up your account yet, you can do so on the sign up page.

export ATLA_API_KEY=pk-abc123
3

Send your first eval

The final step is to send your first evaluation request to Atla. Create a new Python file (e.g. atla_test.py) and add the following code:

from atla import Atla

client = Atla(
  # defaults to os.environ.get("ATLA_API_KEY")
  api_key="my_api_key"
)

evals = client.evaluation.create(
  input="If 5 machines take 5 minutes to make 5 widgets, how long would it take 100 machines to make 100 widgets?",
  response="Total processing time is 5 widgets * 5 minutes = 25 minutes. Then 25 mins / 100 machines = 15 seconds.",
  metrics=["logical_coherence"],
)

print(f"Atla's score: {evals.evaluations['logical_coherence'].score} / 5")
print(f"Atla's critique: {evals.evaluations['logical_coherence'].critique}")

To run the code, enter python atla_test.py into the terminal.

Atla will return a score and a critique for the response based on the input provided.

Next steps

Now that you have performed your first evaluations, explore what else is possible with Atla.