-
Notifications
You must be signed in to change notification settings - Fork 321
gptel-bedrock: AWS_BEARER_TOKEN_BEDROCK support #1007
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
99fbf56
to
2b42f27
Compare
AWS has introduced Bearer token based authentication for Bedrock https://docs.aws.amazon.com/bedrock/latest/userguide/api-keys.html
2b42f27
to
7dff54e
Compare
@karthink they are similar. This PR adds support for the AWS_BEARER_TOKEN_BEDROCK environment variable which is the standard environment variable name for Bedrock https://docs.aws.amazon.com/bedrock/latest/userguide/api-keys-use.html #983 adds support for passing the key as an argument in elisp. Ideally we should support both ways to specify the key. The other difference between the PRs is that #983 uses :header argument to pass the token AND modifies the gptel-bedrock--curl-args to remove the other arguments if bearer token is present, whereas this PR handles both inside gptel-bedrock--curl-args. I think handling both in gptel-bedrock--curl-args is cleaner. |
Also FYI, Bedrock now supports an OpenAI compatible endpoint (at least for the gpt-oss models): https://aws.amazon.com/blogs/aws/openai-open-weight-models-now-available-on-aws/
Additional patches are required for the reasoning support with GPT-OSS as it uses |
leezu left a comment (karthink/gptel#1007)
@karthink they are similar. This PR adds support for the AWS_BEARER_TOKEN_BEDROCK environment variable which is the standard environment variable name for Bedrock https://docs.aws.amazon.com/bedrock/latest/userguide/api-keys-use.html #983 adds support for passing the key as an argument in elisp. Ideally we should support both ways to specify the key.
The other difference between the PRs is that #983 uses :header argument to pass the token AND modifies the gptel-bedrock--curl-args to remove the other arguments if bearer token is present, whereas this PR handles both inside gptel-bedrock--curl-args. I think handling both in gptel-bedrock--curl-args is cleaner.
Thanks for the clarification. Any design changes to gptel-bedrock are the purview of @felipeochoa and @akssri, so I'll defer to them on this proposal.
|
Thanks, @karthink. It's not really a design change but simply adjustment to support the new API key functionality. It became available only last month: https://aws.amazon.com/blogs/machine-learning/accelerate-ai-development-with-amazon-bedrock-api-keys/ |
(Moved to #1053) |
Closing in favor of #1053. |
AWS has introduced Bearer token based authentication for Bedrock https://docs.aws.amazon.com/bedrock/latest/userguide/api-keys.html Bearer token based authentication only requires the
Authorization: Bearer
header and does not need the sigv4 signing and thus removes the current dependency of the Bedrock backend on curl >= 8.9.