Bedrock Models
A Python library that provides AWS Bedrock Foundation Model IDs with autocomplete support and utility functions for cross-region inference.
This library helps developer to easily use Bedrock foundation models without having to lookup the model id or the correct cris profile prefix to use. The list of models is checked and updated daily.
[!NOTE] This package is part of the Bedrock Models Monorepo. A TypeScript/JavaScript version is also available in the
packages/typescriptdirectory.
🌐 Browse Models Online
Explore all available Bedrock models with our interactive web interface. Search by model name, filter by region, and find CRIS-enabled models.
Features
- Type-safe model IDs: Access all Bedrock model IDs as Python constants with full autocomplete support
- Cross-region inference: Automatically generate CRIS (Cross-Region Inference Service) prefixed model IDs
- Region validation: Check model availability across AWS regions
- Auto-updated: Model IDs are automatically updated weekly from AWS Bedrock API
Installation
pip install bedrock-models
Quick Start
The following code is portable across regions without any change
import boto3
from bedrock_models import Models, cris_model_id, global_model_id
client = boto3.client('bedrock-runtime')
# Get model ID with autocomplete
model = Models.ANTHROPIC_CLAUDE_HAIKU_4_5_20251001
# The correct geo profile id is determined from the boto3 default region
# regional geo profile is preferred, and falls back to global profile
client.converse(modelId=cris_model_id(model), messages=[...])
# To force a global profile, if available in the region, use global_model_id
client.converse(modelId=global_model_id(model), messages=[...])
# Qwen example
client.converse(modelId=Models.QWEN_QWEN3_32B.cris("ap-southeast-1"), messages=[...])
Usage
Basic Model IDs
from bedrock_models import Models
# Access model IDs with autocomplete
model_id = Models.ANTHROPIC_CLAUDE_SONNET_4_5_20250929
# Returns: "anthropic.claude-sonnet-4-5-20250929-v1:0"
model_id = Models.AMAZON_NOVA_PRO
# Returns: "amazon.nova-pro-v1:0"
Cross-Region Inference (CRIS)
from bedrock_models import Models, cris_model_id
# Get CRIS model ID (automatically chooses geo or global based on availability)
cris_id = cris_model_id(
Models.ANTHROPIC_CLAUDE_SONNET_4_5_20250929,
region="us-east-1"
)
# Returns: "us.anthropic.claude-sonnet-4-5-20250929-v1:0" (geo CRIS if INFERENCE_PROFILE available)
# Or: "global.anthropic.claude-sonnet-4-5-20250929-v1:0" (if only GLOBAL available)
# Different region prefix (AP regions use "apac")
cris_id = cris_model_id(
Models.AMAZON_NOVA_PRO,
region="ap-south-1"
)
# Returns: "apac.amazon.nova-pro-v1:0"
# Auto-detect region from boto3 (if installed and configured)
# AWS_DEFAULT_REGION=us-west-2
import boto3
cris_id = cris_model_id(
Models.AMAZON_NOVA_PRO # region auto-detected from boto3
)
# Returns: "us.amazon.nova-pro-v1:0"
Check Model Availability
from bedrock_models import Models, is_model_available, get_available_regions
# Check if a model is available in a specific region
available = is_model_available(Models.AMAZON_NOVA_PRO, "us-west-2")
# Returns: True or False
# Auto-detect region from boto3 (if installed and configured)
available = is_model_available(Models.AMAZON_NOVA_PRO)
# Uses region from boto3 session
# Get all regions where a model is available
regions = get_available_regions(Models.ANTHROPIC_CLAUDE_SONNET_4_5_20250929)
# Returns: ['us-east-1', 'us-west-2', 'ap-south-1', ...]
Inference Profiles
from bedrock_models import (
Models,
cris_model_id,
global_model_id,
has_global_profile,
)
# Get CRIS model ID (automatically chooses geo or global based on availability)
model_id = cris_model_id(Models.ANTHROPIC_CLAUDE_SONNET_4_5_20250929, region="us-east-1")
# Returns: "us.anthropic.claude-sonnet-4-5-20250929-v1:0" (geo CRIS)
# Or: "global.anthropic.claude-sonnet-4-5-20250929-v1:0" (if only global available)
# Get global inference profile ID (if supported in region)
global_id = global_model_id(Models.AMAZON_NOVA_PRO, region="us-east-1")
# Returns: "global.amazon.nova-pro-v1:0"
# Raises ValueError if global profile not supported in region
# Check if a model has a global inference profile in a region
has_global = has_global_profile(
Models.ANTHROPIC_CLAUDE_SONNET_4_5_20250929,
"us-east-1"
)
# Returns: True or False
Development
Setup
# Install Poetry
curl -sSL https://install.python-poetry.org | python3 -
# Install dependencies
poetry install
# Run tests
poetry run pytest
Regenerate Model IDs
To update the model IDs from AWS Bedrock:
# Set AWS credentials
export AWS_ACCESS_KEY_ID=your_key
export AWS_SECRET_ACCESS_KEY=your_secret
# Generate model data from AWS
python utils/generate_models_json.py
# Generate Python class
python utils/generate_model_class.py
# Run tests
poetry run pytest
Required IAM Permissions
The AWS credentials need the following least-privilege IAM policy:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "BedrockReadOnly",
"Effect": "Allow",
"Action": [
"bedrock:ListFoundationModels",
"bedrock:ListInferenceProfiles"
],
"Resource": "*"
},
{
"Sid": "EC2DescribeRegions",
"Effect": "Allow",
"Action": [
"ec2:DescribeRegions"
],
"Resource": "*"
}
]
}
Credits
This project uses the following open-source libraries and data in the github pages site:
- Leaflet: An open-source JavaScript library for mobile-friendly interactive maps. Copyright (c) 2010-2023, Volodymyr Agafonkin.
- OpenStreetMap: Map data © OpenStreetMap contributors.
License
MIT-0
Author
Massimiliano Angelino massi.ang@gmail.com
Release files for bedrock-models 0.1.135
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| bedrock_models-0.1.135.tar.gz | 19.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| bedrock_models-0.1.135-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 40.8 kB
Release files / bedrock_models-0.1.135.tar.gz
| Download URL | bedrock_models-0.1.135.tar.gz |
|---|---|
| Size | 19.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7abfed34a3d7a854c994b742cabc65625ce2e8440e16e08de957b64d83542b2e
|
|
BLAKE2b-256 checksum How to use checksums |
89b8cc0950ea226bb09b6fcff58a9a07d2cc9eb0b03eb222c720390d55f4bb19
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 9, 2026.
Transparency logRelease files / bedrock_models-0.1.135-py3-none-any.whl
| Download URL | bedrock_models-0.1.135-py3-none-any.whl |
|---|---|
| Size | 21.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5ea484f24d79f9c98df2e3cf26e87b445f1b6df660ed979c5bc9bdca9392fb6f
|
|
BLAKE2b-256 checksum How to use checksums |
e28221fcdea7c80fe847829d6e23abb34ab9a63af0213dd00d7c30e892727ed6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 9, 2026.
Transparency log