weave.op
to create reusable operations for tracking any calls to a Bedrock model. Optionally, if you’re using Anthropic models, you can use Weave’s built-in integration with Anthropic.
For the latest tutorials, visit Weights & Biases on Amazon Web Services.
Traces
Weave will automatically capture traces for Bedrock API calls. You can use the Bedrock client as usual after initializing Weave and patching the client:converse
API:
Wrapping with your own ops
You can create reusable operations using the@weave.op()
decorator. Here’s an example showing both the invoke_model
and converse
APIs:

Create a Model
for easier experimentation
You can create a Weave Model to better organize your experiments and capture parameters. Here’s an example using the converse
API: