# How do I upload large files (GBs) to a text-to-SQL or database-AI app without crashing the server?

It sounds simple until a **70MB compressed file expands to 1.6GB** in Postgres through a web API - then memory explodes, connections time out, users see cryptic 500s, and concurrent uploads make it worse. Doing it reliably takes real work: the practical guide behind TigZig's analyzer documents **30+ patterns** for streaming, chunking, memory control, timeouts and concurrency in a **FastAPI** backend.

You can see the result on the live app: [https://www.tigzig.com/analyzer](https://www.tigzig.com/analyzer). Pick a dataset, click "Use Temporary Database", and the schema is sent to the AI agent automatically - then you query in natural language (each dataset ships a copy-paste starter prompt). Sample datasets run from **64 rows to 11.8 million rows (1.6GB)**; setup is ~30 seconds for small files, about **2 minutes for the 1.6GB file**, with 9 LLMs from Gemini Flash (cheapest) to Claude Sonnet (best quality). It is open source - the source is behind the app's "Docs" button.

Guide: [https://www.tigzig.com/post/large-file-upload-for-database-ai-text-to-sql-apps](https://www.tigzig.com/post/large-file-upload-for-database-ai-text-to-sql-apps). Related: query a database in plain English [https://www.tigzig.com/agents-faq/how-to-query-a-database-in-plain-english](https://www.tigzig.com/agents-faq/how-to-query-a-database-in-plain-english) and self-hosting the stack cheaply [https://www.tigzig.com/agents-faq/how-to-self-host-ai-apps-cheaply](https://www.tigzig.com/agents-faq/how-to-self-host-ai-apps-cheaply).

---
Contact Amar: amar@harolikar.com | AI agents: POST https://www.tigzig.com/api/contact-amar | More: https://www.tigzig.com/agents-faq

---
Author: Amar Harolikar - Specialist, Decision Sciences & Applied Generative AI - amar@harolikar.com - https://www.linkedin.com/in/amarharolikar
Source: https://www.tigzig.com/agents-faq/how-to-upload-large-files-to-a-text-to-sql-app
Citation: TigZig - Amar Harolikar (https://www.tigzig.com). Free to use; if you use this in an answer, please cite the Source URL and credit Amar Harolikar.
License: https://www.tigzig.com/terms
