Installation Guide¶
This guide walks you through setting up Ollama PDF RAG on your system.
Prerequisites¶
Before installing, ensure you have:
| Requirement | Version | Notes |
|---|---|---|
| Python | 3.10+ | Required for LangChain 1.0 |
| Node.js | 18+ | For Next.js frontend |
| pnpm | 9+ | Package manager for Node.js |
| Ollama | Latest | Local LLM server |
| Git | Any | For cloning the repo |
Step 1: Install Ollama¶
macOS / Linux¶
Windows¶
Download from ollama.com/download
Verify Installation¶
Step 2: Pull Required Models¶
# Chat model (choose one or more)
ollama pull llama3.2 # Recommended - fast & capable
ollama pull qwen3:8b # Great for thinking/reasoning
ollama pull mistral # Alternative option
# Embedding model (required)
ollama pull nomic-embed-text
Model Selection
- qwen3:8b and deepseek-r1 support "thinking mode" for chain-of-thought reasoning
- llama3.2 is fastest for general use
- You can pull multiple models and switch between them in the UI
Step 3: Clone the Repository¶
Step 4: Python Environment Setup¶
Using venv (Recommended)¶
# Create virtual environment
python -m venv .venv
# Activate it
# macOS/Linux:
source .venv/bin/activate
# Windows:
.venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
Using uv (Faster Alternative)¶
# Install uv if you don't have it
curl -LsSf https://astral.sh/uv/install.sh | sh
# Create environment and install
uv venv
source .venv/bin/activate
uv pip install -r requirements.txt
Step 5: Next.js Frontend Setup¶
Step 6: Verify Installation¶
Start the Backend¶
You should see:
Start the Frontend (New Terminal)¶
You should see:
Test the App¶
- Open http://localhost:3000
- You should see the PDF Chat interface
- Upload a PDF using the 📎 button
- Select it with the checkbox
- Ask a question!
Directory Structure¶
After installation, your directory should look like:
ollama_pdf_rag/
├── .venv/ # Python virtual environment
├── data/
│ ├── pdfs/ # Uploaded PDFs
│ │ ├── sample/ # Sample PDFs
│ │ └── uploads/ # User uploads
│ ├── vectors/ # ChromaDB vector storage
│ └── api.db # SQLite metadata
├── src/
│ ├── api/ # FastAPI backend
│ ├── app/ # Streamlit app
│ └── core/ # Core RAG logic
├── web-ui/ # Next.js frontend
│ ├── app/ # Next.js app router
│ ├── components/ # React components
│ └── data/
│ └── chat.db # Chat history
├── requirements.txt # Python dependencies
└── run_api.py # Start FastAPI server
Troubleshooting¶
ONNX DLL Error (Windows)¶
Solution:
- Install Microsoft Visual C++ Redistributable
- Restart your computer
- Or try:
Port Already in Use¶
Solution:
Model Not Found¶
Solution:
pnpm Not Found¶
# Install pnpm globally
npm install -g pnpm
# Or using corepack (Node.js 16.10+)
corepack enable
corepack prepare pnpm@latest --activate
SQLite Errors¶
If you see database errors, delete the database files and restart:
Next Steps¶
- Follow the Quick Start Guide to use the app
- Read about PDF Processing
- Learn the RAG Pipeline
- Check the API Reference