AWS Bedrock¶
Uses the boto3 Converse API, which provides a unified interface across all
Bedrock-hosted models (Claude, Nova, Llama, Mistral, …).
Install¶
Configure¶
Bedrock uses the standard AWS credential chain — no API key. Use any of:
Use¶
Prefix: bedrock/. The model ID is the Bedrock model ID or cross-region
inference profile ID:
curl http://localhost:11434/api/chat -d '{
"model": "bedrock/us.anthropic.claude-sonnet-4-20250514-v1:0",
"messages": [{"role": "user", "content": "Hello!"}]
}'
Common model IDs¶
bedrock/us.anthropic.claude-sonnet-4-20250514-v1:0
bedrock/us.amazon.nova-pro-v1:0
bedrock/us.amazon.nova-lite-v1:0
bedrock/us.meta.llama3-1-70b-instruct-v1:0
bedrock/us.mistral.mistral-large-2407-v1:0
Enable model access first
You must explicitly enable model access in the Bedrock console
(Bedrock → Model access) for each model you want to use.
Implementation notes¶
- The Converse API gives a uniform request/response format across vendors.
- Streaming via
converse_streamis supported and yields incremental text. boto3is synchronous, so the proxy wraps calls withasyncio.to_threadto avoid blocking the FastAPI event loop.- IAM permissions required:
bedrock:InvokeModelandbedrock:InvokeModelWithResponseStream.