Skip to content

AWS Bedrock

AWS Bedrock’s Converse API is model-agnostic — same wire format whether you’re calling Claude, Llama, Mistral, Titan, or Mixtral. agentfootprint’s bedrock() factory wraps it as one LLMProvider. No format-specific code per model family.

Terminal window
npm install @aws-sdk/client-bedrock-runtime

Peer dep, lazy-required, optional. AWS credentials resolved via the SDK’s normal chain (env, profile, IAM role).

import { Agent, bedrock } from 'agentfootprint';
const provider = bedrock({
region: 'us-east-1',
});
const agent = Agent.create({
provider,
model: 'anthropic.claude-sonnet-4-5-20250929-v1:0', // Bedrock-namespaced model id
}).build();

The model id is Bedrock’s, not the upstream provider’s. Cross-region inference profiles work as-is — just pass the profile id.

Converse API’s tool_use / tool_result blocks map cleanly to agentfootprint’s Tool[] + LLMMessage.toolCalls. ReAct correctness preserved.

provider.stream(req) uses ConverseStream — chunks land as they arrive, final chunk carries authoritative LLMResponse.

  • AWS SDK handles credential refresh + region routing automatically.
  • Wrap with withRetry for transient throttling. AWS-specific status codes are normalized to LLMError.code.
  • Pass an existing client to share a configured Bedrock client across the host app:
import { BedrockRuntimeClient } from '@aws-sdk/client-bedrock-runtime';
const sharedClient = new BedrockRuntimeClient({ region: 'us-east-1' });
const provider = bedrock({ client: sharedClient });
  • Multi-modal not exposed yet (text content only).
  • Bedrock Guardrails not exposed in the wrapper — pass via the SDK client directly if you need them.