Skip to main content
Open In Colab Weave is designed to make tracking and logging all calls made through the Verdict Python library effortless. When working with AI evaluation pipelines, debugging is crucial. Whether a pipeline step fails, outputs are unexpected, or nested operations create confusion, pinpointing issues can be challenging. Verdict applications often consist of multiple pipeline steps, judges, and transformations, making it essential to understand the inner workings of your evaluation workflows. Weave simplifies this process by automatically capturing traces for your Verdict applications. This enables you to monitor and analyze your pipeline’s performance, making it easier to debug and optimize your AI evaluation workflows.

Getting Started

To get started, simply call weave.init(project=...) at the beginning of your script. Use the project argument to log to a specific W&B Team name with team-name/project-name or do project-name to log to your default team/entity.

Tracking Call Metadata

To track metadata from your Verdict pipeline calls, you can use the weave.attributes context manager. This context manager allows you to set custom metadata for a specific block of code, such as a pipeline run or evaluation batch.
Weave automatically tracks the metadata against the trace of the Verdict pipeline call. You can view the metadata in the Weave web interface.

Traces

Storing traces of AI evaluation pipelines in a central database is crucial during both development and production. These traces are essential for debugging and improving your evaluation workflows by providing a valuable dataset. Weave automatically captures traces for your Verdict applications. It will track and log all calls made through the Verdict library, including:
  • Pipeline execution steps
  • Judge unit evaluations
  • Layer transformations
  • Pooling operations
  • Custom units and transformations
You can view the traces in the Weave web interface, showing the hierarchical structure of your pipeline execution.

Pipeline Tracing Example

Here’s a more complex example showing how Weave traces nested pipeline operations:
This will create a detailed trace showing:
  • The main Pipeline execution
  • Each JudgeUnit evaluation within the Layer
  • The MeanPoolUnit aggregation step
  • Timing information for each operation

Configuration

Upon calling weave.init(), tracing is automatically enabled for Verdict pipelines. The integration works by patching the Pipeline.__init__ method to inject a VerdictTracer that forwards all trace data to Weave. No additional configuration is needed - Weave will automatically:
  • Capture all pipeline operations
  • Track execution timing
  • Log inputs and outputs
  • Maintain trace hierarchy
  • Handle concurrent pipeline execution

Custom Tracers and Weave

If you’re using custom Verdict tracers in your application, Weave’s VerdictTracer can work alongside them:

Models and Evaluations

Organizing and evaluating AI systems with multiple pipeline components can be challenging. Using the weave.Model, you can capture and organize experimental details like prompts, pipeline configurations, and evaluation parameters, making it easier to compare different iterations. The following example demonstrates wrapping a Verdict pipeline in a WeaveModel:
This code creates a model that can be visualized in the Weave UI, showing both the pipeline structure and the evaluation results.

Evaluations

Evaluations help you measure the performance of your evaluation pipelines themselves. By using the weave.Evaluation class, you can capture how well your Verdict pipelines perform on specific tasks or datasets:
This creates an evaluation trace that shows how your Verdict pipeline performs across different test cases.

Best Practices

Performance Monitoring

Weave automatically captures timing information for all pipeline operations. You can use this to identify performance bottlenecks:

Error Handling

Weave automatically captures exceptions that occur during pipeline execution:
By integrating Weave with Verdict, you get comprehensive observability into your AI evaluation pipelines, making it easier to debug, optimize, and understand your evaluation workflows.