Configure Aider to use GitHub Copilot's API as the LLM provider with GPT-4.1 for main tasks and GPT-4o-mini for lightweight operations.
Configure Aider to use GitHub Copilot's API endpoint instead of OpenAI directly, leveraging your GitHub Copilot subscription for AI-assisted coding.
This skill sets up Aider to route requests through GitHub Copilot's API, using GPT-4.1 as the primary model for complex coding tasks and GPT-4o-mini for simpler operations like commit messages.
When the user asks to configure Aider for GitHub Copilot or mentions wanting to use their GitHub Copilot subscription with Aider:
1. **Check for existing Aider configuration**
- Look for `.aider.conf.yml` in the project root or user's home directory
- Read the file if it exists to preserve any custom settings
2. **Create or update the configuration file**
- File location: `.aider.conf.yml` in the project root (or `~/.aider.conf.yml` for global config)
- Set the following configuration:
```yaml
openai-api-base: https://api.githubcopilot.com
model: openai/gpt-4.1
weak-model: openai/gpt-4o-mini
show-model-warnings: false
```
3. **Explain the configuration**
- `openai-api-base`: Routes requests to GitHub Copilot's API endpoint
- `model`: Primary model for complex coding tasks (GPT-4.1)
- `weak-model`: Faster model for simple tasks like commit messages
- `show-model-warnings`: Suppresses model compatibility warnings
4. **Verify API key setup**
- Inform the user that `OPENAI_API_KEY` environment variable must contain their GitHub Copilot token
- The token can be obtained from GitHub Copilot settings
- Suggest adding it to their shell profile (`.zshrc`, `.bashrc`, etc.)
5. **Test the configuration** (optional)
- Run `aider --model openai/gpt-4.1` to verify the setup works
- Confirm successful connection to GitHub Copilot API
**User request:**
"Set up Aider to use my GitHub Copilot subscription"
**Expected actions:**
1. Create `.aider.conf.yml` with GitHub Copilot configuration
2. Explain that `OPENAI_API_KEY` must be set to GitHub Copilot token
3. Provide instructions for obtaining the token if needed
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/github-copilot-with-aider/raw