Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Phoenix provides SDK and API access to log, query, and evaluate LLM traces across Python, TypeScript, and REST interfaces. Our documentation offers flexible integration points to fit your workflow.
Install via pip
.
Phoenix API key can be an environment variable...
...or passed directly to the client.
By default, the Phoenix client will use the bearer authentication scheme in the HTTP headers, but if you need different headers, e.g. for Phoenix Cloud, they can also be customized via an environment variable...
...or passed directly to the client.
With the Phoenix client, you can push and pull prompts to and from your Phoenix server.
The client can retrieve a prompt by its name.
The prompt can be used to generate completions.
The Phoenix client provides synchronous and asynchronous interfaces for interacting with Phoenix Projects.
Get a project by ID or name
List all projects
Create a new project with optional description
Update a project’s description (note: names cannot be changed)
Delete a project by ID or name
REST API methods for interacting with Phoenix prompts
MCP server implementation for Arize Phoenix providing unified interface to Phoenix's capabilities.
Phoenix MCP Server is an implementation of the Model Context Protocol for the Arize Phoenix platform. It provides a unified interface to Phoenix's capabilites.
You can use Phoenix MCP Server for:
Prompts Management: Create, list, update, and iterate on prompts
Datasets: Explore datasets, and syntesize new examples
Experiments: Pull experiment results and visualize them with the help of an LLM
This MCP server can be used using npx
and can be directly integrated with clients like Claude Desktop, Cursor, and more.
This package is managed via a pnpm workspace.
This only needs to be repeated if dependencies change or there is a change to the phoenix-client.
To build the project:
To run in development mode:
You can build and run the MCP inspector using the following:
When developing, the server requires the following environment variables:
PHOENIX_API_KEY
: Your Phoenix API key
PHOENIX_BASE_URL
: The base URL for Phoenix
Make sure to set these in a .env
file. See .env.example
.
Apache 2.0
- Interact with Phoenix's OpenAPI REST interface
- Methods for loading, inspecting, and interacting with tracing and evaluation sessions
- Upload and download data to and from Phoenix
- Define and run evaluations across models, traces, or datasets
- Track, evaluate, and compare multiple runs under different conditions
- Integrate tracing and metrics using OpenTelemetry for automatic or manual instrumentation
- Transform spans and evaluations into datasets, define structures for features and predictions, and manage embedding columns
- Pull, push, and invoke prompts stored in Phoenix
- Create, read, update, and delete projects in Phoenix
To learn more about prompt engineering using Phenix, see the .
Don't see a use-case covered? @arizeai/phoenix-mcp
is ! Issues and PRs welcome.
Phoenix Client is a lightweight package for interacting with the Phoenix server.
The Python client is currently a work in progress. Please refer to the status below for the latest updates.
API - Interact with Phoenix's OpenAPI REST interface
Prompt Management - Pull / push / and invoke prompts stored in Phoenix
Install via pip
.
Phoenix API key can be an environment variable...
...or passed directly to the client.
By default, the Phoenix client will use the bearer authentication scheme in the HTTP headers, but if you need different headers, e.g. for Phoenix Cloud, they can also be customized via an environment variable...
...or passed directly to the client.
With the Phoenix client, you can push and pull prompts to and from your Phoenix server.
The client can retrieve a prompt by its name.
The prompt can be used to generate completions.
To learn more about prompt engineering using Phenix, see the .
REST API methods for interacting with Phoenix experiments
REST API methods for interacting with Phoenix spans
REST API methods for interacting with Phoenix datasets
For an up-to-date OpenAPI text file that contains descriptions of all the REST API endpoints, see here:
REST API
Documentation for REST API methods
REST API methods for interacting with Phoenix traces
REST API methods for interacting with Phoenix projects
Tooling to evaluate LLM applications including RAG relevance, answer relevance, and more.
Phoenix's approach to LLM evals is notable for the following reasons:
Includes pre-tested templates and convenience functions for a set of common Eval “tasks”
Data science rigor applied to the testing of model and template combinations
Designed to run as fast as possible on batches of data
Includes benchmark datasets and tests for each eval function
Install the arize-phoenix sub-package via pip
Note you will also have to install the LLM vendor SDK you would like to use with LLM Evals. For example, to use OpenAI's GPT-4, you will need to install the OpenAI Python SDK:
Here is an example of running the RAG relevance eval on a dataset of Wikipedia questions and answers:
Provides a lightweight wrapper around OpenTelemetry primitives with Phoenix-aware defaults. Phoenix Otel also gives you acces to tracing decorators for common GenAI patterns.
These defaults are aware of environment variables you may have set to configure Phoenix:
PHOENIX_COLLECTOR_ENDPOINT
PHOENIX_PROJECT_NAME
PHOENIX_CLIENT_HEADERS
PHOENIX_API_KEY
PHOENIX_GRPC_PORT
Install via pip
.
The phoenix.otel
module provides a high-level register
function to configure OpenTelemetry
tracing by setting a global TracerProvider
. The register function can also configure headers
and whether or not to process spans one by one or by batch.
This is all you need to get started using OTel with Phoenix! register
defaults to sending spans
to an endpoint at http://localhost
using gRPC.
If the PHOENIX_API_KEY
environment variable is set, register
will automatically add anauthorization
header to each span payload.
There are two ways to configure the collector endpoint:
Using environment variables
Using the endpoint
keyword argument
Using environment variables
If you're setting the PHOENIX_COLLECTOR_ENDPOINT
environment variable, register
will
automatically try to send spans to your Phoenix server using gRPC.
Specifying the endpoint
directly
When passing in the endpoint
argument, you must specify the fully qualified endpoint. For
example, in order to export spans via HTTP to localhost, use Pheonix's HTTP collector endpoint:http://localhost:6006/v1/traces
. The default gRPC endpoint is different: http://localhost:4317
.
If the PHOENIX_GRPC_PORT
environment variable is set, it will override the default gRPC port.
Additionally, the protocol
argument can be used to enforce the OTLP transport protocol
regardless of the endpoint specified. This might be useful in cases such as when the GRPC
endpoint is bound to a different port than the default (4317). The valid protocols are:
"http/protobuf", and "grpc".
register
can be configured with different keyword arguments:
project_name
: The Phoenix project name (or PHOENIX_PROJECT_NAME
env. var)
headers
: Headers to send along with each span payload (or PHOENIX_CLIENT_HEADERS
env. var)
batch
: Whether or not to process spans in batch
For more granular tracing configuration, these wrappers can be used as drop-in replacements for OTel primitives:
Wrappers have Phoenix-aware defaults to greatly simplify the OTel configuration process. A specialendpoint
keyword argument can be passed to either a TracerProvider
, SimpleSpanProcessor
orBatchSpanProcessor
in order to automatically infer which SpanExporter
to use to simplify setup.
Specifying the endpoint
directly
Users can gradually add OTel components as desired:
To learn more about LLM Evals, see the .
This package provides a TypeSript client for the Arize Phoenix API.
The client will automatically read environment variables from your environment, if available.
The following environment variables are used:
PHOENIX_HOST
- The base URL of the Phoenix API.
PHOENIX_API_KEY
- The API key to use for authentication.
PHOENIX_CLIENT_HEADERS
- Custom headers to add to all requests. A JSON stringified object.
Alternatively, you can pass configuration options to the client directly, and they will be prioritized over environment variables and default values.
@arizeai/phoenix-client
provides a prompts
export that exposes utilities for working with prompts for LLMs.
The createPrompt
function can be used to create a prompt in Phoenix for version control and reuse.
Prompts that are pushed to Phoenix are versioned and can be tagged.
The getPrompt
function can be used to pull a prompt from Phoenix based on some Prompt Identifier and returns it in the Phoenix SDK Prompt type.
The toSDK
helper function can be used to convert a Phoenix Prompt to the format expected by an LLM provider SDK. You can then use the LLM provider SDK as normal, with your prompt.
If your Prompt is saved in Phoenix as openai
, you can use the toSDK
function to convert the prompt to the format expected by OpenAI, or even Anthropic and Vercel AI SDK. We will do a best
effort conversion to your LLM provider SDK of choice.
The following LLM provider SDKs are supported:
Endpoints are accessible via strongly-typed string literals and TypeScript auto-completion inside of the client object.
To run examples, install dependencies using pnpm
and run:
Because of this, this package only works with the arize-phonix
server 8.0.0 and above.
Compatibility Table:
Vercel AI SDK: ai
OpenAI: openai
Anthropic: anthropic
The client provides a REST API for all endpoints defined in the .
A comprehensive overview of the available endpoints and their parameters is available in the OpenAPI viewer within Phoenix, or in the .
This package utilizes to generate the types from the Phoenix OpenAPI spec.
^1.0.0
^8.0.0
Retrieve a paginated list of all prompts in the system. A prompt can have multiple versions.
Cursor for pagination (base64-encoded prompt ID)
The max number of prompts to return at a time.
100
Retrieve all versions of a specific prompt with pagination support. Each prompt can have multiple versions with different configurations.
The identifier of the prompt, i.e. name or ID.
Cursor for pagination (base64-encoded promptVersion ID)
The max number of prompt versions to return at a time.
100
Retrieve a specific prompt version using its tag name. Tags are used to identify specific versions of a prompt.
The identifier of the prompt, i.e. name or ID.
The tag of the prompt version
Retrieve the most recent version of a specific prompt.
The identifier of the prompt, i.e. name or ID.
Add a new tag to a specific prompt version. Tags help identify and categorize different versions of a prompt.
The ID of the prompt version.
^[a-z0-9]([_a-z0-9-]*[a-z0-9])?$
No content
Retrieve all tags associated with a specific prompt version. Tags are used to identify and categorize different versions of a prompt.
The ID of the prompt version.
Cursor for pagination (base64-encoded promptVersionTag ID)
The max number of tags to return at a time.
100
Retrieve a specific prompt version using its unique identifier. A prompt version contains the actual template and configuration.
The ID of the prompt version.
Retrieve a paginated list of all users in the system.
Cursor for pagination (base64-encoded user ID)
The max number of users to return at a time.
100
Delete an existing user by their unique GlobalID.
The GlobalID of the user (e.g. 'VXNlcjox').
No content
Create a new user with the specified configuration.
true
Details of the experiment to be created
Name of the experiment (if omitted, a random name will be generated)
An optional description of the experiment
Metadata for the experiment
ID of the dataset version over which the experiment will be run (if omitted, the latest version will be used)
Number of times the experiment should be repeated for each example
1
Cursor for pagination
An optional dataset name to filter by
The max number of datasets to return at a time.
10
The ID of the dataset
Cursor for pagination
The max number of dataset versions to return at a time
10
If true, fulfill request synchronously and return JSON containing dataset_id.
false
The ID of the dataset
The ID of the dataset version (if omitted, returns data from the latest version)
The ID of the dataset
The ID of the dataset version (if omitted, returns data from the latest version)
The ID of the dataset
The ID of the dataset version (if omitted, returns data from the latest version)
The ID of the dataset
The ID of the dataset version (if omitted, returns data from the latest version)
No content
The name of the project to get evaluations from (if omitted, evaluations will be drawn from the default
project)
No content
Retrieve a paginated list of all projects in the system.
Cursor for pagination (project ID)
The max number of projects to return at a time.
100
Include experiment projects in the response. Experiment projects are created from running experiments.
false
Retrieve a specific project using its unique identifier: either project ID or project name. Note: When using a project name as the identifier, it cannot contain slash (/), question mark (?), or pound sign (#) characters.
The project identifier: either project ID or project name. If using a project name, it cannot contain slash (/), question mark (?), or pound sign (#) characters.
Update an existing project with new configuration. Project names cannot be changed. The project identifier is either project ID or project name. Note: When using a project name as the identifier, it cannot contain slash (/), question mark (?), or pound sign (#) characters.
The project identifier: either project ID or project name. If using a project name, it cannot contain slash (/), question mark (?), or pound sign (#) characters.
Delete an existing project and all its associated data. The project identifier is either project ID or project name. The default project cannot be deleted. Note: When using a project name as the identifier, it cannot contain slash (/), question mark (?), or pound sign (#) characters.
The project identifier: either project ID or project name. If using a project name, it cannot contain slash (/), question mark (?), or pound sign (#) characters.
No content