π Privacy-First β’ π§ Advanced Reasoning β’ π¬ Deep Research β’ β‘ High Performance
An intelligent, private AI assistant that runs entirely on your local machine
π’ TL;DR:
- Install Ollama and Python 3.11+
- Clone this repo:
git clone ... && cd basic-chat
- Create venv:
python -m venv venv && source venv/bin/activate
- Install deps:
pip install -r requirements.txt
- Pull models:
ollama pull mistral
andollama pull nomic-embed-text
- Start app:
./start_basicchat.sh
(recommended) or./start_dev.sh
- Visit: http://localhost:8501 (or your chosen port)
- Ollama (local LLM server)
- Python 3.11+
- Redis (optional, for background tasks)
- Git
ollama pull mistral # Reasoning model
ollama pull nomic-embed-text # Embedding model for RAG
ollama pull llava # (Optional) Vision model for images
git clone https://github.com/khaosans/basic-chat-template.git
cd basic-chat-template
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
# Start Ollama (if not running)
ollama serve &
# Start app with all services (recommended)
./start_basicchat.sh
# or for dev mode
./start_dev.sh
App URLs:
- Main App: http://localhost:8501
- Task Monitor (Flower): http://localhost:5555
- Redis:
localhost:6379
- Ollama:
localhost:11434
- π’ Always use local code for E2E and dev (not Docker)
- π’ Run health checks before E2E:
poetry run python scripts/e2e_health_check.py
- π’ Use
.env.local
for secrets and config (never commit keys) - π’ Use streaming for best UX
- π’ Monitor logs and Flower for background tasks
- π’ Stop all Docker containers before local dev/E2E
- π’ Ensure backwards compatibility for stored data
- π’ Store all important keys in
.env.local
- π’ Use
bunx
for TypeScript,poetry
for Python - π’ Prefer
0.0.0.0
overlocalhost
for server hosts - π’ Check
progress.md
for always-up-to-date tips
- Run all tests:
pytest -n auto
- E2E tests:
bunx playwright test --reporter=list
- Coverage:
pytest --cov=app --cov-report=html
- Pre-commit hooks:
pre-commit run --all-files
- Type checking:
mypy . --strict
- CI/CD: Always starts from source, not Docker
BasicChat includes an intelligent LLM Judge that evaluates code quality, test coverage, documentation, architecture, security, and performance.
# Automatic setup
./scripts/setup_local_llm_judge.sh
# Quick evaluation (smart backend selection)
make llm-judge-quick
# Full evaluation (smart backend selection)
make llm-judge
- Smart Backend Selection: Automatically chooses Ollama (local) or OpenAI (remote/CI)
- Comprehensive Evaluation: 6 categories with weighted scoring
- Actionable Reports: Prioritized improvement plans
- Multiple Backends: Ollama (local) and OpenAI (cloud) with automatic fallback
- CI/CD Integration: Automated quality gates with OpenAI for remote environments
- Deterministic Results: Consistent evaluation standards
llm_judge_action_items.md
- Prioritized action planllm_judge_improvement_tips.md
- Specific improvement tipsllm_judge_results.json
- Detailed evaluation data
π Full Documentation: Local LLM Judge Setup
- Redis not running?:
brew services start redis
orsudo systemctl start redis
- Ollama not running?:
ollama serve
- Port in use?:
lsof -i :8501
thenkill -9 <PID>
- Permission issues?:
chmod +x *.sh
- Check logs:
tail -f basicchat.log
- Health check:
poetry run python scripts/e2e_health_check.py
- LLM Judge issues?: See Local LLM Judge Setup
+-------------------+ +-------------------+ +-------------------+
| User Interface | ---> | Reasoning Engine | ---> | Ollama/Tools |
+-------------------+ +-------------------+ +-------------------+
| | |
v v v
+-------------------+ +-------------------+ +-------------------+
| Document Uploads | ---> | Document Processor| ---> | ChromaDB/Vector |
+-------------------+ +-------------------+ +-------------------+
Mermaid: System Architecture
graph TB
subgraph "π¨ User Interface"
UI[Web Interface]
AUDIO[Audio Processing]
end
subgraph "π§ Core Logic"
RE[Reasoning Engine]
DP[Document Processor]
TR[Tool Registry]
end
subgraph "β‘ Services"
AO[Ollama Client]
VS[Vector Store]
CS[Cache Service]
WS[Web Search]
end
subgraph "ποΈ Storage"
CHROMA[Vector Database]
CACHE[Memory Cache]
FILES[File Storage]
end
subgraph "π External"
OLLAMA[LLM Server]
DDG[Search Engine]
end
UI --> RE
UI --> DP
AUDIO --> RE
RE --> AO
RE --> VS
RE --> TR
DP --> VS
TR --> WS
AO --> OLLAMA
VS --> CHROMA
CS --> CACHE
WS --> DDG
CHROMA --> FILES
CACHE --> FILES
- Startup Guide
- Development Guide
- Features Overview
- System Architecture
- Technical Overview
- Planning & Roadmap
- Evaluators & LLM Judge
- Local LLM Judge Setup
- progress.md β always up-to-date best practices
This project is licensed under the MIT License - see the LICENSE file for details.
Built with β€οΈ using modern Python, async/await, and best practices for production-ready AI applications.