boto3 (sync) and aioboto3 (async).
This package implements OpenInference tracing for invoke_model, invoke_agent and converse calls made using the bedrock-runtime and bedrock-agent-runtime clients from both boto3 (sync) and aioboto3 (async).
The Converse API was introduced in botocore v1.34.116. Please use v1.34.116 or above to utilize converse.
Supported Models
Find the list of Bedrock-supported models and their IDs here.| Model | Supported Methods |
|---|---|
| Anthropic Claude 2.0 | converse, invoke |
| Anthropic Claude 2.1 | converse, invoke |
| Anthropic Claude 3 Sonnet 1.0 | converse |
| Anthropic Claude 3.5 Sonnet | converse |
| Anthropic Claude 3 Haiku | converse |
| Meta Llama 3 8b Instruct | converse |
| Meta Llama 3 70b Instruct | converse |
| Mistral AI Mistral 7B Instruct | converse |
| Mistral AI Mixtral 8X7B Instruct | converse |
| Mistral AI Mistral Large | converse |
| Mistral AI Mistral Small | converse |
Installation
Async (aioboto3) support
To instrument async Bedrock calls made viaaioboto3, install aioboto3 in addition to this package:
Quickstart
In a notebook environment (jupyter, colab, etc.) install dependencies:
aioboto3:
boto3 is configured with AWS credentials.
Tracing Setup (Phoenix)
The tracing setup below is shared for both sync (boto3) and async (aioboto3) usage.
phoenix server and set it as a collector:
invoke_model and converse are instrumented and can be viewed in the phoenix UI.