Skip to main content

Overview

AWS Bedrock provides access to multiple foundation models including Anthropic Claude, Meta Llama, Mistral AI, Amazon Nova, and more through a single API on AWS infrastructure.

Quick Start

1

Install LiteLLM

2

Set AWS Credentials

3

Make Your First Call

Supported Models

Claude models via Bedrock:

Authentication

Available Regions

Bedrock is available in multiple AWS regions:

Streaming

Function Calling

Use tools with Claude on Bedrock:

Vision (Multimodal)

Use vision models like Claude or Llama 3.2 Vision:

Embeddings

Generate embeddings using Bedrock:

Reranking

Rerank documents using Cohere on Bedrock:

Batch Processing

Process requests asynchronously:

Converse API vs Invoke API

Bedrock supports two APIs:

Cross-Region Inference

Use cross-region inference profiles:

Guardrails

Apply AWS Bedrock Guardrails:

Advanced Parameters

Temperature and Sampling

System Messages

Error Handling

Cost Tracking

Model Access

Before using models, ensure they’re enabled in your AWS account:
  1. Go to AWS Bedrock console
  2. Navigate to “Model access”
  3. Request access for desired models
  4. Wait for approval (usually instant for most models)

Best Practices

Use IAM Roles

When on AWS, use IAM roles instead of access keys for better security.

Choose Right Region

Select a region close to your users for lower latency.

Enable Model Access

Request model access in Bedrock console before use.

Use Converse API

Prefer Converse API for better compatibility across models.

Anthropic

Learn about Claude-specific features

Function Calling

Implement tool use on Bedrock

Embeddings

Generate embeddings on Bedrock

Streaming

Stream responses in real-time