This is a submission for the Hacktoberfest Weekend Challenge: Build for a Friend
What I Built
Every semester, my close friend in engineering pulls grueling all-nighters preparing for advanced technical exams. They don't struggle with understanding the core equations; they struggle with the deceptive traps examiners deliberately design into the questions:
- Sneaky boundary conditions (e.g., $N = 0$, null pointers, or unsigned integer underflows).
- Unit mismatches and hidden assumptions buried inside paragraphs of academic prose.
- Time-panic questions designed to bait students into choosing the most obviousβyet totally wrongβdistractor.
When studying at 2:00 AM, my friend's anxiety peaks. Standard chatbots like ChatGPT fail them completely: when asked for help, they immediately dump long walls of text containing the direct final answer. That robs a student of the chance to build problem-solving intuition, and reading dense markdown blocks on a screen only increases their cognitive exhaustion.
I built Gemmate for them.
Gemmate is an empathetic, open-weight AI voice companion designed to turn exam panic into calm mastery. When a student uploads a photo of a tricky exam question or pastes a problem statement, Gemmate never spoils the solution. Instead, it acts like a kind, brilliant senior peer:
- π‘ Core Theory Analysis: Identifies the fundamental underlying principles required to solve the problem.
- π The Trap(s): Explicitly calls out the misleading phrasing, deceptive edge cases, or false assumptions examiners set up to mislead students.
- βοΈ Actionable Attack Plan: Lays out a systematic 3-to-4 step blueprint to solve the problem methodically.
- ποΈ Socratic Voice Hints: Powered by ElevenLabs, Gemmate speaks comforting, bite-sized hints out loudβencouraging the student to take the next step without revealing the formula.
- π Dynamic Practice Variant: Generates a brand-new practice problem testing the exact same concepts and traps with fresh variables so the student can prove they've mastered it.
Demo
- π Live Production Website: https://gemmate.inusha.me
- Deployment Platform: Vercel Serverless Edge Architecture with KaTeX math rendering and ElevenLabs voice streaming.
Key Highlights of the Experience:
- Zero-Spoiler Guarantee: The system prompt strictly prohibits generating direct answers, enforcing deep pedagogical scaffolding.
- Glassmorphic Cyber-Ambient UI: Tailored for late-night study sessions with sleek dark mode, glowing crystal accents, soundwave visualizers, and zero eye strain.
- Full LaTeX Math Support: Complex formulas and matrices render with pixel-perfect KaTeX typography.
- Audio Companion: Real-time ElevenLabs voice playback turns silent stress into a soothing study session.
Code
The complete source code for Gemmate is open-source under the MIT license:
inusha-thathsara
/
Gemmate
Open-source voice study companion for cracking exam traps. Powered by Google Gemma & ElevenLabs. Built for a Friend for DEV Hacktoberfest 2026.
π Gemmate: Open-Source Voice Companion for Cracking Exam Traps
Your open-weight voice study partner for mastering deceptive exam questions.
Built for the DEV Hacktoberfest 2026 Challenge: Build for a Friend
π Live Demo: gemmate.inusha.me β’ π¦ GitHub Repository
π Why Gemmate?
For students preparing for high-stakes technical exams, deceptive questions frequently trigger acute exam anxiety:
- Deceptive edge cases (e.g. assuming worst-case hash collisions are $O(1)$)
- Subtly contradictory boundary constraints and unit tricks
- Overwhelming blocks of text designed to induce time panic
Generic AI tools fail students: pasting a question into standard chatbots dumps walls of final answers, robbing them of the chance to learn how to deconstruct traps. Furthermore, expensive subscription fees and spotty Wi-Fi in underground library basements make cloud-only assistants unreliable.
Gemmate solves this: an empathetic, open-weight AI companion that never reveals direct answers. Instead, it uses Google Gemma to triage the problem into an actionable Attackβ¦
- Repository: https://github.com/inusha-thathsara/Gemmate
- Stack: Next.js 16 (App Router, Turbopack), React 19, TypeScript, Framer Motion, KaTeX, ElevenLabs SDK, Google Generative AI SDK, and local Ollama engine.
How I Built It
Gemmate is designed from the ground up around Google's Open-Weight Gemma models:
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Student: Past Exam Paper / Photo β
βββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Gemmate Frontend (Next.js 16) β
β Client-Side Image Compression & Glassmorphic UI β
βββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β API Route Orchestrator (/api/triage) β
βββββββββββββββ¬ββββββββββββββββββββββββββββ¬βββββββββββββββ
β β
(Offline / Local) (Cloud / Production)
β β
βΌ βΌ
βββββββββββββββββββββββββββββ ββββββββββββββββββββββββββ
β Local Ollama Runtime β β Google Hosted Cloud β
β - Gemma 3 / 4 (1B/31B) β β - Gemma 4 (31B-IT) β
β - Moondream Vision β β - Flash Vision OCR β
βββββββββββββββ¬ββββββββββββββ βββββββββββ¬βββββββββββββββ
β β
βββββββββββββββ¬ββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Structured JSON Extraction: β
β Core Concepts β’ The Trap β’ Attack Plan β
βββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β ElevenLabs Audio Engine (Turbo v2.5) β
β Human-Like Socratic Voice Hints & Audio Streams β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
1. The Open-Weight AI Core (Google Gemma)
-
Local Air-Gapped Mode: Using Ollama, students can run
gemma3:1borgemma4:31b-italongsidemoondreamlocally on consumer laptop GPUs. This enables sub-second responses with zero internet connection. -
Cloud Hosted Mode: On the web deployment, Gemmate leverages Google's hosted Gemma 4 (
gemma-4-31b-it) open-weights to perform deep theoretical deconstructions of complex mathematical and algorithmic proofs. - Structured JSON Schema: Gemma is instructed via strict schema constraints to separate the theory, the deceptive trap, and the attack steps into parseable JSON.
2. High-Performance Vision OCR
Exam questions often exist only on paper past-exam handouts or lecture slides. Gemmate accepts up to 3 photos concurrently, compresses them client-side in HTML5 canvas to prevent payload bloat, and processes them in parallel using high-fidelity vision models to transcribe formulas and diagrams into pristine LaTeX markdown.
3. Voice Intelligence with ElevenLabs
Reading dense screens at 2 AM induces eye fatigue and mental blocks. Gemmate integrates ElevenLabs Turbo v2.5 with in-memory audio caching. Hints and attack plans are converted into comforting, natural speech that sounds like a supportive friend talking you through the problem.
Why Does Open Innovation Matter?
Building with open-source AI and open-weight models wasn't just a technical preferenceβit was the only way this project could truly succeed:
1. 100% Privacy for Sensitive Student Work
University honor codes and exam confidentiality mean students should never paste unpublished past papers, professor problem sets, or graded assignments into closed commercial LLMs that use user queries for proprietary retraining. With open-weight Gemma running locally on a student's machine, their data never leaves their laptop.
2. True Offline Accessibility in Exam Study Basements
University libraries, basement study halls, and dormitories are notorious for dead Wi-Fi zones. Closed API-dependent applications become useless bricks the moment the connection drops. Because Gemma runs natively via Ollama, Gemmate can run completely air-gapped on a plane, on a train, or in an underground library cubicle.
3. Democratizing Education Without Subscription Tollgates
Closed commercial frontier models charge $20/month subscriptions or per-token API fees that student budgets cannot sustain. Open innovation means students everywhere have unlimited access to world-class reasoning without artificial usage caps or surprise credit card bills.
4. Customizability and Fine-Tuning
With open weights, educators and students can fine-tune Gemma specifically on their university's syllabus, curriculum notation, or regional examination styles (e.g., JEE, AP, IB, Cambridge A-Levels)βsomething impossible with closed black-box models.
What My Friend Said When I Handed It Over
"Usually when I get stuck on a past paper, I stare at the question for an hour getting more and more panicked, or I cheat and look up the answer sheet, which makes me feel like an idiot. Gemmate is the first tool that actually pointed out the trick in the question without giving away the answer. Having the voice explain the trap out loud made my chest unfreeze."
Seeing their stress melt away made every line of code worthwhile.
π Community Wisdom
During the design and implementation of Gemmate, insights from the broader developer community on dev.to helped shape our architecture:
- Running Open LLMs Locally with Ollama: Community discussions highlighted the value of quantization and lightweight open models (like Gemma 1B and 4B) for responsive local laptop execution, keeping RAM usage under 4 GB.
- Socratic Pedagogy vs Answer Generators: Educational engineering articles on DEV demonstrated that preventing LLMs from emitting final answers requires rigorous two-stage system prompt constraints with structured JSON schemas.
- Client-Side Image Pre-Processing for Serverless: Patterns for compressing high-resolution phone photos in the browser before dispatching to Next.js API routes prevented 413 payload errors on Vercel's edge network.
Prize Categories
- Overall Winner: Hacktoberfest Weekend Challenge: Build for a Friend
-
Best Use of Gemma: Built around Google's open-weight Gemma models (
gemma-4-31b-it/gemma3:1b) as the core reasoning engine. - Best Use of ElevenLabs: Featuring real-time ElevenLabs Socratic audio generation and empathetic vocal coaching.
π€ Agent Session
This project was built with the help of an AI pair-programming session. Below is the full transcript of how we debugged deployments, fixed the vision pipeline, audited branding, and wrote this very submission β all in one continuous session:
Top comments (0)