- Newest
- Most votes
- Most comments
Hi, I'm admin in one of my account but I can not use Titan, it's marked as available but I can not use it in the playground or with boto3.
I tried Stability model and it works in the Console with the same user/session
For instance the following code:
modelId = "amazon.titan-tg1-large"
accept = "application/json"
contentType = "application/json"
response = boto3_bedrock.invoke_model(
body=body, modelId=modelId, accept=accept, contentType=contentType
)
Raises the exception:
botocore.errorfactory.AccessDeniedException: An error occurred (AccessDeniedException) when calling the InvokeModel operation: Your account is not authorized to invoke this API operation.
I also tried in another account where I'm also admin, same issue, it's marked as enabled but I can't do anything.
Any idea what it could be?
Thanks.
Before using a foundational model in Bedrock your account needs to be granted access first. For some reason the workshop does not mention this.
Follow the steps here to add models: https://docs.aws.amazon.com/bedrock/latest/userguide/model-access.html#add-model-access
Some models require some additional information and take some time before you are granted access. Once the model shows "Access granted" on the Model Access page, you should be able to call the invoke_model() function without the error.
From my original post, I was trying to configure the amazon.titan-tg1-large model and I stuck with "Your account is not authorized to invoke this API operation". After carefully reading the current documentation here: https://us-west-2.console.aws.amazon.com/bedrock/home?region=us-west-2#/providers, the "amazon.titan-tg1-large" is not on the list.
As a workaround, From my Python API calls, I used "modelId": "ai21.j2-ultra-v1" or "modelId": "anthropic.claude-v1" instead. They worked as expected and completed my calling the models from Python API.
Looking back, the error message "Your account is not authorized to invoke this API operation" is misleading. The better error message should pinpoint the fact that your specified mode is not found (amazon.titan-tg1-large) as an example.
I am experiencing the same issue (OlivierS posted) by calling the API with the modelID = "amazon.titan-tg1-large". Btw, other API modelIDs worked okay for me so far.
According to the issues below, some of the titan models are in preview. Unless you have access to the private preview of the model, the call will fail.
https://github.com/aws-samples/amazon-bedrock-workshop/issues/109
https://github.com/aws-samples/amazon-bedrock-workshop/issues/71
Can I ask which region you are trying this operation in? Have you checked the models supported by region since the model you are trying to use might not be available (or only available to whitelisted users)?
I have had luck with two paths. There are limits placed on accounts until certain actions are taken. I have not seen this specific behavior but this may be worth a try, especially if you are only doing Bedrock work in this account
- Start two t2.micros for 15 minutes. This frequently removes the limitations on accounts
- open a ticket for AWS to remove account limitations. Describe the limit in enough detail so you tell them the Observed and Expected behavior. They usually resolve this quickly (a few hours)
Relevant content
- AWS OFFICIALUpdated 5 months ago
- AWS OFFICIALUpdated 5 months ago
- AWS OFFICIALUpdated 6 months ago
- AWS OFFICIALUpdated 5 months ago
What is enabled is the titans embedding model and not the titan LLM. This is still in preview. What you are seeing is correct. Note this is a question and not an answer. Next time open up a question for this type of ask.