We recently discussed tools like Maestro + Qwen2 + DeepCoderV2 that can generate an app in mere seconds, all done locally with a single prompt. While impressive, Maestro has some limitations. The generated apps can’t be integrated with existing codebases or modified post-generation. Adding new features requires manual code editing or starting from scratch, which can be quite cumbersome.

Aider

Key Takeaways

  1. Overview: Aider is a terminal-based AI pair programming tool that collaborates with local git repositories, supporting various large language models (LLMs) like GPT-4o, Claude 3.5 Sonnet, Claude 3 Opus, and DeepSeek Coder V2.
  2. Quick Start: After installation, users can interact with Aider through simple commands, specifying the LLM and working within a git repository.
  3. Main Features: Aider supports multi-file editing, code refactoring, bug fixing, auto-committing, and works with multiple programming languages.
  4. High Performance: Aider performs exceptionally well on the SWE Bench benchmark.
  5. User Feedback: Users highly praise Aider, noting that it significantly improves productivity and coding experience.

Introducing Aider: The Next-Gen AI Coding Assistant

Today, I want to introduce Aider (AER for short), a tool that elegantly solves these problems. As I mentioned in a previous video, Aider enables you to modify generated code with ease.

Aider outshines Maestro by supporting iterative improvements. In this article, I’ll demonstrate how Aider can generate games, websites, apps, and more. It’s also great for text-to-frontend, text-to-app, and other transformations.

Versatile Model Compatibility

One of Aider’s key strengths is its compatibility with a wide range of language models, including:

  • GPT-4O
  • Claude-3
  • CodeQwen
  • Mixtral 8x22b
  • Mixtral 8x7b
  • GPT-4
  • Grok-1.5
  • Gemini Code Assist

Whether you prefer open-source LLMs, OpenAI models, or Claude variants, Aider has you covered.

Powerful Benchmarking Capabilities

Aider recently introduced its own benchmarks, enabling the creation of entire applications with a single prompt. Thanks to its interactive environment, you can request further modifications even after the initial app generation.

Aider is also great for working with legacy codebases and requesting code explanations. As I mentioned in my Cloud Engineer video, it’s essentially a supercharged version of Claude Engineer. Aider allows you to pair program with large language models while editing code in a local git repository, whether you’re starting a new project or working with an existing repo.

Setup & Usage

For this tutorial, I’ll be using Claude 3.5 Sonnet and Deep Seek Coder locally, as they rank highly on performance leaderboards.

Installation

First, let’s install Aider by running:

pip install aider-chat

Since we’re using the Claude 3.5 Sonnet model, remember to set your Anthropic API key in the environment variables.

Anthropic API key
Anthropic API key 2

Initialization

Next, create a new folder and run git init inside it, as Aider only works within git projects. Once done, launch Aider using the aider command with the Sonnet parameter.

Sonnet parameter

You’ll see an interface where you can input questions for Aider to process. Let’s start by asking it to generate a Snake game.

Generating a Snake Game

After sending the prompt, Aider begins generating the code, displaying everything on the screen, including code diffs. Within minutes, the code generation is complete, creating three files and making a git commit. This is similar to Maestro but better.

Generating a Snake Game

Examining the generated code, it looks good overall but is missing a start game button and an end-game popup. Let’s ask Aider to add these features.

Game Over

Iterative Improvements

After sending the request, Aider generates the modified code. A few minutes later, the modifications are complete, showing the changes made and committing them. Now the buttons and popup have been added. This iterative improvement capability sets Aider apart from Maestro.

modified code

Next, let’s ask it to generate a to-do list application. Within minutes, the code is generated, allowing you to create and delete tasks.

to do list

However, there are no edit or mark-as-complete buttons. After requesting these features, Aider adds them in just a few minutes. This fine-tuning ability is fantastic, as you can continue making modifications post-generation until you’re fully satisfied.

Generating a Login Page

Now let’s create a login page. Aider generates the code in a matter of minutes. The initial page is basic, with only About Us and Contact links. After requesting the addition of these links and pages, Aider completes the generation shortly, supporting multi-page and multi-file applications. Aider outperforms Maestro in every aspect.

About Us

Integration with Ollama

Let’s explore how to use Aider with Ollama. First, visit the Ollama website, install the software, and select your desired model.

Aider with Ollama

I’ll be using the Deep Seek Coder V2 model. Once installed, run the command to set the path, and you’re ready to use the model.

Deep Seek Coder V2

Let’s generate a Minesweeper game:

Minesweeper game

Within minutes, the generation is complete, and the game runs flawlessly. How cool is that?

Game Runs Flawlessly

Quick Start

Here are the steps to get started quickly:

text$ pip install aider-chat

# Change directory into a git repo
$ cd /to/your/git/repo

# Work with Claude 3.5 Sonnet
$ export ANTHROPIC_API_KEY=your-key-goes-here 
$ aider

# Work with GPT-4o
$ export OPENAI_API_KEY=your-key-goes-here
$ aider

See the installation instructions and other documentation for more details.

Features

  • Use the aider <file1> <file2> ... command to specify files to edit.
  • Request changes:
    • Add new features or test cases.
    • Describe a bug.
    • Paste error messages or GitHub issue URLs.
    • Refactor code.
    • Update documentation.
  • Aider will edit files to complete your request.
  • Aider automatically commits changes with sensible commit messages.
  • Supports many popular programming languages, including Python, JavaScript, TypeScript, PHP, HTML, CSS, and more.
  • Aider performs best with GPT-4o and Claude 3 Opus and can connect to almost any LLM.
  • Can edit multiple files simultaneously to handle complex requests.
  • Aider uses a map of your entire git repo, excelling in large codebases.
  • Chat with Aider while editing files in your editor; it will always use the latest version. Pair program with AI.
  • Can add images to the chat (for GPT-4o, Claude 3.5 Sonnet, etc.).
  • Can add URLs to the chat; Aider will read their content.
  • Use voice coding.

Outstanding Performance

Aider performs exceptionally well on the SWE Bench benchmark. SWE Bench is a challenging software engineering benchmark where Aider solved real GitHub issues from popular open-source projects like Django, scikit-learn, Matplotlib, and more.

Conclusion

All in all, I prefer Aider for its ability to not only create applications but also allow for seamless modifications, which is simply fantastic.

Below, you’ll find official documentation, related resources, deployment tutorials, and more to further support your exploration and enhance the helpfulness of this article.

Resources

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *