Arize (arize SDK)

8.2.0 · active · verified Sat Feb 28

Python SDK for interacting with Arize AX — Arize's enterprise AI engineering platform. IMPORTANT: The 'arize' package covers two separate product tracks with distinct APIs that coexist in the same package. (1) arize.api.Client / arize.ml — the v7 legacy ML monitoring SDK for logging predictions, actuals, embeddings, and drift data to the Arize ML platform. (2) arize.ArizeClient — the v8 LLM/agent observability API for tracing spans, evaluations, and datasets. v7 and v8 are NOT interchangeable. v7 support ends June 1, 2026. Also note: 'arize-phoenix' is a SEPARATE package — Phoenix is Arize's open-source observability tool. Do not conflate arize (enterprise cloud) with arize-phoenix (OSS self-hosted).

Warnings

Install

Imports

Quickstart

v8 ArizeClient only takes api_key at construction. space_id and project_name are passed per-call. This is the opposite of v7 Client, which required both at init.

import os
from arize import ArizeClient

# v8 API: ArizeClient takes only api_key at init
client = ArizeClient(api_key=os.environ['ARIZE_API_KEY'])

SPACE_ID = os.environ['ARIZE_SPACE_ID']
PROJECT_NAME = 'my-llm-app'

# Log spans from a dataframe
# spans_df must be a pandas DataFrame with OTel-compatible columns
client.spans.log(
    space_id=SPACE_ID,
    project_name=PROJECT_NAME,
    dataframe=spans_df
)

# Log evaluations separately
client.spans.update_evaluations(
    space_id=SPACE_ID,
    project_name=PROJECT_NAME,
    dataframe=evals_df
)

# Export spans back out
from datetime import datetime
df = client.spans.export_to_df(
    space_id=SPACE_ID,
    project_name=PROJECT_NAME,
    start_time=datetime(2025, 1, 1),
    end_time=datetime(2026, 1, 1)
)

# OTel tracing (auto-instrument your app to send spans live)
from arize.otel import register
tracer_provider = register(
    space_id=SPACE_ID,
    api_key=os.environ['ARIZE_API_KEY'],
    project_name=PROJECT_NAME
)
# After register(), OTel-compatible instrumentors (OpenInference)
# will auto-export spans to Arize
from openinference.instrumentation.openai import OpenAIInstrumentor
OpenAIInstrumentor().instrument(tracer_provider=tracer_provider)

view raw JSON →