Skip to content

Conversation

@ktdreyer
Copy link
Contributor

Rename AWS_BEDROCK_API_KEY to AWS_BEARER_TOKEN_BEDROCK to align with the naming convention used in AWS Bedrock documentation and the AWS web console UI. This reduces confusion when developers compare LLS docs with AWS docs.

Closes #4147

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 13, 2025
@ktdreyer ktdreyer force-pushed the rename-aws-bedrock-api-key branch from ef43b24 to 955be91 Compare November 13, 2025 19:52
@ktdreyer
Copy link
Contributor Author

@skamenan7 what do you think?

@ktdreyer ktdreyer force-pushed the rename-aws-bedrock-api-key branch from 955be91 to 878dc45 Compare November 13, 2025 20:11
@ktdreyer ktdreyer changed the title feat: Match AWS docs for bedrock bearer token variable feat!: Match AWS docs for bedrock bearer token variable Nov 13, 2025
@ktdreyer ktdreyer changed the title feat!: Match AWS docs for bedrock bearer token variable feat!: change bedrock bearer token variable to match AWS docs Nov 13, 2025
Copy link
Collaborator

@mattf mattf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please also update the provider data

@ktdreyer ktdreyer force-pushed the rename-aws-bedrock-api-key branch from 878dc45 to fc11126 Compare November 17, 2025 14:31
@ktdreyer
Copy link
Contributor Author

@mattf I think we should keep the Python str variable named aws_bedrock_api_key internally in Llama Stack, because 1) that matches the naming convention for other providers API keys, and 2) AWS does refer to this as an "API Key" in the UI and docs. I've amended the commit with this justification.

I've updated the BedrockProviderDataValidator description to make this clearer.

@ktdreyer ktdreyer force-pushed the rename-aws-bedrock-api-key branch from fc11126 to e2a0b28 Compare November 17, 2025 14:32
@ktdreyer ktdreyer changed the title feat!: change bedrock bearer token variable to match AWS docs feat!: change bedrock bearer token env variable to match AWS docs Nov 17, 2025
@mattf
Copy link
Collaborator

mattf commented Nov 17, 2025

@mattf I think we should keep the Python str variable named aws_bedrock_api_key internally in Llama Stack, because 1) that matches the naming convention for other providers API keys, and 2) AWS does refer to this as an "API Key" in the UI and docs. I've amended the commit with this justification.

I've updated the BedrockProviderDataValidator description to make this clearer.

the way ProviderDataValidators are used is to parse user input provided via an x-llamastack-provider-data header.

so users will send requests like -

$ curl -L 'http://any-hosted-llama-stack.com/v1/chat/completions' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'x-llamastack-provider-data: {"aws_bedrock_api_key": "my-aws-bearer-token-for-bedrock' \
...

if aws is not consistent in its terminology, at least let us be consistent with the term we choose.

@ktdreyer
Copy link
Contributor Author

Thanks for explaining that.

boto3 itself respects AWS_BEARER_TOKEN_BEDROCK, so that is a standard environment variable at this point (like the venerable AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY).

Eventually I could foresee a higher-level workflow that transforms AWS_ACCESS_KEY_ID+AWS_SECRET_ACCESS_KEY to AWS_BEARER_TOKEN_BEDROCK - (like https://pypi.org/project/aws-bedrock-token-generator/ does). We don't really want to force users to deploy long-lived keys anywhere.

I can support the decision to rename this all the way in LLS for clarity.

@ktdreyer ktdreyer force-pushed the rename-aws-bedrock-api-key branch from 4adcd2b to 83b5868 Compare November 18, 2025 21:35
@skamenan7
Copy link
Contributor

Hi @ktdreyer, LGTM, thanks. Yes having one field name will be helpful in my opinion too. Especially the name which we export/env variable to be the same in the code too.

Rename AWS_BEDROCK_API_KEY to AWS_BEARER_TOKEN_BEDROCK to align
with the naming convention used in AWS Bedrock documentation and
the AWS web console UI. This reduces confusion when developers
compare LLS docs with AWS docs.

Also rename the Python field aws_bedrock_api_key to
aws_bearer_token_bedrock throughout the codebase for consistency.
@ktdreyer ktdreyer force-pushed the rename-aws-bedrock-api-key branch from 83b5868 to 0a04e62 Compare November 19, 2025 16:18
@ktdreyer ktdreyer changed the title feat!: change bedrock bearer token env variable to match AWS docs feat!: change bedrock bearer token env variable to match AWS docs & boto3 convention Nov 21, 2025
@ktdreyer
Copy link
Contributor Author

What should I do next to merge this?

@mattf mattf merged commit dc4665a into llamastack:main Nov 21, 2025
61 checks passed
@ktdreyer ktdreyer deleted the rename-aws-bedrock-api-key branch November 21, 2025 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rename AWS_BEDROCK_API_KEY to AWS_BEARER_TOKEN_BEDROCK

3 participants