New:Microsoft Teams Notifications Are Now Available in Socket.Learn more
Get Started

ai-code-assistant

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ai-code-assistant

AI coding assistant with configurable providers and project context

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
12
-25%
Maintainers
1
Weekly downloads
 
Created
Source

🤖 AI Coding Assistant

Never hit API rate limits again

Seamless AI coding with automatic failover across 15+ free AI providers.

npm version License: MIT PRs Welcome

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

FeatureDescription
🔄 Auto FailoverAutomatically switches providers when rate limits are hit
🧠 Persistent ContextRemembers conversations across sessions
📦 Large Prompt SupportHandles prompts with thousands of lines
🆓 Free to UseLeverages free tiers from multiple providers
🚀 Unlimited WorkflowContinue working even when providers throttle requests
💬 Dual ModeGeneral Chat + Coding Assistant modes
🔧 Project OperationsRead files, analyze code, execute commands
📊 Smart RoutingTracks provider health and prioritizes working services
🔒 Privacy FirstContext 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

CommandDescription
helpShow help and examples
modeSwitch between Chat and Coding mode
contextView conversation history
clearClear current session
statsShow provider performance
exitSave session and quit

Coding Commands

CommandDescription
analyzeAnalyze project structure
listList project files
read Read file contents

🔑 Supported Providers

#ProviderFree TierStatus
1Groq10K tokens/min✅ Fastest
2Gemini60 requests/min✅ Recommended
3Cohere100K tokens/month✅ Stable
4Hugging Face30K tokens/day✅ Good
5OpenRouter20 req/min + credits⚠️ Limited
6CerebrasUnlimited⚠️ API Issues
7Together AIFree credits⚠️ Limited
8DeepInfra10K tokens/day⚠️ Limited
9Lepton AI100 req/day⚠️ Limited

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

ProviderURLSetup Time
Groqhttps://console.groq.com/keys~1 min
Geminihttps://aistudio.google.com/apikey~1 min
Coherehttps://dashboard.cohere.com/api-keys~2 min

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

ProviderAvg Response TimeSuccess Rate
Groq~500ms99%
Gemini~1200ms98%
Cohere~2000ms95%

🛣️ 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 ⚡

Keywords

ai

FAQs

Package last updated on 30 May 2026

Related posts