Skip to content

GodLocal2026/codethinker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧠 CodeThinker

AI coding assistant with chain-of-thought, 6 modes, WebLLM local inference & multi-model fallback.

MIT License Live Demo Built with Next.js

✨ Features

  • 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.5B fully 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_datetime with parallel execution
  • Voice Input & Vision β€” paste screenshots, speak your prompts
  • Chat Persistence β€” sessions saved to Supabase, full history in UI

πŸš€ Quick Start

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 dev

Open http://localhost:3000

πŸ—οΈ Architecture

codethinker/
β”œβ”€β”€ 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/

πŸ”§ Environment Variables

# 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=

πŸ€– AI Models

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

πŸ› οΈ Modes

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

🀝 Contributing

PRs welcome! See CONTRIBUTING.md for guidelines.

  1. Fork the repo
  2. Create your branch (git checkout -b feat/amazing-feature)
  3. Commit your changes (git commit -m 'feat: add amazing feature')
  4. Push to the branch (git push origin feat/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

MIT Β© GodLocal


🌐 Live Demo Β· πŸ› Report Bug Β· πŸ’‘ Request Feature

About

🧠 AI coding assistant with chain-of-thought, 6 modes, WebLLM local inference & multi-model fallback. MIT License.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors