Skip to the content.

Frequently asked questions

How does aider use git?

Aider works best with code that is part of a git repo. Aider is tightly integrated with git, which makes it easy to:

Aider specifically uses git in these ways:

Aider also allows you to use in-chat commands to /diff or /undo the last change made by GPT. To do more complex management of your git history, you cat use raw git commands, either by using /git within the chat, or with standard git tools outside of aider.

While it is not recommended, you can disable aider’s use of git in a few ways:

How did v0.13.0 change git usage?

As of v0.13.0, aider works with git in a more streamlined manner. Previously, aider would always prompt you if it noticed that you had uncommitted changes anywhere in your repo.

Now aider only pays attention to uncommitted changes in files that GPT attempts to edit. And aider doesn’t interrupt you, it simply commits your pending changes before applying GPT’s edits. This keeps your edits separate from GPT’s edits, and makes sure you never lose your work if GPT makes an inappropriate change.

GPT-4 vs GPT-3.5

Aider supports all of OpenAI’s chat models. You can choose a model with the --model command line argument.

You will probably get the best results with one of the GPT-4 models. They have large context windows, better coding skills and they generally obey the instructions in the system prompt. GPT-4 is able to structure code edits as simple “diffs” and use a repository map to improve its ability to make changes in larger codebases.

GPT-3.5 is supported more experimentally and is limited to editing somewhat smaller codebases. It is less able to follow instructions and can’t reliably return code edits as “diffs”. Aider disables the repository map when using GPT-3.5.

For a detailed and quantitative comparison, please see the code editing benchmark results for GPT-3.5 and GPT-4.

In practice, this means you can use aider to edit a set of source files that total up to the sizes below. The repo can be arbitrarily large, but the specific set of files which need to be edited for your request must fit within the context window. Only /add the files that need to be edited to the chat to minimize your use of the context window and costs.

Model Context
File Size
File Size
gpt-3.5-turbo 4k tokens whole file 2k tokens ~8k bytes no
gpt-3.5-turbo-16k 16k tokens whole file 8k tokens ~32k bytes no
gpt-4 8k tokens diffs 8k tokens ~32k bytes yes
gpt-4-32k 32k tokens diffs 32k tokens ~128k bytes yes

Aider isn’t editing my files?

Sometimes GPT will reply with some code changes that don’t get applied to your local files. In these cases, aider might say something like “Failed to apply edit to filename”.

This usually happens because GPT is not specifying the edits to make in the format that aider expects. GPT-3.5 is especially prone to disobeying the system prompt instructions in this manner, but it also happens with GPT-4.

Aider makes every effort to get GPT to conform, and works hard to deal with replies that are “almost” correctly formatted. If Aider detects an improperly formatted reply, it gives GPT feedback to try again. Also, before each release new versions of aider are benchmarked. This helps prevent regressions in the code editing performance of GPT that could have been inadvertantly introduced.

But sometimes GPT just won’t cooperate. In these cases, here are some things you might try:

Accessing other LLMs with OpenRouter

OpenRouter provide an interface to many models which are not widely accessible, in particular gpt-4-32k and claude-2.

To access the openrouter models simply

Some of the models weren’t very functional and each llm has its own quirks. The anthropic models work ok, but the llama-2 ones in particular will need more work to play friendly with aider.

Can I use aider with other LLMs, local LLMs, etc?

Aider provides experimental support for LLMs other than OpenAI’s GPT-3.5 and GPT-4. The support is currently only experimental for two reasons:

Numerous users have done experiments with numerous models. None of these experiments have yet identified other models that look like they are capable of working well with aider.

Once we see signs that a particular model is capable of code editing, it would be reasonable for aider to attempt to officially support such a model. Until then, aider will simply maintain experimental support for using alternative models.

There are ongoing discussions about LLM integrations in the aider discord.

Here are some GitHub issues which may contain relevant information.

OpenAI API compatible LLMs

If you can make the model accessible via an OpenAI compatible API, you can use --openai-api-base to connect to a different API endpoint.

Local LLMs

LocalAI and SimpleAI look like relevant tools to serve local models via a compatible API.


Aider can be configured to connect to the OpenAI models on Azure. Aider supports the configuration changes specified in the official openai python library docs. You should be able to run aider with the following arguments to connect to Azure:

$ aider \
    --openai-api-type azure \
    --openai-api-key your-key-goes-here \
    --openai-api-base \
    --openai-api-version 2023-05-15 \
    --openai-api-deployment-id deployment-name \

You could also store those values in an .aider.conf.yml file in your home directory:

openai-api-type: azure
openai-api-key: your-key-goes-here
openai-api-version: 2023-05-15
openai-api-deployment-id: deployment-name

See the official Azure documentation on using OpenAI models for more information on how to populate the above configuration values.

Can I change the system prompts that aider uses?

Aider is set up to support different system prompts and edit formats in a modular way. If you look in the aider/coders subdirectory, you’ll see there’s a base coder with base prompts, and then there are a number of different specific coder implementations.

If you’re thinking about experimenting with system prompts this document about benchmarking GPT-3.5 and GPT-4 on code editing might be useful background.

While it’s not well documented how to add new coder subsystems, you may be able to modify an existing implementation or use it as a template to add another.

To get started, try looking at and modifying these files.

The wholefile coder is currently used by GPT-3.5 by default. You can manually select it with --edit-format whole.

The editblock coder is currently used by GPT-4 by default. You can manually select it with --edit-format diff.

When experimenting with coder backends, it helps to run aider with --verbose --no-pretty so you can see all the raw information being sent to/from GPT in the conversation.

Can I run aider in Google Colab?

User imabutahersiddik has provided this Colab notebook.

How can I run aider locally from source code?

To run the project locally, follow these steps:

# Clone the repository:
git clone

# Navigate to the project directory:
cd aider

# Install the dependencies listed in the `requirements.txt` file:
pip install -r requirements.txt

# Run the local version of Aider:
python -m aider.main

Can I script aider?

You can script aider via the command line or python.

Command line

Aider takes a --message argument, where you can give it a natural language instruction. It will do that one thing, apply the edits to the files and then exit. So you could do:

aider --message "make a script that prints hello" hello.js

Or you can write simple shell scripts to apply the same instruction to many files:

for FILE in *.py ; do
    aider --message "add descriptive docstrings to all the functions" $FILE


You can also script aider from python:

from aider.coders import Coder

# This is a list of files to add to the chat
fnames = [""]

# Create a coder object
coder = Coder.create(fnames=fnames)

# This will execute one instruction on those files and then return"make a script that prints hello world")

# Send another instruction"make it say goodbye")

What code languages does aider support?

Aider supports pretty much all the popular coding languages. This is partly because GPT-4 is fluent in most mainstream languages, and familiar with popular libraries, packages and frameworks.

In fact, coding with aider is sometimes the most magical when you’re working in a language that you are less familiar with. GPT often knows the language better than you, and can generate all the boilerplate to get to the heart of your problem. GPT will often solve your problem in an elegant way using a library or package that you weren’t even aware of.

Aider uses tree-sitter to do code analysis and help GPT navigate larger code bases by producing a repository map.

Aider can currently produce repository maps for most mainstream languages, listed below. But aider should work quite well for other languages, even without repo map support.