Upload PDFs and query them using an open-source LLM (Mistral via Ollama).
Install:
- Node.js (>= 18)
- Python (>= 3.9)
- pip
Mac
brew install ollamaLinux
curl -fsSL https://ollama.com/install.sh | shWindows
- Download from: https://ollama.com/download
- Install the
.exe - It will run as a background service
Mac/Linux
ollama serveWindows
- Ollama usually starts automatically after install
- If not, open Command Prompt / PowerShell:
ollama serveollama pull mistral(Optional test)
ollama run mistralcd backend
python -m venv .venvMac/Linux
source .venv/bin/activateWindows (CMD)
.venv\Scripts\activateWindows (PowerShell)
.venv\Scripts\Activate.ps1pip install fastapi uvicorn chromadb pymupdf sentence-transformers requestsuvicorn main:app --reloadRuns at:
http://localhost:8000
cd frontend
npm install
npm run devRuns at:
http://localhost:5173
- Start Ollama
ollama serve- Start backend
cd backend
uvicorn main:app --reload- Start frontend
cd frontend
npm run dev-
Open frontend in browser
-
Upload a PDF
-
Ask questions like:
- "What is the total amount?"
- "Who is billed?"
LLM not responding
ollama serveFirst run is slow
- Mistral downloads ~4–5GB (one-time)
PowerShell script blocked (Windows) Run:
Set-ExecutionPolicy RemoteSigned -Scope CurrentUserEmpty answers
- PDF may not contain extractable text (scanned PDFs need OCR)
- Uses ChromaDB (local vector DB)
- Uses sentence-transformers for embeddings
- If answer not found → returns:
Not found in document
If all 3 services are running (Ollama → Backend → Frontend), the system should work end-to-end.