Overview
Aider is a command-line AI coding assistant that can edit code in your local git repository. It’s designed for pair programming workflows and supports multiple LLM providers. Connect Aider to ModelStack to access all supported models from your terminal.Prerequisites
- Python 3.8+ installed
- Git repository initialized
- ModelStack API key from your dashboard
Installation
Install Aider using pip:Configuration
Method 1: Environment Variables (Recommended)
Set these environment variables in your shell:~/.zshrc or ~/.bashrc to persist across sessions.
Method 2: Command-Line Flags
Pass the configuration directly when running Aider:Usage
Basic Usage
Start Aider in your project directory:- Detect files in your git repo
- Connect to ModelStack
- Open an interactive chat session
Example Session
Switching Models
Change models mid-session:Available Commands
/add <file>- Add files to the chat context/drop <file>- Remove files from context/model <name>- Switch to a different model/commit- Commit changes with AI-generated message/undo- Undo the last change/help- Show all commands
Troubleshooting
Issue: “API key not found” Solution: EnsureOPENAI_API_KEY is set or pass --openai-api-key flag.
Issue: “Model not found”
Solution: Use ModelStack’s standardized model names. See supported models.
Issue: Rate limit errors
Solution: Check your plan limits and consider upgrading if you’re hitting rate limits frequently.
Best Practices
- Start small: Add only relevant files to context with
/add - Use specific models: Choose faster models (Haiku, GPT-4o-mini) for simple tasks
- Review changes: Always review diffs before accepting with
/yes - Commit often: Use
/committo save progress incrementally
Next Steps
- Explore model pricing to optimize costs
- Set up model stacks for automatic fallback
- Track token usage in your dashboard
Last verified: 2026-03-07