Debug Fix easy · 3 min read

Fix AWS Bedrock model not available error

Quick answer
The model not available error in AWS Bedrock occurs when the specified modelId is incorrect, unavailable in the chosen region, or your IAM permissions lack access. Ensure you use the exact modelId string supported in your region and verify your AWS credentials and region configuration in your boto3 client.
ERROR TYPE config_error
⚡ QUICK FIX
Verify and use the exact modelId supported in your AWS region and ensure your boto3 client is configured with the correct region and credentials.

Why this happens

This error occurs when the modelId passed to the AWS Bedrock boto3 client does not match any deployed model in the specified AWS region. It can also happen if your AWS credentials lack permissions to access Bedrock or if the region is incorrect.

Typical error message:

botocore.exceptions.ClientError: An error occurred (ModelNotFoundException) when calling the Converse operation: Model not found

Example of broken code triggering this error:

python
import boto3

client = boto3.client('bedrock-runtime', region_name='us-east-1')
response = client.converse(
    modelId='anthropic.claude-2',  # Incorrect or deprecated model ID
    messages=[{'role': 'user', 'content': [{'type': 'text', 'text': 'Hello'}]}]
)
print(response)
output
botocore.exceptions.ClientError: An error occurred (ModelNotFoundException) when calling the Converse operation: Model not found

The fix

Use the exact modelId supported by AWS Bedrock in your region. For example, use anthropic.claude-3-5-sonnet-20241022-v2:0 instead of deprecated or incorrect IDs. Also, confirm your boto3 client is configured with the correct region_name and your AWS credentials have Bedrock access.

This corrected code works because it references a valid model and region, avoiding the ModelNotFoundException.

python
import boto3

client = boto3.client('bedrock-runtime', region_name='us-east-1')
response = client.converse(
    modelId='anthropic.claude-3-5-sonnet-20241022-v2:0',
    messages=[{'role': 'user', 'content': [{'type': 'text', 'text': 'Hello'}]}]
)
print(response['output']['message']['content'][0]['text'])
output
Hello

Preventing it in production

  • Implement validation to confirm modelId strings against AWS Bedrock documentation or API before deployment.
  • Add retry logic with exponential backoff for transient errors.
  • Use IAM policies granting Bedrock access and verify AWS credentials and region configuration.
  • Log errors and fallback to alternative models or notify operators if a model is unavailable.

Key Takeaways

  • Always use the exact modelId supported in your AWS region to avoid model not found errors.
  • Configure your boto3 client with the correct AWS region and valid credentials with Bedrock permissions.
  • Implement retries and validation to handle transient errors and prevent production failures.
Verified 2026-04 · anthropic.claude-3-5-sonnet-20241022-v2:0
Verify ↗