AWS Bedrock

Trace AWS Bedrock (Converse + InvokeModel) in Python and TypeScript.

Wrap a Bedrock runtime client. Both the Converse API and the legacy InvokeModel API are traced. provider is always bedrock; system is the underlying model vendor (anthropic, amazon, meta, …), inferred from the model id.

Prerequisites

pip install -U "neatlogs[bedrock]" boto3

Usage

import os
import boto3
import neatlogs

neatlogs.init(api_key=os.environ["NEATLOGS_API_KEY"], workflow_name="bedrock-demo")

client = neatlogs.wrap(boto3.client("bedrock-runtime", region_name="us-east-1"))

resp = client.converse(
    modelId="us.anthropic.claude-haiku-4-5-20251001-v1:0",
    messages=[{"role": "user", "content": [{"text": "What is AWS Bedrock?"}]}],
    inferenceConfig={"temperature": 0.2, "maxTokens": 512},
)
print(resp["output"]["message"]["content"][0]["text"])

neatlogs.flush()
neatlogs.shutdown()

wrap() opens a WORKFLOW root for you, so this renders with no extra wrapper.

Making several calls in one run? Group them into one trace with a WORKFLOW root.

For cross-region models use the inference-profile id (e.g. us.anthropic.claude-...) rather than the bare model id.

On this page