blog / offline-ai-chatgpt-college-one-gpu.md
We Built a ChatGPT for an Entire College. It Runs on One GPU, and Nothing Goes to the Cloud.
· 6 min read · Imran Khan

We Built a ChatGPT for an Entire College. It Runs on One GPU, and Nothing Goes to the Cloud.
A few months ago, an engineering college came to us with a request that sounded almost impossible.
"Our students want something like ChatGPT. But we don't want our course material or their chats going to some AI company's servers. And we can't pay a bill that grows with every student."
Honestly, our first reaction was: is that even doable?
Turns out, it is. Today the whole thing (the AI model, the search, the PDF generator, everything) runs on a single workstation sitting on their campus, with one RTX 3090 graphics card. No OpenAI. No API bill. Here's the story of how we built it, including the parts that went wrong.

What it actually does
A student opens the chat for a subject and asks a question. The answer comes from their own professor's notes, slides and question papers, and it tells them exactly where it found it.
Ask it a numerical, and it works through every step with your numbers. Ask it in Hinglish ("aliasing kya hota hai?") and it still gets it. Ask something that isn't in the syllabus, and it doesn't make things up: it searches the web privately and tells you that's where the answer came from.
Professors upload their material once, including scanned pages and circuit diagrams, and can then generate notes, slides and quizzes in a click. When students write long answers, the AI suggests marks, but the professor always has the final say. Heads of department get a dashboard with attendance, results, and even the health of the system itself.
Why we went fully offline
Three reasons kept coming up.
First, privacy. Course material and student conversations are sensitive, and nobody was comfortable sending them abroad.
Second, cost. Cloud AI bills scale with usage. More students, more exams, bigger bill, every single month.
Third, the college already had good hardware. And open models have quietly become very good. A 26-billion-parameter model on one graphics card isn't a compromise anymore; it's a genuinely capable assistant.
What's under the hood
Everything runs in Docker on that one machine:
- Ollama runs the AI models: Gemma 4 (26B) for answering and for reading page images, and a small Qwen 3 (4B) for background work on uploaded files.
- A Python service reads PDFs and slides, pulls out text, tables and diagrams, and runs the maths engine (SymPy).
- ChromaDB holds the searchable index of all the notes, MongoDB holds users, chats and quizzes, and Redis keeps queues and counters in sync.
- Node.js runs the backend as four processes behind nginx, with a React frontend.
- SearXNG gives us private web search.
- A Cloudflare tunnel puts the site online without opening a single port on the campus network.
Lesson 1: When the AI is "wrong", it's usually the search
This surprised us. Most bad answers weren't the model being dumb. They were the model being handed the wrong pages.
So we put most of our effort into retrieval:
- Reading documents like a human would. Timetables and tables get read cell by cell, row by row, instead of being mashed into a wall of text. Scanned pages and diagrams get read by a vision model the moment they're uploaded.
- Being honest about weak matches. Every passage gets scored. Strong match? Answer from the notes. Weak match? Search the web too, and use both.
- Understanding the question first. If a student types "and its formula?", we rewrite it into a full question before searching. Hinglish questions get turned into English search terms, because the notes are in English.
Lesson 2: Never let an AI do your maths
Language models sound very sure of themselves with numbers, even when they're wrong. That's dangerous for engineering students.
So we split the job. The model decides how to solve the problem: which formula, which values. Then a real maths engine does the actual calculation. The student sees every step with their own numbers. Quiz numericals work the same way, and answers are accepted within a small tolerance, just like a good examiner would.
Lesson 3: Test it like an exam
We made a test paper for the AI: 39 real questions with known answers, covering theory, diagrams, numericals, Hinglish and a couple of safety checks. Every time we change anything, the AI sits that exam again before students ever see the change.
First proper run: 37 out of 39. Every numerical correct. And we knew exactly why the other two failed: one list in the notes had been split in half, and a web search engine got tired of our test runs and rate-limited us.
Lesson 4: One GPU means you have to share well
The server was almost never the problem. The graphics card was.
We tested how many answers the GPU should write at once, and three turned out to be the sweet spot. We limited each student to one answer at a time, so one person with five tabs open can't slow down the whole class. PDF requests wait in a queue, and students can see their place in line. If two students ask for the same notes on the same day, the second one gets them instantly.
Right now, a single question gets its first word in about 2.6 seconds and a full answer in about 4.6 seconds. A complete PDF of notes takes 11 to 26 seconds.
Lesson 5: The boring stuff is what makes it real
Our biggest speed win had nothing to do with AI. We had been serving the site in development mode, which meant 250 files and 12 MB just to show the login page. Switching to a proper production build brought that down to 17 requests. With 200 simulated students on the site, pages went from about 4 seconds to 128 milliseconds.
We also learned a few things the hard way:
- We lost the search index once, because one line in our Docker setup pointed to the wrong folder. Every container restart quietly wiped it. Now it lives in proper storage, and there are nightly backups with a tested restore.
- Web search silently returned nothing for a while. The culprit was a home router dropping one kind of DNS lookup. Fun one to debug.
Today the system has a separate copy for experiments so students are never affected, 30-second deployments with automatic rollback, limits on failed logins, and a friendly "we're offline" page if the machine is ever switched off. That last one sounds small, but it's the difference between "the site is broken" and "the site is just resting".
What it costs
One machine the college already owned, electricity, and some maintenance. No per-student fees. No per-token bills. No course material or student chats sent to any AI company.
Who else can use this?
Anyone whose documents can't leave the building: colleges, coaching institutes, hospitals, law firms, CA firms, manufacturers with internal manuals, government offices. If that's you, we'd love to show you a live demo.
Want to build projects like this?
This is the kind of work we do every day: real AI systems for real clients, running on real hardware, with real users who notice when something breaks.
And we teach it.
Our AI Engineering Bootcamp in Indore is for students and developers who want to go beyond tutorials and actually build things like this:
- RAG systems that answer from your own documents, and the evaluation to prove they work
- Running open models locally with Ollama, and making one GPU serve many users
- AI agents and tools, like the maths engine in this project
- Shipping to production: Docker, deployment, monitoring, backups
You won't just watch videos. You'll build working projects you can show in interviews and to clients, and you'll learn from people who build this stuff for a living.
If you want a career in AI engineering, not just a certificate, come build with us.


