Skip to main content
Open In Colab Weave is designed to track and log all calls made through the Verdict Python library automatically. When working with AI evaluation pipelines, debugging matters. Whether a pipeline step fails, outputs are unexpected, or nested operations create confusion, pinpointing issues can be hard. Verdict applications often consist of multiple pipeline steps, judges, and transformations, so it helps to understand the inner workings of your evaluation workflows. Weave streamlines this process by automatically capturing traces for your Verdict applications. This lets you monitor and analyze your pipeline’s performance to debug and optimize your AI evaluation workflows.

Getting started

To enable Weave tracing for your Verdict pipelines, 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 pass project-name to log to your default team or entity.

Tracking call metadata

To attach custom metadata to your Verdict pipeline calls, use the weave.attributes context manager. This context manager lets you tag a specific block of code, such as a pipeline run or evaluation batch, so that you can filter and group related traces later in the Weave UI.
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 helps during both development and production. These traces support debugging and improving your evaluation workflows, and they provide a useful dataset. Weave automatically captures traces for your Verdict applications. It tracks and logs all calls made through the Verdict library, including:
  • Pipeline execution steps.
  • JudgeUnit evaluations.
  • Layer transformations.
  • Pooling operations.
  • Custom units and transformations.
You can view the traces in the Weave web interface, which shows the hierarchical structure of your pipeline execution.

Pipeline tracing example

The following example shows how Weave traces nested pipeline operations, so you can see how each step in a multi-stage Verdict pipeline is captured:
This creates a detailed trace showing:
  • The main Pipeline execution.
  • Each JudgeUnit evaluation within the Layer.
  • The MeanPoolUnit aggregation step.
  • Timing information for each operation.

Configuration

When you call weave.init(), Weave automatically enables tracing for Verdict pipelines. The integration works by patching the Pipeline.__init__() method to inject a VerdictTracer that forwards all trace data to Weave. You don’t need any additional configuration. Weave automatically performs the following:
  • Captures all pipeline operations.
  • Tracks execution timing.
  • Logs inputs and outputs.
  • Maintains trace hierarchy.
  • Handles concurrent pipeline execution.

Custom tracers and Weave

If you already use custom Verdict tracers in your application, Weave’s VerdictTracer can run alongside them so that you don’t have to choose between integrations:

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 weave.Model:
This code creates a model that you can visualize 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

The following sections describe best practices for monitoring performance and handling errors when using Weave with Verdict pipelines.

Performance monitoring

Weave automatically captures timing information for all pipeline operations, which you can use to identify performance bottlenecks across runs:

Error handling

Weave automatically captures exceptions that occur during pipeline execution, so Weave records failures in the trace even when your application handles the exception:
Integrating Weave with Verdict gives you visibility into your AI evaluation pipelines, making it easier to debug, optimize, and understand your evaluation workflows.