DSPy Tracing
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.
Launch Phoenix
Sign up for Phoenix:
Sign up for an Arize Phoenix account at https://app.phoenix.arize.com/login
Install packages:
Set your Phoenix endpoint and API Key:
Your Phoenix API key can be found on the Keys section of your dashboard.
Install
Setup
Connect to your Phoenix instance using the register function.
Run DSPy
Now run invoke your compiled DSPy module. Your traces should appear inside of Phoenix.
Observe
Now that you have tracing setup, all predictions will be streamed to your running Phoenix for observability and evaluation.
Resources
Was this helpful?