Skip to content

Latest commit

 

History

History
104 lines (73 loc) · 2.49 KB

File metadata and controls

104 lines (73 loc) · 2.49 KB

Setup Guide

Step-by-step guide to get lite-chat running locally.

Prerequisites

Tool Version Purpose
Node.js 18+ Frontend runtime
Python 3.11+ Backend runtime
Ollama Latest Local LLM server

1. Clone the Repository

git clone https://github.com/MaharshPatelX/lite-chat.git
cd lite-chat

2. Start Ollama

Install Ollama from ollama.com, then pull a model:

ollama pull qwen3.5:9b

Verify it's running:

curl http://localhost:11434/api/tags

You can use any model — the app lets you switch models from the UI.

3. Backend Setup

cd backend
python -m venv .venv

# Activate virtual environment
# Linux/macOS:
source .venv/bin/activate
# Windows:
.venv\Scripts\activate

pip install -r requirements.txt
uvicorn app.main:app --reload

Backend runs at http://localhost:8000

Verify: curl http://localhost:8000/api/health

Backend Configuration

All settings are in backend/app/config.py:

Setting Default Description
OLLAMA_BASE_URL http://localhost:11434 Ollama server address
DEFAULT_MODEL qwen3.5:9b Default model for new chats
CONTEXT_FULL_EXCHANGES 5 Number of recent exchanges sent in full
SUMMARY_MAX_TOKENS 500 Max tokens for conversation summaries
DB_PATH data/chat.db SQLite database location

4. Frontend Setup

cd frontend
npm install
npm run dev

Frontend runs at http://localhost:3000

Frontend Configuration

Set NEXT_PUBLIC_API_URL in your environment to point to a different backend:

NEXT_PUBLIC_API_URL=http://localhost:8000 npm run dev

Default is http://localhost:8000.

5. Verify Everything Works

  1. Open http://localhost:3000
  2. Check the connection status indicator (top of page)
  3. Select a model from the dropdown
  4. Send a message

Troubleshooting

Problem Solution
"Backend offline" banner Make sure uvicorn is running on port 8000
"Model server offline" Make sure Ollama is running: ollama serve
No models in dropdown Pull a model: ollama pull llama3.2
CORS errors Backend has CORS configured for all origins by default
Database errors Delete backend/data/chat.db and restart — it auto-recreates
Port conflict Change uvicorn port: uvicorn app.main:app --port 8001