Using Aider with AWS Bedrock
Aider is a command-line utility which exposes and chat interface for many LLMs. It is intended to modify code in a local software project.
AWS Bedrock is service offering which runs LLMs like Claude 3.7, for instance. Data privacy is one an advantage to running your own instance of Claude on Bedrock rather than using Anthropic’s public instance. You have more control over where your data ends up.
Aider supports models on AWS Bedrock out of the box. This is how I made it work.
Authn/z
- In AWS IAM, I created a new user (
example-user
) - I added the user to a group with access to Bedrock (which I named
BedrockFullAccess
group - I created an access key (choosing “Application running outside AWS”)
I stored the access key in pass (see appendix A to set up pass).
The password entry should look like this:
{
"Version": 1,
"AccessKeyId": "<access_key_id>",
"SecretAccessKey": "<secret_access_key>",
"SessionToken": null,
"Expiration": null
}
pass add -m aws/aider-profile>
Then, I created an AWS profile which uses that key, leaving AWS Access Key ID
and AWS Secret Access Key
blank.
aws configure --profile aider
I edited ~/.aws/config
.
[profile aider]
region = us-east-1
credential_process = pass aws/my-aider-profile
I tested that the AWS profile works.
aws sts get-caller-identity --profile aider
The response should look like this:
{
"UserId": "AIDACKCEVSQ6C2EXAMPLE",
"Account": "123456789012",
"Arn": "arn:aws:iam::123456789012:user/your-username"
}
Configuring Aider
brew install aider
Setting up Aider to use Amazon Bedrock
According to the docs, some models only work with Inference Profiles
.
aider --model us.anthropic.claude-3-7-sonnet-20250219-v1:0
Since I’m setting the AIDER_MODEL
environment variable using direnv, I don’t have to use the --model
flag and can simply run
aider
Appendix A - Setting up pass
Use pass so that your secrets aren’t stored on disk in plain text.
You will need a GPG secret key. You can list your secret keys like this:
gpg --list-secret-keys
You can generate one like this:
gpg --full-generate-key
Then run
pass init <name of secret key>`
Appendix B - use direnv to automatically set the environment variables for Aider
You can use direnv to automatically set environment variables on a per-directory basis.
# .envrc in your local project
export AWS_REGION="us-east-1"
export AWS_ACCESS_KEY_ID="$(pass aws/aider-profile | jq --raw-output '.AccessKeyId')"
export AWS_SECRET_ACCESS_KEY="$(pass aws/aider-profile | jq --raw-output '.SecretAccessKey')"
export AIDER_MODEL="us.anthropic.claude-3-7-sonnet-20250219-v1:0"