aider: AI pair programming in your terminal

https://aider.chat

Aider can connect to most LLMs

Best models

Aider works best with these models, which are skilled at editing code:

Free models

Aider works with a number of free API providers:

  • Google’s Gemini 1.5 Pro works with aider, with code editing capabilities similar to GPT-3.5.
  • You can use Llama 3 70B on Groq which is comparable to GPT-3.5 in code editing performance.
  • Cohere also offers free API access to their Command-R+ model, which works with aider as a very basic coding assistant.

Local models

Aider can work also with local models, for example using Ollama. It can also access local models that provide an Open AI compatible API.

Use a capable model

Check Aider’s LLM leaderboards to see which models work best with aider.

Be aware that aider may not work well with less capable models. If you see the model returning code, but aider isn’t able to edit your files and commit the changes… this is usually because the model isn’t capable of properly returning “code edits”. Models weaker than GPT 3.5 may have problems working well with aider.

Repository map

Aider uses a concise map of your whole git repository that includes the most important classes and functions along with their types and call signatures. This helps aider understand the code it’s editing and how it relates to the other parts of the codebase. The repo map also helps aider write new code that respects and utilizes existing libraries, modules and abstractions found elsewhere in the codebase.

Using a repo map to provide context

Aider sends a repo map to the LLM along with each change request from the user. The repo map contains a list of the files in the repo, along with the key symbols which are defined in each file. It shows how each of these symbols are defined, by including the critical lines of code for each definition.

Supported languages

Aider should work well with most popular coding languages. This is because top LLMs are fluent in most mainstream languages, and familiar with popular libraries, packages and frameworks.

Aider has specific support for linting many languages. By default, aider runs the built in linter any time a file is edited. If it finds syntax errors, aider will offer to fix them for you. This helps catch small code issues and quickly fix them.

Aider also does code analysis to help the LLM navigate larger code bases by producing a repository map. Aider can currently produce repository maps for many popular mainstream languages, listed below.

Images & web pages

You can add images and URLs to the aider chat.

Images

Aider supports working with image files for many vision-capable models like GPT-4o and Claude 3.7 Sonnet. Adding images to a chat can be helpful in many situations:

  • Add screenshots of web pages or UIs that you want aider to build or modify.
  • Show aider a mockup of a UI you want to build.
  • Screenshot an error message that is otherwise hard to copy & paste as text.
  • Etc.

You can add images to the chat just like you would add any other file:

  • Use /add <image-filename> from within the chat
  • Use /paste to paste an image from your clipboard into the chat.
  • Launch aider with image filenames on the command line: aider <image-filename> along with any other command line arguments you need.

Web pages

Aider can scrape the text from URLs and add it to the chat. This can be helpful to:

  • Include documentation pages for less popular APIs.
  • Include the latest docs for libraries or packages that are newer than the model’s training cutoff date.
  • Etc.

To add URLs to the chat:

  • Use /web <url>
  • Just paste the URL into the chat and aider will ask if you want to add it.

You can also scrape web pages from the command line to see the markdown version that aider produces:

python -m aider.scrape https://aider.chat/docs/usage/tips.html

Publikováno v AITagged