AWS Bedrock Converse API adapter for Agentick.
pnpm add @agentick/bedrock @aws-sdk/client-bedrock-runtime
import { bedrock } from "@agentick/bedrock";
import { createApp } from "@agentick/core";
const model = bedrock("us.anthropic.claude-sonnet-4-20250514-v1:0");
const app = createApp(MyAgent, { model });
const session = await app.session();
await session.run({ messages: [{ role: "user", content: [{ type: "text", text: "Hello!" }] }] });
const model = bedrock({
model: "us.anthropic.claude-sonnet-4-20250514-v1:0",
region: "us-east-1",
maxTokens: 8192,
});
import { BedrockModel } from "@agentick/bedrock";
function MyAgent() {
return (
<BedrockModel model="us.anthropic.claude-sonnet-4-20250514-v1:0" maxTokens={4096}>
<System>You are helpful.</System>
<Timeline />
</BedrockModel>
);
}
- Streaming - Full streaming support via ConverseStream
- Tool calling - Native tool use support
- Multi-model - Claude, Nova, Llama, Mistral, and more via Bedrock
- S3 image support - Image and document understanding
- Guardrails - Bedrock Guardrails integration
| Option |
Type |
Description |
model |
string |
Model ID (e.g., us.anthropic.claude-sonnet-4-20250514-v1:0) |
region |
string? |
AWS region (env: AWS_REGION) |
credentials |
object? |
Explicit { accessKeyId, secretAccessKey, sessionToken? } |
profile |
string? |
AWS profile name for credential chain |
client |
BedrockRuntimeClient? |
Pre-configured client instance |
maxTokens |
number? |
Maximum tokens to generate |
customBlocks |
object? |
Custom block definitions to intercept from output |
deltaTransform |
function? |
User-facing delta transform |
const model = bedrock({
model: "us.anthropic.claude-sonnet-4-20250514-v1:0",
providerOptions: {
bedrock: {
guardrailConfig: {
guardrailIdentifier: "my-guardrail-id",
guardrailVersion: "1",
},
},
},
});
The adapter uses the standard AWS credential chain. Configure via any of:
| Method |
Description |
| Environment vars |
AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN |
| AWS profile |
profile option or AWS_PROFILE env var |
| IAM role |
EC2/ECS/Lambda instance role |
| Explicit |
credentials config option |
| Variable |
Description |
AWS_REGION |
AWS region |
AWS_DEFAULT_REGION |
Fallback region |
AWS_ACCESS_KEY_ID |
AWS access key |
AWS_SECRET_ACCESS_KEY |
AWS secret key |
AWS_SESSION_TOKEN |
Session token (optional) |
AWS_PROFILE |
Named profile |
# Claude
us.anthropic.claude-opus-4-20250514-v1:0
us.anthropic.claude-sonnet-4-20250514-v1:0
anthropic.claude-3-5-sonnet-20241022-v2:0
anthropic.claude-3-5-haiku-20241022-v1:0
# Amazon Nova
amazon.nova-pro-v1:0
amazon.nova-lite-v1:0
amazon.nova-micro-v1:0
# Meta Llama
meta.llama3-1-70b-instruct-v1:0
bedrock(configOrModel) - Factory function returning ModelClass
createBedrockModel(config) - Same as bedrock()
BedrockModel - JSX component for declarative usage