Phoenix
Ask or search…
K
Links

Manage the App

How to define your dataset(s), launch a session, open the UI in your notebook or browser, and close your session when you're done

Define Your Dataset(s)

For a conceptual overview of datasets, including an explanation of when to use a single dataset vs. primary and reference datasets, see Phoenix Basics.
To define a dataset, you must load your data into a pandas dataframe and create a matching schema. If you have a dataframe prim_df and a matching prim_schema, you can define a dataset named "primary" with
prim_ds = px.Dataset(prim_df, prim_schema, "primary")
If you additionally have a dataframe ref_df and a matching ref_schema, you can define a dataset named "reference" with
ref_ds = px.Dataset(ref_df, ref_schema, "reference")
See Corpus Data if you have corpus data for an Information Retrieval use case.

Launch the App

Use phoenix.launch_app to start your Phoenix session in the background. You can launch Phoenix with zero, one, or two datasets.
No Dataset
session = px.launch_app()
  • Run Phoenix in the background to collect OpenInference traces emitted by your instrumented LLM application.
Single Dataset
session = px.launch_app(ds)
  • Analyze a single cohort of data, e.g., only training data.
  • Check model performance and data quality, but not drift.
Primary and Reference Datasets
session = px.launch_app(prim_ds, ref_ds)
  • Compare cohorts of data, e.g., training vs. production.
  • Analyze drift in addition to model performance and data quality.
Primary and Corpus Datasets
session = px.launch_app(query_ds, corpus=corpus_ds)
  • Compare a query dataset to a corpus dataset to analyze your retrieval-augmented generation applications.

Open the UI

You can view and interact with the Phoenix UI either directly in your notebook or in a separate browser tab or window.
In the Browser
In Your Notebook
In a notebook cell, run
session.url
Copy and paste the output URL into a new browser tab or window.
Browser-based sessions are supported in both local Jupyter environments and Colab.
In a notebook cell, run
session.view()
The Phoenix UI will appear in an inline frame in the cell output.
The height of the window can be adjusted by passing a height parameter, e.g., session.view(height=1200). Defaults to 1000 pixels.

Close the App

When you're done using Phoenix, gracefully shut down your running background session with
px.close_app()