DEV Community

Cover image for Gemmate: The Open-Weight Voice Study Companion That Unmasks Exam Traps
Malawige Inusha Thathsara Gunasekara
Malawige Inusha Thathsara Gunasekara

Posted on AI-assisted

Gemmate: The Open-Weight Voice Study Companion That Unmasks Exam Traps

Hacktoberfest Weekend Challenge: Build for a Friend Submission 🀝

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:

  1. πŸ’‘ Core Theory Analysis: Identifies the fundamental underlying principles required to solve the problem.
  2. πŸ’€ The Trap(s): Explicitly calls out the misleading phrasing, deceptive edge cases, or false assumptions examiners set up to mislead students.
  3. βš”οΈ Actionable Attack Plan: Lays out a systematic 3-to-4 step blueprint to solve the problem methodically.
  4. πŸŽ™οΈ 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.
  5. πŸ“ 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:

GitHub logo 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

Gemmate Logo

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…


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   β”‚
 β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
Enter fullscreen mode Exit fullscreen mode

1. The Open-Weight AI Core (Google Gemma)

  • Local Air-Gapped Mode: Using Ollama, students can run gemma3:1b or gemma4:31b-it alongside moondream locally 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:

Building Gemmate: An Open-Weight AI Study Companion for Hacktoberfest
You

I deployed the app on https://gemmate.vercel.app but it shows these errors.

Agent

Investigating the Vercel deployment errors β€” the main issues are: 1) Next.js Image component can't optimize external brand icons in serverless, 2) Groq Vision API is decommissioned, and 3) Gemini API key validation errors.

You

So you changed the model for Gemma, Gemini, right? The challenge is that we have to use Gemma β€” if we deploy the project on Gemini, that would not be suitable for the challenge, right?

Agent

Gemma and Gemini are different things. Gemma is Google's open-weight model family (like gemma-4-31b-it) β€” perfect for the challenge. Gemini is the proprietary closed model. Our architecture uses Google AI Studio to HOST the Gemma open-weight models in the cloud, which is fully compliant with the 'Best Use of Gemma' prize category. The core reasoning runs on open-weights; the API is just the delivery mechanism.

You

There are still Bora mentions in the GitHub repo description. Remove every mention related to Bora.

Agent

Running a full audit for 'Bora' across the entire codebase, README, submission, and package.json.

You

Why is it failing to read the given images?

Agent

Root cause: Groq's llama-3.2-11b-vision-preview is officially decommissioned and returning 404s. The fix is to switch vision OCR entirely to Google AI Studio's Gemini Flash vision models, which support multimodal image input and handle LaTeX/formula-heavy exam paper transcription far better. Also parallelized the image processing with Promise.all() to handle up to 3 concurrent exam photos.

You

App is deployed on https://gemmate.inusha.me β€” complete the devsubmission.md file.

Agent

Drafting the full DEV Hacktoberfest Weekend Challenge submission. The article covers: the real friend story (engineering exam panic), the Zero-Spoiler design philosophy, the full open-weight Gemma architecture (Ollama local + Google AI Studio cloud), the ElevenLabs voice integration, and the open innovation rationale (privacy, offline access, democratized education).

You

can we embed using devrelay?

Agent

Yes! Reading the devrelay-sessions SKILL.md β€” we can use submit_agent_session to save this session transcript to DEV, then embed it in the submission article using the Liquid tag. Submitting now with curated highlights of our build session.

You

option 2 β€” register the DevRelay MCP server in Antigravity

Agent

Running the DevRelay Windows installer, downloading dev_mlh_mcp_server.exe v0.1.17, and writing the devrelay-gateway entry into ~/.gemini/config/mcp_config.json so all future Antigravity sessions have direct access to DevRelay MCP tools.

Top comments (0)