aws bedrock - Add way to identify which models an account currently has access to
Describe the feature
Currently is no way to programmatically inspect which foundation models my account has been granted access to. Something should be added to the AWS CLI to allow this information to be retrieved by external APIs.
Use Case
Example of when this feature would be useful:
I been granted access to a subset of models on Bedrock. I have a front end application through which users can interact with these models. So that my users know which models they can use, the front end displays the list of models. But this list grows over time as I request access to more and more models.
Currently, because this list cannot be fetched programmatically, I am forced to hardcode it inside my application's source code. But this increases the amount of code I must manually maintain. Alternatively, I could iterative over the list of all available models (so not just the subset I have access to), submit a request to each, and infer that I have access iff the request returns successfully. But this means starting my application would actually cost me extra money.
So neither of those solutions is ideal. Much better would be a dedicated, purpose-built method for programmatically determining which models I have access to, then showing this list to users.
Proposed Solution
The closest existing tool seems to be aws bedrock list-foundation-models. But this returns everything available on Bedrock, not just the subset of things which currently have access to. The returned models are structured as follows:
{
"modelSummaries": [
{
"modelArn": "arn:aws:bedrock:us-east-1::foundation-model/amazon.titan-tg1-large",
"modelId": "amazon.titan-tg1-large",
"modelName": "Titan Text Large",
"providerName": "Amazon",
"inputModalities": [
"TEXT"
],
"outputModalities": [
"TEXT"
],
"responseStreamingSupported": true,
"customizationsSupported": [],
"inferenceTypesSupported": [
"ON_DEMAND"
],
"modelLifecycle": {
"status": "ACTIVE"
}
},
...
],
...
}
IMHO, the cheapest/most extensible solution would be to add a new field into each entry, e.g.,
{
"modelSummaries": [
{
"modelArn": "arn:aws:bedrock:us-east-1::foundation-model/amazon.titan-tg1-large",
"modelId": "amazon.titan-tg1-large",
"modelName": "Titan Text Large",
"providerName": "Amazon",
"inputModalities": [
"TEXT"
],
"outputModalities": [
"TEXT"
],
"responseStreamingSupported": true,
"customizationsSupported": [],
"inferenceTypesSupported": [
"ON_DEMAND"
],
"modelLifecycle": {
"status": "ACTIVE"
}
"accessGranted": true # <---- I PROPOSE ADDING A FIELD LIKE THIS
},
...
],
...
}
That way, a simple jq query would be enough to filter the output down to the desired subset. This would probably be much easier and more widely useful than a dedicated flag like aws bedrock list-foundation-models --accessed or subcommand like aws bedrock list-accessed-models.
Other Information
No response
Acknowledgements
- [X] I may be able to implement this feature request
- [ ] This feature might incur a breaking change
CLI version used
aws-cli/2.17.13 Python/3.11.9 Darwin/23.5.0 exe/x86_64
Environment details (OS name and version, etc.)
MacOS Sonoma 14.5