Instrument and observe your DSPy application via the DSPyInstrumentor
DSPy is a framework for automatically prompting and fine-tuning language models. It provides composable and declarative APIs that allow developers to describe the architecture of their LLM application in the form of a “module” (inspired by PyTorch’s nn.Module). It them compiles these modules using “teleprompters” that optimize the module for a particular task. The term “teleprompter” is meant to evoke “prompting at a distance,” and could involve selecting few-shot examples, generating prompts, or fine-tuning language models.Phoenix makes your DSPy applications observable by visualizing the underlying structure of each call to your compiled DSPy module.
DSPy uses LiteLLM under the hood to make some calls. By adding the OpenInference library for LiteLLM, you’ll be able to see additional information like token counts on your traces.
Connect to your Phoenix instance using the register function.
Copy
Ask AI
from phoenix.otel import register# configure the Phoenix tracertracer_provider = register( project_name="my-llm-app", # Default is 'default' auto_instrument=True # Auto-instrument your app based on installed OI dependencies)