Gist: an offline exam-prep partner that mines past papers with Ollama
- Models & engines
- Ollama with gemma2:9b and the lighter gemma2:2b (Llama 3.2 also mentioned) for chat, classification and grading
nomic-embed-text or bge-m3 for embeddings - Key gotcha
- The first prototype sent whole exam papers to the LLM for structured JSON; it was slow on local hardware and hallucinated marks
What they built
Gist is a study partner built for a friend who wasn't willing to upload copyrighted lecture PDFs to someone else's inference endpoint. It runs entirely on the laptop: PDFs are parsed, embedded and searched locally, the LLM runs in Ollama, and the app works with the Wi-Fi switched off. There is no API key in the codebase.
Its core is a past-paper analyser. You drop in three or more years of university exam PDFs and it works out which questions repeat, what each topic is worth in total marks, how often each concept appears across semesters, and how your own quiz results line up against that weighting.
On top of that it offers page-grounded document Q&A with citations, adaptive quizzes, a priority matrix of high-yield weak spots, and timed mock exams in a 'Grill Me' mode. The author reports about 4,700 lines of Python, up from 2,000 when the quiz was the main feature.
Setup
- Ollama with gemma2:9b and the lighter gemma2:2b (Llama 3.2 also mentioned) for chat, classification and grading
- nomic-embed-text or bge-m3 for embeddings
- FastAPI backend with PyMuPDF for PDF ingestion
- ChromaDB for vectors and SQLite (tracker.db) for papers, question bank and attempt history
- React 18 + Vite frontend
How it works
- A deterministic regex pass splits questions on structural boundaries like Q1(a), 2. or (i) and pulls marks written as [10], (5 marks), 15M or 4 + 6 + 2 = 12.
- A keyword ontology maps question vocabulary to canonical syllabus topics (for example bcnf, 3nf and attribute closure all map to Normalization), so small models can't invent topic names.
- Only questions that fall through to the generic bucket go to Ollama, batched at 12 snippets or fewer with num_predict=200; full LLM extraction is kept as a fallback for unstructured scanned layouts.
- Exam importance = marks_pct * (0.6 + 0.4 * frequency_pct / 100), and study priority = exam_importance * ((100 - accuracy) / 100) * 1.5; untested topics are treated as 75% weak.
Results & numbers
- The rules-first parser runs in milliseconds and keeps mark extraction exact, which the whole priority model depends on
- The app works fully offline, so the privacy claim can be checked by confirming nothing leaves localhost
Gotchas
- The first prototype sent whole exam papers to the LLM for structured JSON; it was slow on local hardware and hallucinated marks
- Getting mark parsing wrong skews every downstream percentage, so it has to be deterministic rather than approximate
“There is no API key in the codebase because there is no API involvement.”— Gist author on DEV Community
Do it yourself
- Install Ollama and pull a small chat model (the author uses gemma2:2b and gemma2:9b) plus an embedding model such as nomic-embed-text.
- Extract text from your PDFs locally with PyMuPDF and store chunks with embeddings in ChromaDB.
- Write regex rules for your university's question numbering and mark formats before reaching for the LLM.
- Map keywords to a fixed list of syllabus topics, and send only unmatched questions to the local model in small batches.
- Track quiz accuracy per topic in SQLite and rank topics by marks share, frequency and your weakness.
exam_importance = marks_pct * (0.6 + 0.4 * (frequency_pct / 100))
priority = exam_importance * ((100 - accuracy) / 100) * 1.5Similar setups
A CPU-only PDF question-answering API with Ollama, Qwen2.5 1.5B and ChromaDB
A developer who wanted to keep documents inside the private network built a small RAG app on a PC with no active GPU: PDFs are indexed into ChromaDB and a local FastAPI endpoint answers questions with Qwen2.5 1.5B on Ollama.
A local contract and invoice agent whose citations are checked by code
Gonzalo Blasco built a laptop-only agent that answers questions about contracts and invoices and only accepts a citation if its quote literally appears in the retrieved chunk; Gemma 4 12B got 18 of 18 of his test questions right.
Local AI: a one-click Windows app that picks a model for your PC and sets up Ollama for friends
Tired of setting up local LLMs for friends, a developer built a free MIT-licensed Windows app that detects your GPU and RAM, installs Ollama without admin rights, pulls a fitting model and opens a private chat.
Slothsort: a local Gemma 3 agent that renames and files a messy Downloads folder overnight
Cody Topp built Slothsort, which uses Gemma 3 4B via Ollama plus Tesseract OCR to give every loose file a searchable name and folder, with a plan page before moving anything and a full undo.