Skip to main content
Python auto-instrumentation library for DSPy. These traces are fully OpenTelemetry-compatible and can be sent to an OpenTelemetry collector for viewing, such as Arize Phoenix.

Installation

Quickstart

This quickstart shows you how to instrument your DSPy application. It is adapted from the DSPy quickstart. Install required packages:

Start Phoenix server

Start Phoenix in the background as a collector. By default, it listens on http://localhost:6006:
(Phoenix does not send data over the internet. It only operates locally on your machine.)

Setup instrumentation

Set up DSPyInstrumentor to trace your DSPy application and send traces to Phoenix:

Import DSPy and configure language model

Define a custom program

Define a program that utilizes the ChainOfThought module to perform step-by-step reasoning:

Optimize your program

Optimize your program using the BootstrapFewShot teleprompter:

Evaluate performance

Visit the Phoenix app at http://localhost:6006 to see your traces.

More Info