Aider Configuration with Model Aliases
Configure Aider with a default model, dark mode theme, and convenient aliases for switching between multiple AI models including Gemini, DeepSeek R1, Claude Sonnet, and OpenAI O3-mini.
What This Skill Does
This skill sets up an Aider configuration file (`.aider.conf.yaml`) that:
Uses Gemini 2.5 Flash Preview as the default modelEnables dark mode for better readabilityDisables automatic git commits for manual controlAutomatically reads project conventions from `CONVENTIONS.md`Creates quick-switch aliases for multiple AI models via OpenRouter and direct providersInstructions
1. Create the Configuration File
Create a `.aider.conf.yaml` file in your project root with the following structure:
```yaml
Default model configuration
model: gemini/gemini-2.5-flash-preview-05-20
UI preferences
dark-mode: true
Git behavior
auto-commits: false
Convention reading
read: CONVENTIONS.md
Model aliases for quick switching
alias:
- r1:openrouter/deepseek/deepseek-r1:free
- claude:openrouter/anthropic/claude-3.7-sonnet
- o3-mini:openrouter/openai/o3-mini
```
2. Customize Model Selection
**Default Model Options (uncomment to switch):**
`openrouter/deepseek/deepseek-r1:free` - Free DeepSeek R1 via OpenRouter`gemini/gemini-2.5-pro-preview-05-06` - Gemini Pro for complex tasks`gemini/gemini-2.5-flash-preview-05-20` - Gemini Flash for fast iteration (recommended)**Model Alias Usage:**
Once configured, switch models in Aider using:
```bash
/model r1 # Switch to DeepSeek R1
/model claude # Switch to Claude Sonnet
/model o3-mini # Switch to OpenAI O3-mini
```
3. Convention File Setup
Create a `CONVENTIONS.md` file in your project root to document coding standards, architecture patterns, and project-specific guidelines. Aider will automatically read this file on startup to understand your project context.
4. Configuration Options
**Commented Options:**
`multiline: true` - Enable multi-line input mode (uncomment if needed)**Additional Settings You Can Add:**
`editor-model: <model-name>` - Specify a different model for editing vs chat`weak-model: <model-name>` - Set a cheaper model for simple tasks`map-tokens: <number>` - Control repository map detail level`lint: true` - Enable automatic linting after edits5. Environment Variables
Ensure you have API keys configured for the models you plan to use:
```bash
For OpenRouter models
export OPENROUTER_API_KEY=your_key_here
For Gemini direct access
export GEMINI_API_KEY=your_key_here
For OpenAI direct access (if using o3-mini without OpenRouter)
export OPENAI_API_KEY=your_key_here
```
Usage Examples
Example 1: Start Aider with Default Configuration
```bash
Configuration automatically loaded from .aider.conf.yaml
aider
```
Example 2: Override Model for Single Session
```bash
Use Claude even though Gemini is the default
aider --model openrouter/anthropic/claude-3.7-sonnet
```
Example 3: Switch Models During Session
```
/model r1 # Switch to free DeepSeek R1
/code Fix the authentication bug
/model claude # Switch to Claude for complex refactor
/architect Redesign the auth system
```
Example 4: Custom Alias for Your Preferred Model
Add to the `alias:` section:
```yaml
alias:
- fast:gemini/gemini-2.5-flash-preview-05-20
- smart:gemini/gemini-2.5-pro-preview-05-06
- free:openrouter/deepseek/deepseek-r1:free
```
Important Notes
**Auto-commits disabled**: Remember to manually commit your changes with `/commit` or git commands**OpenRouter requirement**: The aliases use OpenRouter for DeepSeek, Claude, and O3-mini. Ensure you have an OpenRouter account and API key**Model availability**: Some models may require paid API access or have rate limits**Convention file**: Keep `CONVENTIONS.md` updated as your project evolves - it's Aider's guide to your codebase style**Cost management**: Flash models are more cost-effective than Pro models. Use Pro for complex architectural decisions onlyConstraints
Configuration file must be named `.aider.conf.yaml` in the project rootModel identifiers must match provider specifications exactlyAlias names cannot contain spaces or special charactersThe `read:` directive only supports single files (for multiple files, use multiple `read:` lines)OpenRouter models require active API key and sufficient credits