Skip to content
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

AWS Bedrock support #379

Open
csheaff opened this issue Sep 11, 2024 · 8 comments
Open

AWS Bedrock support #379

csheaff opened this issue Sep 11, 2024 · 8 comments

Comments

@csheaff
Copy link

csheaff commented Sep 11, 2024

Hello, it would be grand to be able to use AWS models from Amazon Bedrock, such as Anthropic Claude Sonnet 3.5.

@karthink
Copy link
Owner

Can you provide a link to their API documentation?

@csheaff
Copy link
Author

csheaff commented Sep 11, 2024

...looking for a way to use just http requests but i'm not sure it's possible.

@karthink
Copy link
Owner

I'm not familiar with AWS Bedrock. How do you access models (or other computation) running there?

@csheaff
Copy link
Author

csheaff commented Sep 11, 2024

the easiest approaches are to use the aws cli on the command line or a python sdk. But i'm guessing what would be most convenient here is being able to send https requests with lisp.

relevant? pokepay/aws-sdk-lisp#35

@csheaff
Copy link
Author

csheaff commented Sep 11, 2024

This is as close as i can find to the payload structure:

https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html

On the command line one would would do:

aws bedrock-runtime converse \
--model-id amazon.titan-text-express-v1 \
--messages '[{"role": "user", "content": [{"text": "Describe the purpose of a \"hello world\" program in one line."}]}]' \
--inference-config '{"maxTokens": 512, "temperature": 0.5, "topP": 0.9}'

@karthink
Copy link
Owner

This is as close as i can find to the payload structure:

https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html

This makes it seem like you can make http requests? Sorry, I'm not understanding how this service is structured.

If you can make http requests I can add support for it to gptel.

@csheaff
Copy link
Author

csheaff commented Sep 11, 2024

yes i think so. one could authenticate using environmental variables

AWS_SESSION_TOKEN, AWS_SECRET_ACCESS_KEY, AWS_ACCESS_KEY_ID, AWS_REGION

...or just have the user enter them in during config. In my case i have to renew my credentials often for security reasons, so being able to update them without closing emacs and re-exporting the variables in the terminal would be a plus.

@karthink
Copy link
Owner

Sorry, I don't follow how environment variables are relevant to making a http request.

Is there a curl command you can run to receive model responses from AWS Bedrock?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants