### [aider](https://github.com/paul-gauthier/aider)

> Handle: `aider`
> URL: [http://localhost:34011/](http://localhost:34011/)

Aider lets you pair program with LLMs,
to edit code in your local git repository.
Start a new project or work with an existing git repo.
Aider works best with GPT-4o & Claude 3.5 Sonnet and can
[connect to almost any LLM](https://aider.chat/docs/llms.html).

<p align="center">
  <img
    src="https://aider.chat/assets/screencast.svg"
    alt="aider screencast"
  >
</p>

#### Starting

Harbor runs `aider` in a CLI mode.

```bash
# [Optional] pre-pull if needed
harbor pull aider

# See available options
harbor aider --help
```

When running `aider`, Harbor will mount current working directory as a container workspace. This means that running `aider` from a subfolder in a git repo will mask away the fact it's a git repo within the container.

```bash
# Run aider in the current directory
harbor aider

# Aider supports browser/GUI mode
# "Network URL" will be open-able in your browser
harbor aider --gui
```

#### Configuration

`aider` is pre-configured to automatically work with the LLM backends supported by Harbor. You only need to point it to the correct model.

```bash
# Lists active services
harbor ls -a # nothing

# Will try using OpenAI API
harbor aider

# Run one of supported backends
harbor up vllm webui
harbor ls -a # webui vllm

# Set a new model for aider as the model that
# vllm is currently using
harbor aider model $(harbor vllm model)
# Or set a specific model
harbor aider model "microsoft/Phi-3.5-mini-instruct"

# Will use vLLM model
harbor aider

# Let's run with Ollama
harbor down
# "ollama" specifier is not needed if ollama
# is one of the default services
harbor up ollama
# Will use Ollama config now, ensure to point
# it to the correct model!
harbor aider
```

You can configure aider in Harbor via:
- specifying [supported CLI args](https://aider.chat/docs/config/options.html)
- `aider/override.env` file, [official .env reference](https://aider.chat/docs/config/dotenv.html)
- `aider/configs/aider.config.yml` file, [official config reference](https://aider.chat/docs/config/aider_conf.html)
  - Note, that Harbor will override certain portions of this config to connect Aider to the LLM backends
