Observing a Workflow with W&B Weave#
This guide provides a step-by-step process to enable observability in an AIQ toolkit workflow using Weights and Biases (W&B) Weave for tracing using just a few lines of code in your workflow configuration file.
Step 1: Install the Weave plugin#
To install the Weave plugin, run the following:
uv pip install -e '.[weave]'
Step 2: Install the Workflow#
Pick an example from the list of available workflows. In this guide, we will be using the simple_calculator
example.
uv pip install -e examples/simple_calculator
Step 3: Modify Workflow Configuration#
Update your workflow configuration file to include the weave telemetry settings. For example, examples/simple_calculator/configs/config-weave.yml
has the following weave settings:
general:
use_uvloop: true
telemetry:
tracing:
weave:
_type: weave
project: "aiqtoolkit-demo"
This setup enables logging trace data to W&B weave. The weave integration requires one parameter and one optional parameter:
Parameter |
Description |
Example |
---|---|---|
|
The name of your W&B Weave project |
|
|
Your W&B username or team name |
|
Step 4: Run Your Workflow#
Install simple_calculator
example using the instructions in the examples/simple_calculator/README.md
guide.
Run the workflow using config-weave.yml
configuration file:
aiq run --config_file examples/simple_calculator/configs/config-weave.yml --input "Is the product of 2 * 4 greater than the current hour of the day?"
If it is your first time running the workflow, you will be prompted to login to W&B Weave.
Step 5: View Traces Data in Weave Dashboard#
As the workflow runs, you will find a Weave URL (starting with a 🍩 emoji). Click on the URL to access your logged trace timeline.
Note how the integration captures not only the aiq
intermediate steps but also the underlying framework. This is because Weave has integrations with many of your favorite frameworks.