A powerful, privacy-focused chatbot that runs entirely on your machine
Features β’ Demo β’ Installation β’ Usage β’ Swarm Mode
- 100% Local - All processing happens on your machine. No data sent to external servers (except optional web search)
- Multi-Model Support - Load and switch between any models from LM Studio
- Real-time Streaming - See responses generate word-by-word
- Smart Web Search - Auto-detects when to search the web for current information
- Source Citations - Every web search result includes clickable source links
- Conversation Memory - Maintains context throughout your chat session
- Multi-Model Responses - Query multiple AI models simultaneously
- Color-Coded Chat - Each model gets a unique color for easy identification
- Group Chat Interface - Models respond together like a conversation
- Flexible Selection - Choose which models participate in the swarm
- Consensus Building - Compare different perspectives on the same question
- Modern React UI - Clean, responsive design with Tailwind CSS
- Dark/Light Themes - (Customizable via Tailwind)
- Model Selector - Easy dropdown to switch between loaded models
- Connection Status - Real-time indicator for LM Studio connection
- Mobile Responsive - Works great on any device
Ask questions and get intelligent responses powered by your local LLM:
You: What is quantum computing?
Bot: Quantum computing is a type of computing that uses quantum-mechanical
phenomena...
Get multiple perspectives at once:
You: What's the best programming language for beginners?
π΅ Qwen-3: I'd recommend Python because of its readability...
π£ Qwen-2.5: JavaScript is great for beginners since you can see results immediately...
π’ Llama-3: Consider starting with Python for its extensive libraries...
Automatic web search for current information:
You: What's the weather in Tokyo today?
π Searching the web...
Bot: According to current weather data [1], Tokyo is experiencing...
Sources:
[1] Weather.com - Tokyo Weather Forecast
[2] Japan Meteorological Agency - Current Conditions
-
Node.js (v16 or higher)
node --version # Should be 16.0.0 or higher -
LM Studio - Download here
- Install LM Studio
- Download at least one model (recommended: Phi-3, Qwen, or Llama)
-
Brave Search API Key (Optional, for web search)
- Free tier: brave.com/search/api
- 2,000 queries/month for free
-
Clone the repository
git clone https://github.com/yourusername/local-llm-chatbot.git cd local-llm-chatbot -
Install dependencies
npm install
-
Configure environment
cp .env.example .env
Edit
.envand add your Brave API key (optional):BRAVE_API_KEY=your_brave_api_key_here
-
Set up LM Studio
- Open LM Studio
- Go to "Discover" and download a model
- Load the model in the "Chat" tab
- Go to "Local Server" β Click "Start Server"
- Verify it's running on port 1234
-
Test the connection
npm run test:lm
You should see:
β LM Studio is working correctly! -
Start the application
npm run dev
-
Open in browser
http://localhost:5173
- Select a model from the dropdown
- Type your question
- Press Send or hit Enter
- Watch the response stream in real-time
The chatbot automatically searches the web when you ask about:
- Current events, news, weather
- Latest versions, prices, stock data
- Real-time information
- Recent facts
Example queries:
- "What's the latest iPhone model?"
- "Current price of Bitcoin"
- "Weather in Paris today"
Activate Swarm Mode:
- Click the "π Swarm ON" button in the header
- Select which models you want to participate
- Ask your question
- All selected models will respond with unique colors
Use Cases for Swarm Mode:
- Compare perspectives - See how different models approach the same problem
- Fact-checking - Cross-reference information across models
- Creative brainstorming - Get diverse ideas from multiple AI personalities
- Code review - Multiple models can spot different issues
- Learning - See how different models explain concepts
- Add font files to
public/fonts/ - Update
src/index.css:@font-face { font-family: 'YourFont'; src: url('/fonts/YourFont.woff2') format('woff2'); } body { font-family: 'YourFont', sans-serif; }
Simply load different models in LM Studio and they'll appear in the dropdown automatically!
Edit server.js line 109:
temperature: 0.3, // Lower = more focused, Higher = more creativelocalLLM/
βββ src/
β βββ App.jsx # Main React component with Swarm Mode
β βββ main.jsx # React entry point
β βββ index.css # Tailwind styles
βββ public/ # Static assets
βββ server.js # Express backend with multi-model support
βββ test-lmstudio.js # LM Studio connection tester
βββ .env.example # Environment variables template
βββ vite.config.js # Vite configuration
βββ tailwind.config.js # Tailwind CSS configuration
βββ package.json # Dependencies and scripts
Send a message and receive streaming response
Request:
{
"message": "Your question",
"conversationId": "unique-id",
"model": "qwen/qwen3-vl-4b",
"swarmMode": false,
"models": ["model1", "model2"]
}Response: Server-Sent Events (SSE)
data: {"type":"status","status":"Analyzing query..."}
data: {"type":"content","content":"Response text...","modelId":"model-name"}
data: {"type":"sources","sources":[...]}
data: {"type":"done"}
Get list of available models from LM Studio
Response:
{
"models": [
{"id": "qwen/qwen3-vl-4b", "name": "qwen3-vl-4b"},
{"id": "qwen2.5-3b-instruct", "name": "qwen2.5-3b-instruct"}
]
}Check server and LM Studio connection status
Clear conversation history
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Ensure LM Studio is running
- Check that Local Server is started (port 1234)
- Load a model in LM Studio
- Run
npm run test:lmto diagnose
- Make sure models are loaded in LM Studio (not just downloaded)
- Restart the dev server
- Check browser console for errors
- Verify
BRAVE_API_KEYin.env - Check free tier limits (2000 queries/month)
- Web search is optional - chatbot works without it
- Try smaller models (Phi-3, Qwen-2.5-3B)
- Close other applications
- Check CPU/GPU usage
- Reduce context length in LM Studio settings
npm run dev # Start both backend and frontend
npm run dev:server # Start backend only
npm run dev:client # Start frontend only
npm run test:lm # Test LM Studio connection
npm run build # Build for production- 100% Local Processing - Your conversations never leave your machine
- No External APIs - Except optional Brave Search (can be disabled)
- No Data Collection - We don't collect, store, or transmit your data
- Open Source - Full transparency, inspect the code yourself
This project is licensed under the MIT License - see the LICENSE file for details.
- LM Studio - For making local LLMs accessible
- Brave Search - For the free search API
- React - UI framework
- Tailwind CSS - Styling
- Vite - Build tool
- Express - Backend framework
If you find this project useful, please consider giving it a star!
Built with β€οΈ for the local AI community