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

[FEATURE] Support Amazon Bedrock Claude Sonnet 3.5 #713

Closed
JSON-OBJECT opened this issue Jun 24, 2024 · 8 comments
Closed

[FEATURE] Support Amazon Bedrock Claude Sonnet 3.5 #713

JSON-OBJECT opened this issue Jun 24, 2024 · 8 comments
Labels
question Further information is requested

Comments

@JSON-OBJECT
Copy link

Issue

I hope it will be available not only through Anthropic but also through Amazon Bedrock.
https://aws.amazon.com/blogs/aws/anthropics-claude-3-5-sonnet-model-now-available-in-amazon-bedrock-the-most-intelligent-claude-model-yet/

Version and model info

No response

@paul-gauthier
Copy link
Collaborator

Thanks for trying aider and filing this issue.

Aider should be able to connect to Bedrock. Aider uses litellm to connect to APIs. See their docs:

https://litellm.vercel.app/docs/providers/bedrock

@paul-gauthier paul-gauthier added the question Further information is requested label Jun 24, 2024
@JSON-OBJECT
Copy link
Author

Thanks for trying aider and filing this issue.

Aider should be able to connect to Bedrock. Aider uses litellm to connect to APIs. See their docs:

https://litellm.vercel.app/docs/providers/bedrock

I successfully executed the process by referring to the linked document. The following steps were necessary. Thank you!

$ nano ~/.bashrc
export AWS_ACCESS_KEY_ID={my-aws-access-key-id}
export AWS_SECRET_ACCESS_KEY={my-aws-secret-access-key}
export AWS_REGION_NAME={my-aws-region}

$ nano ~/.aider.models.yml
- name: "bedrock/anthropic.claude-3-5-sonnet-20240620-v1:0"
  edit_format: "diff"
  use_repo_map: true
  send_undo_reply: true
  accepts_images: true
  lazy: true
  reminder_as_sys_msg: true
  examples_as_sys_msg: false

$ aider --model bedrock/anthropic.claude-3-5-sonnet-20240620-v1:0

@paul-gauthier
Copy link
Collaborator

I'm going to close this issue for now, but feel free to add a comment here and I will re-open or file a new issue any time.

@artemptushkin
Copy link

For anyone, if you authenticate through the role assumption, i.e. profile then to access Bedrock you simply need to pass AWS profile, e.g. AWS_PROFILE=dev and then aider --model=bedrock/anthropic.claude-3-5-sonnet-20240620-v1:0 will access AWS Bedrock

@paul-gauthier shouldn't this be documented on the page https://aider.chat/docs/llms.html? That includes other platforms (Vertex AI) but not Bedrock currently

@paul-gauthier
Copy link
Collaborator

Aider and I turned this GitHub issue into a doc for bedrock. I would appreciate if you could look it over and let me know if it is accurate. I don't have bedrock access, so I'm basing the doc on the info you all shared in this issue.

https://aider.chat/docs/llms/bedrock.html

@paul-gauthier paul-gauthier reopened this Aug 23, 2024
@artemptushkin
Copy link

@paul-gauthier thanks for a quick update, I think it should be AWS_REGION instead of AWS_DEFAULT_REGION given

When I set AWS_DEFAULT_REGION it fails for me but with region works

As well please specify that export of AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY is needed only in case one uses user authentication (not a profile)

@paul-gauthier
Copy link
Collaborator

Thanks, I made those changes.

I'm going to close this issue for now, but feel free to add a comment here and I will re-open or file a new issue any time.

paul-gauthier added a commit that referenced this issue Aug 26, 2024
@cab938
Copy link

cab938 commented Nov 7, 2024

A note that this does not work for me. I set AWS_REGION and AWS_PROFILE in my .env file, but aider complains on startup that I do not have AWS_ACCESS_KEY_ID or AWS_SECRET_ACCESS_KEY set. If I set these in my .env and restart things work, but ideally I only need to set the AWS_REGION and then boto picks up all of the other keys it needs directly from my ~/.aws/credentials file.

I'm on aider 0.62.1.

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

No branches or pull requests

4 participants