Skip to main content

Installation

Usage

How It Works

wrap_bedrock patches both converse() and invoke_model() on the Bedrock runtime client. After each call, it:
  1. Extracts the model name from the modelId parameter
  2. Extracts token counts from the response usage metadata
  3. Infers the provider from the model ID prefix (e.g., anthropic., amazon., meta.)
  4. Sends the usage event to MeshAI (buffered, non-blocking)

Alternative: Proxy (Zero-Code)

For Bedrock, the proxy approach requires configuring a custom endpoint in your boto3 client. The region must be part of the path: