Antbase/Documentation

Aider Integration

Use Antbase with Aider, the CLI AI pair programming tool. Get intelligent model routing for code editing sessions with automatic failover across providers.

What this enables

  • AI pair programming in your terminal with Antbase routing
  • Automatic git commits for AI-generated changes
  • Multi-file editing with intelligent model selection
  • Failover across 30+ providers -- your coding session never drops

Quick Start

1. Install Aider

pip install aider-chat

2. Set environment variables

export OPENAI_API_BASE=https://antbase.ai/v1
export OPENAI_API_KEY=your-ant-api-key

3. Start Aider

aider --model openai/ant:coder

The openai/ prefix tells Aider to use the OpenAI-compatible API.

Ready to code

Add files with /add filename.py and start describing changes.

Configuration

You can also pass the base URL as a flag:

aider --openai-api-base https://antbase.ai/v1 \
      --openai-api-key your-ant-api-key \
      --model openai/ant:coder

Or create an .aider.conf.yml in your project root:

# .aider.conf.yml
openai-api-base: https://antbase.ai/v1
openai-api-key: your-ant-api-key
model: openai/ant:coder

Usage Examples

Different models for different tasks

# Quick bug fixes -- use fast model
aider --model openai/ant:fast

# Complex refactoring -- use best model
aider --model openai/ant:best

# General coding -- use coder model
aider --model openai/ant:coder

# Architecture planning -- use reasoning model
aider --model openai/ant:reasoning

Architect mode

Use a reasoning model for architecture and a coder model for edits:

aider --model openai/ant:reasoning \
      --editor-model openai/ant:coder

Virtual Models

ModelBest forNotes
openai/ant:autoGeneral usePicks optimal model per request
openai/ant:fastQuick fixesLow latency for small changes
openai/ant:bestComplex refactoringFrontier models for large changes
openai/ant:freeTestingZero cost for experimentation
openai/ant:reasoningArchitectureDeep reasoning for design decisions
openai/ant:coderCode generationBest default for Aider sessions

Note the openai/ prefix -- this tells Aider to use the OpenAI-compatible provider. See Virtual Models for the full list.

Troubleshooting

Model not recognized

Always prefix model names with openai/. Without the prefix, Aider tries to match against its built-in model list.

Edit format issues

If the model struggles with Aider's edit format, try --edit-format whole for simpler whole-file edits instead of the default diff format.