Skip to main content
Now that you have Phoenix up and running, and sent traces to your first project, the next step you can take is running evaluations of your Python application. Evaluations let you measure and monitor the quality of your application by scoring traces against metrics like accuracy, relevance, or custom checks.
1

Launch Phoenix

Before running evals, make sure Phoenix is running & you have sent traces in your project. For more step by step instructions, check out this Get Started guide & Get Started with Tracing guide.
Run Phoenix on your own infrastructure, backed by PostgreSQL so traces persist beyond a single process. This is the option to reach for once Phoenix is shared across a team or environment.The self-hosting guide covers Kubernetes, Helm, Railway, AWS CloudFormation, Google Cloud Run, Azure, and Render, plus authentication and configuration.
Phoenix serves its UI and OTLP HTTP on port 6006, and OTLP gRPC on port 4317. For a local instance that’s http://localhost:6006 — leave it running while you work.
Next, tell the Phoenix client where that instance lives. Run this alongside the rest of the code in this guide (in your notebook or script):Point your code at the Phoenix instance you started. The endpoint below is the default for a local phoenix serve; for a deployment running elsewhere, use its hostname instead.
2

Install Phoenix Evals

You’ll need to install the evals library that’s apart of Phoenix.
3

Pull down your Trace Data

Since, we are running our evaluations on our trace data from our first project, we’ll need to pull that data into our code.
4

Set Up Evaluations

In this example, we will define, create, and run our own evaluator. There’s a number of different evaluators you can run, but this quick start will go through an LLM as a Judge Model.1) Define your LLM Judge ModelWe’ll use OpenAI as our evaluation model for this example, but Phoenix also supports a number of other models.If you haven’t yet defined your OpenAI API Key from the previous step, let’s first add it to our environment.
2) Define your EvaluatorsWe will set up a Q&A correctness Evaluator with the LLM of choice. I want to first define my LLM-as-a-Judge prompt template. Most LLM-as-a-judge evaluations can be framed as a classification task where the output is one of two or more categorical labels.
Now we want to define our Classification Evaluator
5

Run Evaluation

Now that we have defined our evaluator, we’re ready to evaluate our traces.
6

Log results to Visualize in Phoenix

You’ll now be able to log your evaluations in your project view.First, format the evaluation results for logging using the to_annotation_dataframe utility:
Then log the annotations to Phoenix:

Learn More:

Evaluation Concepts

Evals in Phoenix