# How to Install Aider - AI Coding Assistant Chatbot

### Introduction

* `Aider` is an open-source AI coding assistant chatbot based on the console terminal. It outperformed **Amazon Q Developer Agent** in the **SWE** benchmark and is continuously being actively updated. In this post, I've summarized how to use **Aider** with the `Azure OpenAI GPT-4o` and `Amazon Bedrock Claude 4 Sonnet` models.
    

### Installing Aider

* Install `Aider` as follows: (Python is required before installation)
    

```bash
# Install Aider
$ curl -LsSf https://aider.chat/install.sh | sh
$ sudo apt install wl-clipboard xclip

# [Optional] Activate dark mode
$ nano ~/.bashrc
export AIDER_DARK_MODE=true

# [Optional] Add an alias to quickly list files for the /add command
$ nano ~/.bash_aliases
alias aiderls="find . -type f | git check-ignore --stdin -v -n | grep '^::' | cut -f2- | sed 's|^\./||'"
```

### Setting up Azure OpenAI GPT-4o

* With the release of `OpenAI GPT-4o` on May 13, 2024, it became the recommended model for **Aider**. Here's how to set up the **GPT-4o** model deployed on **Azure**:
    

```bash
$ nano ~/.bashrc
export AZURE_API_BASE=https://{your-azure-open-ai-gpt-4o-deployment-name}.openai.azure.com
export AZURE_API_KEY={your-azure-openai-instance-api-key}
export AZURE_API_VERSION=2024-02-01

$ nano ~/.bash_aliases
alias aidero="aider --model azure/{your-azure-open-ai-gpt-4o-deployment-name}"
```

### Setting up Amazon Bedrock Claude 4 Sonnet

* With the release of `Claude 4 Sonnet` on May 22, 2025, it has become one of the most recommended models along with **OpenAI GPT-4o**. Personally, it has become my preferred model for coding at this point. Here's how to set up the **Claude 4 Sonnet** model on **Amazon Bedrock**:
    

```bash
$ nano ~/.bashrc
export AWS_ACCESS_KEY_ID={your-aws-access-key}
export AWS_SECRET_ACCESS_KEY={your-aws-secret-access-key}
export AWS_REGION_NAME=us-west-2

$ nano ~/.bash_aliases
alias aiders="aider --model bedrock/us.anthropic.claude-sonnet-4-20250514-v1:0 --stream --chat-mode ask"
alias aiderst="aider --model bedrock/us.anthropic.claude-sonnet-4-20250514-v1:0 --no-stream --chat-mode ask --no-git"
alias aider="aiders"
```

* If you encounter a `Too many tokens, please wait before trying again.` error when querying **Aider** after the above configuration, you'll need to add the following additional settings. The key is to reduce the `extra_params.max_tokens` value from the default **64000** to **39200**. [\[Related Link\]](https://github.com/anthropics/claude-code/issues/1293)
    

```bash
$ nano ~/.aider.model.settings.yml
- name: bedrock/us.anthropic.claude-sonnet-4-20250514-v1:0
  edit_format: diff
  weak_model_name: bedrock/us.anthropic.claude-sonnet-4-20250514-v1:0
  use_repo_map: true
  extra_params:
    extra_headers:
      anthropic-beta: prompt-caching-2024-07-31,pdfs-2024-09-25,output-128k-2025-02-19
    max_tokens: 39200
    thinking:
      type: enabled
      budget_tokens: 32000
  cache_control: true
  editor_model_name: bedrock/us.anthropic.claude-sonnet-4-20250514-v1:0
  editor_edit_format: editor-diff
  accepts_settings:
  - thinking_tokens
  use_temperature: 1
```

### Running Aider

* Run **Aider** in the project root as follows:
    

```bash
# Run Aider in default console mode
$ aider

# Run Aider in default console mode + specify target files
$ aider {file-path-1} {file-path-2} {file-path-3}

# Run in Browser mode
$ aider --browser

# Creating a convention
$ nano CONVENTIONS.md
- Put the truth and the correct answer above all else. Feel free to criticize user's opinion, and do not use false empathy with the user. Keep a dry and realistic perspective.
- You should also respond to non-code questions.

# Applying the convention
$ aider --read CONVENTIONS.md
```

* The target project should be managed with **Git** to maximize **Aider**'s coding assistant capabilities. This is because, in addition to the source code, it provides the **LLM** with the file map from **Git** as context to use related files in the assistant.
    
* You can specify multiple existing files or new files to be written as coding targets when running. Or you can add them later using the `/add` command after execution.
    

### Real-world Example

* Below is an example of running **Aider** after creating a basic skeleton project for **Spring Boot**:
    

```bash
# Create a basic Kotlin, Spring Boot project
$ sdk install springboot
$ spring init --type gradle-project-kotlin --language kotlin --java-version 21 --dependencies=web demo
$ cd demo

# Start in /ask mode to provide answers to questions without code modifications
$ aider --chat-mode ask "build.gradle.kts"
ask> What language and framework was this project created with?

This project is built with the following technology stack:

 • Main programming language: Kotlin (version 1.9.25)
 • Framework: Spring Boot (version 3.3.5)

Looking at the build.gradle.kts file:

 • It uses Kotlin JVM and Kotlin Spring plugins.
 • It's based on the Spring Boot framework.
 • It's configured to use Java 21.

Key dependencies include:

 • spring-boot-starter-web
 • jackson-module-kotlin (module for JSON processing)
 • kotlin-reflect, etc.

This indicates that it's a Spring Boot web application written in Kotlin.

# Use /code mode to give instructions for code creation and editing
ask> /code Create a simple calculator program.

# Run build command in /run mode to check if the code works properly
ask> /run ./gradlew build -x test

# If build errors occur, give instructions for fixes
ask> /code Fix the build errors.

# Give instructions for modifications based on advanced reasoning
ask> /architect Are there any areas for improvement in the calculator program?

# Exit Aider
ask> /exit
```

### References

* [Aider](https://aider.chat/)
