Multi-agent Aider setup routing to local Qwen models via LiteLLM for role-based AI coding assistance on M2 hardware
A sophisticated Aider configuration that routes coding tasks to local Qwen models through LiteLLM, optimized for M2 16GB systems. This setup enables role-based AI assistance with multiple specialized agents for different development tasks.
This Aider configuration connects to a local LiteLLM proxy serving Qwen models, enabling:
1. **LiteLLM proxy running locally** on port 4000 serving Qwen models
2. **Aider installed** (`pip install aider-chat`)
3. **Git repository** (configuration assumes git-tracked project)
4. **(Optional)** API keys for cloud agents: `GOOGLE_API_KEY` for Gemini, `XAI_API_KEY` for Grok
```yaml
model: openai/local/llama
openai-api-base: http://127.0.0.1:4000/v1
openai-api-key: sk-anything # Placeholder for local proxy
```
```yaml
pretty: true # Formatted output
stream: true # Real-time response streaming
auto-commits: false # Manual commit control
git: true # Git integration enabled
edit-format: diff # Show changes as diffs
show-diffs: true # Display diffs before applying
max-chat-history-tokens: 8192 # Context window limit
cache-prompts: true # Cache for faster responses
restore-chat-history: false # Don't restore old sessions (saves memory)
```
```yaml
ignore-globs: |
*.log
*.tmp
**/node_modules/**
**/dist/**
**/build/**
**/.vite/**
**/.next/**
**/coverage/**
rag/index/*.duckdb*
**/*.pyc
**/__pycache__/**
```
Save the configuration as `.aider.conf.yml` in your project root:
```bash
cat > .aider.conf.yml << 'EOF'
model: openai/local/llama
openai-api-base: http://127.0.0.1:4000/v1
openai-api-key: sk-anything
pretty: true
stream: true
auto-commits: false
git: true
edit-format: diff
show-diffs: true
max-chat-history-tokens: 8192
cache-prompts: true
restore-chat-history: false
encoding: utf-8
ignore-globs: |
*.log
*.tmp
**/node_modules/**
**/dist/**
**/build/**
**/.vite/**
**/.next/**
**/coverage/**
rag/index/*.duckdb*
**/*.pyc
**/__pycache__/**
EOF
```
Ensure LiteLLM is running with your Qwen models configured:
```bash
litellm --port 4000 --config litellm_config.yaml
```
```bash
aider
```
The configuration supports role-based agent switching via command-line flags:
```bash
aider --model openai/local/llama
aider --model openai/local/llama-cpu
aider --model openai/local/llama-small
aider --model openai/gemini/1.5-pro
aider --model openai/xai/grok-code-fast-1
```
| Agent Name | Model | Use Case | Requirements |
|------------|-------|----------|--------------|
| **guy** | `local/llama` | General coding, architecture design | Local LiteLLM + Qwen |
| **aegis** | `local/llama-cpu` | Security review, audit | Local LiteLLM + Qwen (CPU) |
| **hermes** | `local/llama-small` | Quick fixes, PR reviews | Local LiteLLM + Qwen (small) |
| **elara** | `gemini/1.5-pro` | Research, documentation | `GOOGLE_API_KEY` |
| **power** | `xai/grok-code-fast-1` | Complex refactoring | `XAI_API_KEY` |
```bash
aider
> /add src/components/Button.tsx
> Add a disabled state with opacity 0.5
> /commit "feat: add disabled state to Button"
> /exit
aider --model openai/local/llama-cpu
> /add src/components/Button.tsx
> Review this component for XSS and injection vulnerabilities
```
**Aider can't connect to model:**
**High memory usage:**
**Cloud agents not working:**
Edit your LiteLLM config to expose additional models, then call via:
```bash
aider --model openai/your-custom-route
```
For longer conversations or larger files:
```yaml
max-chat-history-tokens: 16384 # Double the default
```
**Warning**: Higher token limits increase VRAM usage.
For rapid prototyping without manual commit control:
```yaml
auto-commits: true
```
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/intelgraph-ai-symphony-agent-centric-configuration/raw