🤖 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
| 🔄 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 Returned
You never see the failover process—it just works.
📦 Installation
Global Installation
npm install -g ai-code-assistant
Run Without Installing
npx ai-code-assistant
Install 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 --setup
2. 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 MODE
Examples:
💻 > create a React Button component
💻 > fix the bug in server.js
💻 > add error handling to the API
💻 > write unit tests for auth module
Working With Your Project
💻 > analyze
Analyze project structure and requirements.
💻 > list
List all project files.
💻 > read package.json
Read a specific file.
💻 > context
Show conversation history.
🧩 Commands
General Commands
| 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
| analyze | Analyze project structure |
| list | List project files |
| read | Read file contents |
🔑 Supported Providers
| 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=10
Setup Wizard
Run:
ai-code --setup
The 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
Check Provider Health
💻 > stats
Clear Context
💻 > clear
🧹 Session cleared!
Useful when switching projects or topics.
🔧 Troubleshooting
No Valid Providers Configured
ai-code --setup
or
npm run setup
Provider Failed
Enable multiple providers:
GROQ_ENABLED=true
GEMINI_ENABLED=true
Keyboard Stops Responding
If a provider hangs:
Ctrl + C
Restart the application.
Disable Failing Provider
OPENROUTER_ENABLED=false
📊 Performance
| 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 start
Pull 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 ⚡