Ask PDF is a high-performance, AI-driven backend that allows users to chat with their PDF documents. Using Retrieval-Augmented Generation (RAG), the system extracts text from PDFs, generates semantic embeddings, and provides context-aware answers to user questions using state-of-the-art language models.
- 📂 PDF Processing – Extract text and metadata from PDF files using
pypdf. - 🧠 Semantic Search – Powered by
SentenceTransformers(all-MiniLM-L6-v2) for fast and accurate context retrieval. - ⚡ Lazy Loading – Optimized for cloud deployment (Render / Heroku / Vercel) to reduce cold start time.
- 💬 Contextual AI – Integrated with NVIDIA DeepSeek for high-quality, document-grounded responses.
- 🕒 Chat History – Persistent conversation tracking integrated with Supabase.
- 🛡️ Rate Limiting – Built-in protection using
slowapito ensure API stability.
Frontend https://ask-pdf-gray.vercel.app
- Framework: FastAPI
- Embeddings: Sentence-Transformers (CPU optimized)
- LLM API: NVIDIA Integrated (DeepSeek-v3)
- Database: Supabase (PostgreSQL)
- PDF Engine: PyPDF
- Security: Slowapi (Rate Limiting) & CORS
- Python 3.10 or higher
- A Supabase account (for chat history storage)
- An NVIDIA API key
git clone https://github.com/your-username/Ask_Pdf.git
cd Ask_Pdfpython -m venv venv
# Windows
.\venv\Scripts\activate
# Linux / macOS
source venv/bin/activate
pip install -r requirements.txtCreate a .env file in the root directory:
SUPABASE_URL=your_supabase_url
SUPABASE_KEY=your_supabase_anon_key
NVIDIA_API_KEY=your_nvidia_api_keypython -m uvicorn main:app --reloadThe API will be available at:
http://localhost:8000
API documentation:
http://localhost:8000/docs
- Push your code to a GitHub repository.
- Go to Vercel → Add New → Project.
- Import your repository.
- Set Root Directory to
frontend. - Add Environment Variables:
NEXT_PUBLIC_API_URL=https://your-render-backend-url
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
- Click Deploy.
- Create a Web Service on Render.
- Build Command
pip install -r requirements.txt
- Start Command
uvicorn main:app --host 0.0.0.0 --port $PORT
- Add Environment Variables:
SUPABASE_URL
SUPABASE_KEY
NVIDIA_API_KEY
Distributed under the MIT License.
See LICENSE for more information.
❤️ Made for the AI Community