ai-code-assistant
v1.0.0
Published
AI coding assistant with configurable providers and project context
Maintainers
Readme
🤖 AI Coding Assistant
Never hit API rate limits again
Seamless AI coding with automatic failover across 15+ free AI providers.
A terminal-based AI coding assistant that automatically switches between multiple AI providers whenever one becomes unavailable or rate-limited.
Zero cost. Zero interruptions. Maximum productivity.
✨ Features
| Feature | Description | | ----------------------- | --------------------------------------------------------- | | 🔄 Auto Failover | Automatically switches providers when rate limits are hit | | 🧠 Persistent Context | Remembers conversations across sessions | | 📦 Large Prompt Support | Handles prompts with thousands of lines | | 🆓 Free to Use | Leverages free tiers from multiple providers | | 🚀 Unlimited Workflow | Continue working even when providers throttle requests | | 💬 Dual Mode | General Chat + Coding Assistant modes | | 🔧 Project Operations | Read files, analyze code, execute commands | | 📊 Smart Routing | Tracks provider health and prioritizes working services | | 🔒 Privacy First | Context stored locally in Markdown files |
🎯 Why This Exists
Most AI coding tools depend on a single provider.
When that provider:
- Hits rate limits
- Goes down
- Becomes slow
- Exceeds free quotas
your workflow stops.
AI Coding Assistant solves this problem by automatically rotating between multiple providers behind the scenes.
Example
User Request
│
▼
Groq ❌ Rate Limited
│
▼
Gemini ❌ Temporary Error
│
▼
Cohere ✅ Success
│
▼
Response ReturnedYou never see the failover process—it just works.
📦 Installation
Global Installation
npm install -g ai-code-assistantRun Without Installing
npx ai-code-assistantInstall From Source
git clone https://github.com/PraveenMistry/ai-code-assistant.git
cd ai-code-assistant
npm install
npm link🚀 Quick Start
1. Run Setup Wizard
ai-code --setup2. Select Providers
Choose providers such as:
- Groq
- Gemini
- Cohere
- Hugging Face
- OpenRouter
3. Enter API Keys
The wizard will guide you through configuration.
4. Start Coding
ai-code💻 Usage
General Chat Mode (Default)
💻 > What is the capital of France?
💻 > Explain quantum computing in simple terms
💻 > Tell me a joke
💻 > How do I learn Python?Coding Mode
Switch modes anytime:
💻 > mode
🎭 Mode switched to: CODING MODEExamples:
💻 > create a React Button component
💻 > fix the bug in server.js
💻 > add error handling to the API
💻 > write unit tests for auth moduleWorking With Your Project
💻 > analyzeAnalyze project structure and requirements.
💻 > listList all project files.
💻 > read package.jsonRead a specific file.
💻 > contextShow conversation history.
🧩 Commands
General Commands
| Command | Description | | ------- | ----------------------------------- | | help | Show help and examples | | mode | Switch between Chat and Coding mode | | context | View conversation history | | clear | Clear current session | | stats | Show provider performance | | exit | Save session and quit |
Coding Commands
| Command | Description | | ----------- | ------------------------- | | analyze | Analyze project structure | | list | List project files | | read | Read file contents |
🔑 Supported Providers
| # | Provider | Free Tier | Status | | - | ------------ | -------------------- | ------------- | | 1 | Groq | 10K tokens/min | ✅ Fastest | | 2 | Gemini | 60 requests/min | ✅ Recommended | | 3 | Cohere | 100K tokens/month | ✅ Stable | | 4 | Hugging Face | 30K tokens/day | ✅ Good | | 5 | OpenRouter | 20 req/min + credits | ⚠️ Limited | | 6 | Cerebras | Unlimited | ⚠️ API Issues | | 7 | Together AI | Free credits | ⚠️ Limited | | 8 | DeepInfra | 10K tokens/day | ⚠️ Limited | | 9 | Lepton AI | 100 req/day | ⚠️ Limited |
Recommended Setup
For best reliability:
1. Groq
2. Gemini
3. Cohere⚙️ Configuration
Environment Variables (.env)
# Groq
GROQ_API_KEY=gsk_xxxxxxxxx
GROQ_MODEL=mixtral-8x7b-32768
GROQ_PRIORITY=1
GROQ_ENABLED=true
# Gemini
GEMINI_API_KEY=xxxxxxxxx
GEMINI_MODEL=gemini-1.5-flash
GEMINI_PRIORITY=2
GEMINI_ENABLED=true
# Cohere
COHERE_API_KEY=xxxxxxxxx
COHERE_MODEL=command
COHERE_PRIORITY=3
COHERE_ENABLED=true
# Project
PROJECT_PATH=/path/to/project
TRD_PATH=/path/to/requirements.md
# Context
MAX_RESPONSE_TOKENS=2048
MAX_CONTEXT_CHARS=6000
MAX_HISTORY_MESSAGES=10Setup Wizard
Run:
ai-code --setupThe wizard will:
- Detect existing configuration
- Allow reset or reuse
- Configure providers
- Add API keys
- Set project paths
- Save preferences
📁 Project Structure
your-project/
│
├── .ai-context/
│ ├── session.md
│ ├── history/
│ └── prompts/
│
├── .env
│
└── source files...💡 Tips
Get Free API Keys
| Provider | URL | Setup Time | | -------- | ------------------------------------- | ---------- | | Groq | https://console.groq.com/keys | ~1 min | | Gemini | https://aistudio.google.com/apikey | ~1 min | | Cohere | https://dashboard.cohere.com/api-keys | ~2 min |
Check Provider Health
💻 > statsClear Context
💻 > clear
🧹 Session cleared!Useful when switching projects or topics.
🔧 Troubleshooting
No Valid Providers Configured
ai-code --setupor
npm run setupProvider Failed
Enable multiple providers:
GROQ_ENABLED=true
GEMINI_ENABLED=trueKeyboard Stops Responding
If a provider hangs:
Ctrl + CRestart the application.
Disable Failing Provider
OPENROUTER_ENABLED=false📊 Performance
| Provider | Avg Response Time | Success Rate | | -------- | ----------------- | ------------ | | Groq | ~500ms | 99% | | Gemini | ~1200ms | 98% | | Cohere | ~2000ms | 95% |
🛣️ Roadmap
Completed
- ✅ Auto failover
- ✅ Multi-provider support
- ✅ Interactive CLI
- ✅ Persistent context
- ✅ Dual mode support
Coming Soon
- 🔄 Ollama / Local Models
- 🔌 VS Code Extension
- 🌐 Web Dashboard
- 🎙 Voice Commands
- 📈 Advanced Analytics
🤝 Contributing
git clone https://github.com/PraveenMistry/ai-code-assistant.git
cd ai-code-assistant
npm install
npm run setup
npm startPull requests are welcome.
📄 License
MIT License
Feel free to use, modify, distribute, and contribute.
Built with ❤️ for developers who hate rate limits
⚡ Type mode to switch between Chat and Coding Mode ⚡
