Skip to main content
Anthropic is a leading provider for state-of-the-art LLMs. The Anthropic SDK can be instrumented using the openinference-instrumentation-anthropic package.

Install

Setup

Connect your application to Phoenix with the register function: From anthropic 1.14.0, the Anthropic SDK also records its own traces. With the instrumentor on, every call would appear twice in Phoenix, with tokens and cost counted twice. Pass open_telemetry=False when you create the client, as in the example below, or set ANTHROPIC_OPEN_TELEMETRY=false in your environment.

Run Anthropic

A simple Anthropic application that is now instrumented

Observe

Now that you have tracing setup, all invocations of pipelines will be streamed to your running Phoenix for observability and evaluation.

Resources: