- Newest
- Most votes
- Most comments
When using the ListFoundationModelsCommand in the AWS SDK, you're right that there isn't a direct filter parameter for model access status. The command returns all foundation models available in the region, regardless of whether you've been granted access to them or not.
To determine which models you have access to, you have a few options:
-
After retrieving the list of foundation models, you can make a separate call to check the access status for each model. However, this approach would require multiple API calls.
-
A more practical approach is to handle this programmatically by maintaining a list of models you've granted access to in your application, or by attempting to use the models and handling any access-related errors.
-
You can also use the AWS CLI to get a list of models you have access to and use that information in your application:
aws bedrock list-foundation-models --query "modelSummaries"[]."modelArn"
It's worth noting that some models like Amazon Titan, Mistral AI models, and Meta Llama 3 Instruct cannot be disabled once enabled, so you'll always have access to these once granted.
If you need to restrict access to specific models for certain users, you can implement identity-based policies that deny access to running inference on specific models, even if model access has been granted at the account level.
Sources
Restricting Access to Amazon Bedrock Models | AWS re:Post
Bedrock Model access modifications | AWS re:Post
Relevant content
- asked 6 months ago
- asked 10 months ago
- AWS OFFICIALUpdated a year ago
