AI coding assistant with chain-of-thought, 6 modes, WebLLM local inference & multi-model fallback.
- 6 Thinking Modes β
vibeΒ·debugΒ·refactorΒ·architectΒ·explainΒ·search - Chain-of-Thought Streaming β watch the AI reason step-by-step in real time
- Local AI (WebLLM) β run
Qwen2.5-1.5Bfully in-browser via WebGPU, zero data leaves your machine - Multi-Model Fallback β Groq (llama-3.3-70b) β Groq fallbacks β DeepSeek V3 β optional GPT-4o
- Real-Time Tool Use β
web_search(Tavily),crypto_price(CoinGecko),get_datetimewith parallel execution - Voice Input & Vision β paste screenshots, speak your prompts
- Chat Persistence β sessions saved to Supabase, full history in UI
git clone https://github.com/GodLocal2026/codethinker.git
cd codethinker
npm install
cp .env.example .env.local
# Fill in your API keys in .env.local
npm run devcodethinker/
βββ app/ # Next.js 14 App Router
β βββ api/
β β βββ chat/ # Main inference endpoint
β β βββ tools/ # Tool-use handlers
β βββ page.tsx # Main UI
βββ components/
β βββ CodeThinker.tsx # Core chat component
β βββ ModeSelector.tsx # 6-mode switcher
β βββ ThinkingSteps.tsx # CoT streaming display
β βββ LocalAIToggle.tsx # CLOUD/LOCAL switch
βββ lib/
β βββ providers/ # AI provider clients
β βββ tools/ # Tool definitions
β βββ webllm/ # WebLLM/WebGPU integration
βββ types/
# Required
GROQ_API_KEY=your_groq_key
# Optional (for tool-use web search)
TAVILY_API_KEY=your_tavily_key
# Optional (for chat persistence)
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_key
# Optional (users can provide their own key in Settings)
OPENAI_API_KEY=
# Optional (emergency fallback)
DEEPSEEK_API_KEY=| Priority | Provider | Model | Notes |
|---|---|---|---|
| 1 | Groq | llama-3.3-70b-versatile | Primary |
| 2 | Groq | llama-3.1-8b-instant | Fallback |
| 3 | Groq | gemma2-9b-it | Fallback |
| 4 | DeepSeek | deepseek-chat (V3) | Emergency fallback |
| 5 | OpenAI | gpt-4o | User-provided key |
| 6 | WebLLM | Qwen2.5-1.5B | 100% local, WebGPU |
| Mode | Icon | Purpose |
|---|---|---|
vibe |
β¨ | Creative coding, ideas |
debug |
π | Find and fix bugs |
refactor |
π§ | Clean up and optimize code |
architect |
ποΈ | System design, structure |
explain |
π | Understand code |
search |
π | Web search + code answers |
PRs welcome! See CONTRIBUTING.md for guidelines.
- Fork the repo
- Create your branch (
git checkout -b feat/amazing-feature) - Commit your changes (
git commit -m 'feat: add amazing feature') - Push to the branch (
git push origin feat/amazing-feature) - Open a Pull Request
MIT Β© GodLocal