CHATPDF banner

CHATPDF

1 devlog
4h 8m 50s

DocuGPT is an AI-powered document assistant that lets users have natural conversations with their PDF files. Built with Flask and MongoDB, it uses RAG (Retrieval-Augmented Generation) technology to analyse documents instantly. Users can upload com…

DocuGPT is an AI-powered document assistant that lets users have natural conversations with their PDF files. Built with Flask and MongoDB, it uses RAG (Retrieval-Augmented Generation) technology to analyse documents instantly. Users can upload complex PDFs, such as resumes or legal contracts, and receive accurate, context-aware answers in seconds using the Llama 3 LLM and Pinecone vector database.

Demo Repository

Loading README...

techwizard

Shipped this project!

I built DocuGPT, an AI-powered web app that turns static PDFs into interactive conversations. It uses Flask for the backend, Pinecone for vector storage, and LangChain to orchestrate the AI logic.

The deployment was the biggest learning curve. I initially faced RAM limitations on Render, which taught me how to migrate to Hugging Face Spaces using Docker to access better hardware. I also learned how to configure Gunicorn timeouts to handle large file processing without crashing the server. It’s now live and stable! 🚀

techwizard

Deploying DocuGPT (ChatPDF) to the Cloud

Status: Live & Stable Stack: Flask, MongoDB, Pinecone, LangChain, Hugging Face Spaces (Docker)

  1. Overcoming RAM Limits My first attempt on Render failed instantly. The app crashed with an “Out of Memory” error because my AI library (sentence-transformers) needs ~800MB RAM, but Render’s free tier only provides 512MB.

  2. The Move to Hugging Face I switched to Hugging Face Spaces using the Docker SDK. This was the critical fix—it offers 16GB of RAM for free, allowing the heavy AI models to run smoothly without crashing.

  3. Git & Auth Fixes I hit two walls: a “refusing to merge unrelated histories” error and rejected password authentication. I fixed the merge by forcing it with the –allow-unrelated-histories flag. For auth, I generated a Write-Scope Access Token and injected it directly into the git remote URL to bypass the deprecated password prompt.

  4. Stabilizing the Server The app was crashing during PDF uploads with a [CRITICAL] WORKER TIMEOUT. Gunicorn was killing any process that took longer than 30 seconds. I updated the Docker configuration to allow a 5-minute timeout, ensuring large PDFs process fully.

  5. Final Polish I fixed a login bug caused by iframe cookie blocking by adding a direct access link, and I upgraded the UI with a modern Tailwind gradient design.

Outcome: DocuGPT is now live, stable, and running on a robust 16GB environment.

Attachment
0