This is a submission for the Hacktoberfest Weekend Challenge: Build for a Friend I built StudyBuddy, a local AI study assistant for my younger brother.
During exam preparation, he often has a lot of notes from his online coaching classes. The problem isn't necessarily understanding the material — it's revising all of it when there is limited time before an exam. Going through pages and pages of notes repeatedly can be difficult and time-consuming.
So I built StudyBuddy to turn those notes into short, focused flashcards that he can quickly review. He can upload his study material, generate flashcards locally, review and edit them, and export them to Anki or CSV.
The idea is simple: instead of spending valuable revision time turning notes into questions, StudyBuddy does that repetitive work and lets him focus on actually testing what he remembers.
And because it runs AI locally with Gemma through Ollama, his study material doesn't have to be sent to a third-party AI API.
StudyBuddy runs locally through Streamlit and Ollama. I'll update this post with a short video walkthrough after recording it.
I gave StudyBuddy to my younger brother and had him try it with a General Knowledge PDF from his coaching classes.
He was impressed by how well the app identified the important points from his coaching material that could be useful for exam revision and turned them into focused flashcards. He did mention that flashcard generation takes some time, especially for larger PDFs, which can be frustrating.
Overall, he liked the result and wants to use it with more of his study material.
The app is written in Python with Streamlit. For PDFs, pypdf extracts text page by page, while pasted notes follow the same processing path. The chunker groups the material into roughly 1,500-character chunks and filters out short or low-quality chunks before sending them for generation.
The generator uses Ollama's chat API in JSON mode, with Gemma 2 2B (gemma2:2b) running locally. The model is configurable through OLLAMA_MODEL, so the application isn't tightly coupled to a single model.
After each response, the app parses the generated JSON, accepts several common response formats, validates that each card contains a usable question and answer, and removes duplicate questions. If a sufficiently long chunk produces fewer than two valid cards, the app can split the chunk at a sentence boundary and retry.
The overall pipeline is:
PDF / notes → text extraction → chunking → Gemma 2 2B via Ollama → JSON validation → deduplication → review/edit → Anki or CSV export
The Study tab shows one card at a time, lets you reveal the answer, and lets you mark cards as known or needing practice. It is a simple review mode, not a spaced-repetition scheduler; Anki handles scheduling after import.
For this project, **local inference** is useful because study materials can include paid course content or private notes. With Ollama running on the same machine, the PDF, extracted text, and generated flashcards don't need to be uploaded to a third-party AI API. Once the model is downloaded, StudyBuddy can also work **without an internet connection**.
Using an **open-weight model** also means there is no inference API key or per-request cost. The user provides the hardware needed to run the model, while having control over which Ollama-compatible model they want to use. The model is configurable rather than being locked to a proprietary hosted AI service.
For my brother's use case, this was important because I wanted to build a tool that could work directly with his study material **without making a cloud AI service a required part of the workflow.**
Best Use of Gemma — StudyBuddy uses Google's Gemma 2 2B (gemma2:2b) as its core AI model, running locally through Ollama. Gemma transforms study material into structured question-and-answer flashcards, which are then validated, deduplicated, reviewed, and exported for studying.
Using Gemma locally is also central to the project's goal: helping my brother turn his private study material into useful revision cards without requiring a cloud AI API.