Personal LLM chat interface with multi-model support, streaming responses, and conversation history.
Stack: Next.js 14 + FastAPI + Ollama
- Python 3.10+
- Node.js 18+
- Ollama (local or remote)
cd backend; python -m venv venv; .\venv\Scripts\activate; pip install -r requirements.txtcd frontend; npm installCreate .env in the project root:
OLLAMA_BASE_URL=http://localhost:11434
OLLAMA_DEFAULT_MODEL=qwen2.5:7b
For a remote GPU server, replace with your server's IP:
OLLAMA_BASE_URL=http://your-gpu-ip:11434
Terminal 1 — Backend:
cd backend; .\venv\Scripts\activate; uvicorn main:app --reload --port 8000Terminal 2 — Frontend:
cd frontend; npm run devollama serve
ollama pull qwen2.5:7b
ollama pull qwen3:30b # optional, needs ~20GB VRAM
ollama pull deepseek-r1:70b # optional, needs ~40GB VRAMFor remote servers, start Ollama on all interfaces:
OLLAMA_HOST=0.0.0.0 ollama servedocker compose up --buildSet OLLAMA_BASE_URL in .env before building. Defaults to http://host.docker.internal:11434 (host machine's Ollama).
| Endpoint | Method | Description |
|---|---|---|
/chat |
POST | SSE streaming chat |
/conversations |
GET | List conversations |
/conversations |
POST | Create conversation |
/conversations/{id} |
GET | Get conversation + messages |
/conversations/{id} |
PATCH | Update title/model |
/conversations/{id} |
DELETE | Delete conversation |
/models |
GET | List models + health status |
/control/health |
GET | Ollama + model health |
/control/load/{model} |
POST | Load model into VRAM |
/control/unload/{model} |
POST | Unload model from VRAM |