Deploying DocuGPT (ChatPDF) to the Cloud
Status: Live & Stable Stack: Flask, MongoDB, Pinecone, LangChain, Hugging Face Spaces (Docker)
-
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.
-
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.
-
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.
-
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.
-
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.