Chat With PDF is a full-stack application that allows users to upload PDF files and interact with them using local AI models.
The project uses Ollama for local LLM inference, Qdrant as the vector database, Valkey for caching/queueing, and Clerk for authentication.
- 🔐 Authentication with Clerk
- 📄 Upload and chat with PDF documents
- 🤖 Local AI using Ollama
- 🧠 Vector search powered by Qdrant
- ⚡ Fast caching with Valkey
- 🐳 Docker-based infrastructure
- 🌐 Full-stack Next.js app
- Frontend / Backend: Next.js (App Router)
- Authentication: Clerk
- LLM Runtime: Ollama (local)
- Vector Database: Qdrant
- Cache / Queue: Valkey
- Package Manager: npm
- Containerization: Docker
Make sure you have the following installed:
- Node.js
>=18 - Docker & Docker Compose
- Ollama
- npm
Install Ollama:
curl -fsSL https://ollama.com/install.sh | shPull a model (example):
ollama pull llama3Start Ollama (usually auto-starts):
ollama serveOllama will be available at:
http://localhost:11434
docker run -d \
--name qdrant \
-p 6333:6333 \
-p 6334:6334 \
qdrant/qdrantdocker run -d \
--name valkey \
-p 6379:6379 \
valkey/valkeyVerify containers:
docker psExpected output (example):
qdrant 0.0.0.0:6333-6334->6333-6334/tcp
valkey 0.0.0.0:6379->6379/tcp- Create an account at https://clerk.com
- Create a new application
- Copy your keys
Create a .env.local file in the project root:
# Clerk
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_xxxxxxxxx
CLERK_SECRET_KEY=sk_test_xxxxxxxxx
# App
NEXT_PUBLIC_APP_URL=http://localhost:3000
# Qdrant
QDRANT_URL=http://localhost:6333
# Valkey
VALKEY_URL=redis://localhost:6379
# Ollama
OLLAMA_BASE_URL=http://localhost:11434
OLLAMA_MODEL=llama3Clone the repository:
git clone https://github.com/tarunkumar-sys/chat_with_pdf.git
cd chat_with_pdfInstall dependencies:
npm installStart the full development environment:
npm run dev:fullThe application will be available at:
http://localhost:3000
Restart them:
docker start qdrant valkeyCheck status:
ollama listRestart:
ollama serveEnsure these ports are free:
3000– App6333– Qdrant6379– Valkey11434– Ollama
MIT License
