Skip to content

Bedrock API with Cross Region Inference is not working

0

I'm trying to access Anthropic Claude 3.5 Haiku (anthropic.claude-3-5-haiku-20241022-v1:0) via the Bedrock Converse API within the us-east-1 region. I've confirmed that my code sample works using a different model (anthropic.claude-3-5-sonnet-20240620-v1:0) so the issue does not seem to be due to permissions. I also already attached the AmazonBedrockFullAccess permission policy to the role I'm using.

From this reference (https://docs.aws.amazon.com/bedrock/latest/userguide/models-supported.html), it seems that we need to use an inference profile in order to access the model (since we need to use cross region inference). I attempted to do that using the modelIds/modelArns corresponding to this model. I grabbed the modelArns from Amazon Bedrock>Cross-region inference tab in AWS console and via the response from a list_inference_profiles API call. In all cases, I ran into the following error: botocore.errorfactory.AccessDeniedException: An error occurred (AccessDeniedException) when calling the Converse operation: You don't have access to the model with the specified model ID.

I've also checked the quotas for my project and I do see that I have quota for both Anthropic Claude 3.5 Sonnet and Haiku. I also checked here that Converse API is supported for both of these models: https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference-supported-models-features.html.

Is there any additional guidance on what might be wrong?

asked a year ago1.9K views
2 Answers
0
Accepted Answer

Based on the information you've provided, it seems you're encountering an issue with cross-region inference for the Anthropic Claude 3.5 Haiku model in Amazon Bedrock. Here are a few points to consider and potential solutions:

  1. Cross-region inference profiles: For Anthropic Claude models, you need to use a cross-region inference profile. These profiles are system-defined and named after the model they support and the regions they include.

  2. Correct inference profile: Make sure you're using the correct inference profile for the Anthropic Claude 3.5 Haiku model. The profile should include both us-east-1 and us-west-2 regions.

  3. IAM permissions: While you've attached the AmazonBedrockFullAccess policy, you might need to explicitly allow cross-region inference API actions. Ensure your IAM role has the necessary permissions to use cross-region inference, particularly for the InvokeModel* APIs in both us-east-1 and us-west-2 regions.

  4. API usage: When using the Converse API with a cross-region inference profile, you should specify either the ARN or the ID of the inference profile, not the model ARN directly.

  5. Region selection: Ensure you're calling the inference profile from one of the regions it includes (in this case, us-east-1 or us-west-2).

  6. Access request: For Anthropic Claude models, there's a separate process to request access. Make sure you've submitted the use case details form through the Amazon Bedrock console and have been granted access specifically for the Anthropic Claude 3.5 Haiku model.

  7. Verify access: After being granted access, you can test it using the Text or Chat feature on the console or through an API call.

If you've confirmed all these points and are still encountering issues, you may need to contact AWS support for further assistance, as there might be a specific configuration or account-level issue that needs to be addressed.

Sources
Access Anthropic models on Amazon Bedrock | AWS re:Post
Getting started with cross-region inference in Amazon Bedrock | AWS Machine Learning Blog
Use an inference profile in model invocation - Amazon Bedrock
Supported Regions and models for inference profiles - Amazon Bedrock

answered a year ago
EXPERT
reviewed a year ago
0

The one thing I missed was requesting access via the Amazon Bedrock Console. I had assumed that if I had quota for the model, that I would also already have access which was an incorrect assumption. After requesting and getting that access, my issue was resolved

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.