A powerful VS Code extension that provides AI-powered code completion similar to GitHub Copilot, but with support for multiple API keys from various free AI providers.
Features
- Multi-Provider Support: Works with OpenAI, Anthropic, Groq, DeepSeek, Mistral, and Cohere
- Multiple API Keys: Add multiple API keys per provider for load balancing and redundancy
- Inline Code Completion: Provides intelligent code suggestions as you type
- Configurable Settings: Adjust temperature, max tokens, and debounce delay
- Status Bar Indicator: See the extension status at a glance
- Cache System: Improves performance by caching completions
Supported AI Providers
- OpenAI - GPT models
- Anthropic - Claude models
- Groq - Fast inference with Llama models
- DeepSeek - Specialized in code completion
- Mistral - Efficient language models
- Cohere - Command models
Installation
- Clone this repository
- Run
npm install - Run
npm run compile - Open VS Code
- Go to Extensions > Develop Extensions
- Click "Install from VSIX" or use "F5" to run in development mode
Configuration
Adding API Keys
- Open Command Palette (Ctrl+Shift+P)
- Type "Haileopia: Manage API Keys"
- Select "Add API Key"
- Choose your provider and enter your API key
You can add multiple API keys per provider. The extension will randomly select one to distribute the load.
Settings
haileopia.enabled: Enable/disable the extensionhaileopia.maxTokens: Maximum tokens for completion (default: 1000)haileopia.temperature: Temperature for AI responses (0-1, default: 0.1)haileopia.debounceDelay: Debounce delay in milliseconds (default: 500)
Commands
Haileopia: Toggle AI Completion- Enable/disable code completionHaileopia: Manage API Keys- Add, view, or remove API keysHaileopia: Clear Cache- Clear the completion cache
Getting API Keys
Free API Key Sources
- OpenAI: Get free credits at platform.openai.com
- Anthropic: Request access at console.anthropic.com
- Groq: Sign up at groq.com - generous free tier
- DeepSeek: Get API key at platform.deepseek.com
- Mistral: Sign up at mistral.ai
- Cohere: Get API key at cohere.com
Usage
- Configure at least one API key
- Start typing code in any supported language
- The AI will provide inline completion suggestions
- Press Tab to accept a suggestion
- Click the status bar item to toggle the extension on/off
Development
Building
npm install
npm run compile
Testing
npm run test
Running in Development
- Open this folder in VS Code
- Press F5 to launch a new VS Code window with the extension loaded
- Make changes to the source code
- Press Ctrl+R in the development window to reload
File Structure
src/
extension.ts # Main extension entry point
completionProvider.ts # Inline completion logic
aiProviders.ts # AI provider implementations
apiKeyManager.ts # API key management
statusBarManager.ts # Status bar functionality
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
License
MIT License
Troubleshooting
Extension not working
- Check that you have configured at least one API key
- Verify the extension is enabled (status bar should show "Haileopia")
- Check the developer console for error messages
API errors
- Verify your API keys are correct
- Check if you have exceeded rate limits
- Try adding multiple API keys for load balancing
Performance issues
- Increase the debounce delay in settings
- Clear the cache using the command
- Reduce max tokens setting
Support
For issues and feature requests, please open an issue on the GitHub repository.