If you are building a custom DSPy optimizer, then LangWatch won’t support tracking it out of the box, but adding track to any custom optimizer is also very simple.Documentation Index
Fetch the complete documentation index at: https://langwatch.ai/docs/llms.txt
Use this file to discover all available pages before exploring further.
1. Initialize LangWatch DSPy with optimizer=None
Before the compilation step, explicitly provideNone on the optimizer parameter to be able to track the steps manually:
2. Track the metric function
Either before instantiating your optimizer, or inside the compilation step, don’t forget to wrap the metric function withlangwatch.dspy.track_metric so that it’s tracked:
3. Track each step
Now at each step your optimizer progresses, calllangwatch.dspy.log_step to capture the score at the current step index, optimizer info and predictors being used on this step evaluation:
log_step.