A full-stack AI chatbot with conversation memory, built with FastAPI + Next.js + Ollama (local LLM).
- Backend: Python, FastAPI
- Frontend: Next.js (React, TypeScript, Tailwind CSS)
- AI: Ollama — runs fully locally, no API key needed
Swap any model by changing
OLLAMA_MODELinbackend/.env
- 💬 Real-time chat interface
- 🧠 Full conversation history — model remembers context
- 🔒 Runs 100% locally — no data sent to external APIs
- ⚡ FastAPI async backend with CORS support
- 🎨 Clean dark UI with loading animations
ollama-chatbot/
├── backend/
│ ├── main.py # FastAPI app
│ ├── .env # Config (model name, Ollama URL)
│ └── requirements.txt
└── frontend/
└── app/
└── page.tsx # Chat UI
- Python 3.10+
- Node.js 18+
- Ollama installed and running locally
ollama run tinyllamacd backend
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
uvicorn main:app --reload --port 8000cd frontend
npm install
npm run dev| Method | Endpoint | Description |
|---|---|---|
| GET | / |
Health check |
| POST | /chat |
Send message with full history |
| DELETE | /chat |
Clear conversation |