<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Nirav Neve</title>
    <description>The latest articles on DEV Community by Nirav Neve (@notnirav).</description>
    <link>https://dev.to/notnirav</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4156520%2F2e88810a-3884-4be2-8573-cc11339db518.jpg</url>
      <title>DEV Community: Nirav Neve</title>
      <link>https://dev.to/notnirav</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/notnirav"/>
    <language>en</language>
    <item>
      <title>I built an outdoor game that uses AI to get you off your phone</title>
      <dc:creator>Nirav Neve</dc:creator>
      <pubDate>Sun, 11 Oct 2026 18:33:56 +0000</pubDate>
      <link>https://dev.to/notnirav/i-built-an-outdoor-game-that-uses-ai-to-get-you-off-your-phone-35kk</link>
      <guid>https://dev.to/notnirav/i-built-an-outdoor-game-that-uses-ai-to-get-you-off-your-phone-35kk</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/hacktoberfest-week1-2026-10-05"&gt;Hacktoberfest Open-Source AI Challenge Week 1: Touch Grass&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;What if an app's most important feature was knowing when to get out of your way?&lt;/p&gt;

&lt;p&gt;Most apps compete for your attention. They want you to open them more often, spend more time inside them, and come back tomorrow.&lt;/p&gt;

&lt;p&gt;For this challenge, I wanted to build something with the opposite goal.&lt;/p&gt;

&lt;p&gt;I built &lt;strong&gt;GrassQuest&lt;/strong&gt;, an outdoor exploration game that uses AI to turn your actual surroundings into quests, then rewards you for putting your phone away and exploring the real world.&lt;/p&gt;

&lt;p&gt;The interesting part isn't just that it encourages people to go outside. It's how it decides &lt;em&gt;what to do outside, how difficult that activity should be, and how to verify what you discovered without uploading your photographs to a cloud server.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;GrassQuest is a location-aware outdoor quest game built around one simple loop: choose a quest, leave your screen behind, explore, and return with proof of your adventure.&lt;/p&gt;

&lt;p&gt;Here's how it works.&lt;/p&gt;

&lt;h3&gt;
  
  
  Your surroundings determine your quests
&lt;/h3&gt;

&lt;p&gt;GrassQuest checks local weather, sunrise and sunset times, and nearby outdoor features using Open-Meteo and OpenStreetMap data.&lt;/p&gt;

&lt;p&gt;It uses this context to filter its quest library. A quest that requires a pond should only appear when a suitable water feature exists nearby. A sunset quest makes more sense around golden hour. When severe weather makes outdoor activities unsuitable, the game can offer gentler alternatives and protect your streak.&lt;/p&gt;

&lt;p&gt;The application has 248 hand-written quest templates, expanded into 1,324 concrete variations. The aim is to make exploration feel relevant to your surroundings rather than repeatedly presenting the same generic checklist.&lt;/p&gt;

&lt;h3&gt;
  
  
  TabPFN decides how challenging your next adventure should be
&lt;/h3&gt;

&lt;p&gt;Instead of showing three random quests, GrassQuest uses TabPFN to estimate completion probability and walking duration.&lt;/p&gt;

&lt;p&gt;It presents three choices:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Easy Win:&lt;/strong&gt; The quest with the highest predicted chance of completion.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sweet Spot:&lt;/strong&gt; The quest closest to a 65% predicted completion probability.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stretch:&lt;/strong&gt; A more challenging quest that meets a minimum predicted probability threshold.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These predictions use structured information such as weather, time of day, quest effort, distance to nearby features, and available player history. The choices are selected from different categories.&lt;/p&gt;

&lt;p&gt;The probabilities are estimates, not guarantees. When player history is limited, the system can fall back to a heuristic rather than pretending to know more than it does.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Ranger sends you on your way
&lt;/h3&gt;

&lt;p&gt;After accepting a quest, you receive an audio briefing from The Ranger, GrassQuest's narrator.&lt;/p&gt;

&lt;p&gt;ElevenLabs generates the voice lines, which cover different weather conditions, times of day, and quest outcomes. I pre-generated 16 audio clips instead of repeatedly generating identical lines during gameplay.&lt;/p&gt;

&lt;p&gt;Once the briefing is over, the expedition timer and compass bearing help you get moving.&lt;/p&gt;

&lt;p&gt;Then you put your phone in your pocket.&lt;/p&gt;

&lt;h3&gt;
  
  
  Gemma verifies your adventure locally
&lt;/h3&gt;

&lt;p&gt;When you return, you submit a photograph as proof of your quest.&lt;/p&gt;

&lt;p&gt;GrassQuest uses Gemma 4 Vision through Ollama to evaluate the photograph on your own computer. It can return a successful verdict, a close attempt that earns partial rewards, or an unsuccessful attempt with feedback. It can also identify plants, trees, birds, insects, animals, fungi, and interesting sky features for your Field Guide.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The photograph never needs to leave your computer.&lt;/strong&gt; The image is processed locally, and GrassQuest's backend receives the resulting verdict data rather than the original photograph.&lt;/p&gt;

&lt;p&gt;This does require a compatible local Ollama and Gemma setup, but it gives the player control over where their images are processed.&lt;/p&gt;

&lt;h3&gt;
  
  
  There is a reason to come back tomorrow
&lt;/h3&gt;

&lt;p&gt;Completed quests earn XP and Seeds. XP advances your level, while Seeds can be spent on Basecamp upgrades and streak freezes.&lt;/p&gt;

&lt;p&gt;Your Basecamp evolves as you progress, and the Field Guide becomes a collection of things you've discovered outdoors. Badges and leaderboards add milestones and friendly competition.&lt;/p&gt;

&lt;p&gt;The point isn't to create another digital chore. It's to give people a reason to keep exploring.&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Live application:&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;&lt;a href="https://grass-quest-woad.vercel.app" rel="noopener noreferrer"&gt;https://grass-quest-woad.vercel.app&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Live demo video:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/fLNgqr29MZE" width="710" height="399"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Some Images&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fn9ea7ybg01jvp0fruv61.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fn9ea7ybg01jvp0fruv61.png" alt="Landing Page" width="800" height="510"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqstw4k3sb0ppckpbyzus.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqstw4k3sb0ppckpbyzus.png" alt="Todays Quest" width="800" height="510"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fs580tbdp31pycw6xpfej.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fs580tbdp31pycw6xpfej.png" alt="BaseCamp - Start" width="800" height="510"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The deployed frontend is the entry point to GrassQuest. Local vision judging requires Ollama and a compatible Gemma model on the player's computer.&lt;/p&gt;

&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;GitHub repository:&lt;/strong&gt; &lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/NotNirav" rel="noopener noreferrer"&gt;
        NotNirav
      &lt;/a&gt; / &lt;a href="https://github.com/NotNirav/GrassQuest" rel="noopener noreferrer"&gt;
        GrassQuest
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;🌿 GrassQuest&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;Tiny real-world quests that get you off the screen. Get a quest, go outside, come back with a photo, and &lt;strong&gt;Gemma, an open-weight model running on your own computer through Ollama&lt;/strong&gt;, judges whether you did it. Your photo never leaves your machine.&lt;/p&gt;
&lt;p&gt;Built for the DEV &lt;strong&gt;Hacktoberfest Open-Source AI Challenge, Week 1: "Touch Grass"&lt;/strong&gt; (Oct 2026).&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;How it works&lt;/h2&gt;
&lt;/div&gt;
&lt;div class="snippet-clipboard-content notranslate position-relative overflow-auto"&gt;
&lt;pre class="notranslate"&gt;&lt;code&gt; Browser (React)                                   Your computer
 ┌───────────────────────────────┐   photo +      ┌──────────────────────────┐
 │ quest card · "go outside"     │ ── prompt ───▶ │ Ollama · Gemma 4 (vision)│
 │ proof upload · verdict · XP   │ ◀── verdict ── │  judge + narrator lines  │
 └──────────────┬────────────────┘   (JSON)       └──────────────────────────┘
                │ verdict only (no photo)
                ▼
 ┌───────────────────────────────┐        ┌──────────────────────────────────┐
 │ FastAPI on Render             │ ─────▶ │ MongoDB Atlas                    │
 │  quest picker + dedupe        │        │ users · attempts · quests        │
 │  TabPFN: P(you finish quest)  │        │ + bge-m3 embeddings (Vector      │
 │&lt;/code&gt;&lt;/pre&gt;…&lt;/div&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/NotNirav/GrassQuest" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;The repository contains the frontend, FastAPI backend, quest library, model integrations, game mechanics, and setup instructions.&lt;/p&gt;

&lt;p&gt;The main technologies are React, Vite, Python, FastAPI, MapLibre GL, MongoDB Atlas, TabPFN, Gemma 4 through Ollama, and ElevenLabs.&lt;/p&gt;

&lt;h2&gt;
  
  
  How I Built It
&lt;/h2&gt;

&lt;p&gt;I started with a smaller MVP containing 41 hand-written quests and basic XP mechanics. But the first version had a problem: the individual integrations existed without forming a convincing gameplay experience.&lt;/p&gt;

&lt;p&gt;The quests didn't adequately account for the player's surroundings. XP didn't lead to much. TabPFN barely influenced the player's choices, and Gemma only returned basic pass-or-fail results.&lt;/p&gt;

&lt;p&gt;I decided to rebuild the experience around a more coherent idea: &lt;strong&gt;the environment should determine what's possible, AI should help choose what's achievable, and local vision should help verify what happened.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Environmental context and quest selection
&lt;/h3&gt;

&lt;p&gt;The FastAPI backend aggregates weather and nearby-place data from Open-Meteo and OpenStreetMap Overpass. It filters quests according to environmental requirements, weather, time of day, and distance.&lt;/p&gt;

&lt;p&gt;I also had to deal with Overpass timeouts. I split large queries into smaller groups, added caching, and introduced background cache warming to make the context engine more resilient.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. TabPFN-powered recommendations
&lt;/h3&gt;

&lt;p&gt;TabPFN's classifier estimates the probability of completing a quest, while a regressor estimates its duration.&lt;/p&gt;

&lt;p&gt;The backend evaluates eligible candidates and uses those predictions to produce the Easy Win, Sweet Spot, and Stretch choices. I added request limits, caching, and a heuristic fallback to avoid making the entire game dependent on model availability.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Local Gemma inference
&lt;/h3&gt;

&lt;p&gt;My first attempt was to run the vision model directly in the browser using WebGPU and Transformers.js. Downloading a multi-gigabyte model into mobile browser tabs proved too brittle across devices.&lt;/p&gt;

&lt;p&gt;I pivoted to Ollama on the player's computer.&lt;/p&gt;

&lt;p&gt;The browser sends the resized photograph directly to the local Ollama service. Gemma returns structured JSON containing the verdict, confidence, feedback, and identification information. The backend receives the verdict data needed for game progression, not the photograph itself.&lt;/p&gt;

&lt;p&gt;This added a setup requirement, but it established a much clearer privacy boundary.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. MongoDB Atlas and semantic quest deduplication
&lt;/h3&gt;

&lt;p&gt;MongoDB Atlas stores player data, quest attempts, progression, and the expanded quest library.&lt;/p&gt;

&lt;p&gt;I also integrated Atlas Vector Search using 1,024-dimensional embeddings generated locally with &lt;code&gt;bge-m3&lt;/code&gt; through Ollama. The system compares new candidates against recent attempts and filters semantically similar quests, reducing repetitive recommendations.&lt;/p&gt;

&lt;p&gt;This makes the quest library more than a collection of randomly shuffled tasks.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. ElevenLabs and the audio-first experience
&lt;/h3&gt;

&lt;p&gt;I used ElevenLabs Flash v2.5 to generate The Ranger's voice lines. Rather than spending API credits on repeated narration, I pre-rendered 16 situational clips and stored them as static audio assets.&lt;/p&gt;

&lt;p&gt;The result is an audio layer that responds to the expedition's context without requiring a fresh voice-generation request for every interaction.&lt;/p&gt;

&lt;h3&gt;
  
  
  6. The game and its visual identity
&lt;/h3&gt;

&lt;p&gt;The frontend uses React and Vite, with MapLibre GL for maps and a custom CSS design inspired by outdoor field guides and topographic maps.&lt;/p&gt;

&lt;p&gt;I built the Basecamp as an evolving SVG scene, with upgrades that reflect player progression and a visual environment that changes according to the local solar phase.&lt;/p&gt;

&lt;p&gt;The backend handles the game economy, XP, Seeds, streaks, streak freezes, badges, and leaderboard data.&lt;/p&gt;

&lt;p&gt;The overall architecture combines local AI inference with a hosted application backend. This means the public application is accessible through a browser, while the vision model remains on the player's computer.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Does Open Innovation Matter?
&lt;/h2&gt;

&lt;p&gt;The most important reason is privacy.&lt;/p&gt;

&lt;p&gt;An outdoor photograph can reveal far more than the object a player is trying to identify. Sending every image to a remote AI service would introduce a data transfer that isn't necessary for the core experience.&lt;/p&gt;

&lt;p&gt;Running Gemma locally lets GrassQuest evaluate photographs without requiring them to be uploaded to a cloud vision API. The player retains control of the original image, while the backend receives only the structured result needed to award rewards.&lt;/p&gt;

&lt;p&gt;Open-weight models also give developers more control over their AI architecture. I could choose where inference happens, integrate the model into my own workflow, and design the application around a local privacy boundary rather than depending entirely on a hosted inference endpoint.&lt;/p&gt;

&lt;p&gt;TabPFN demonstrates another kind of flexibility: structured predictions can directly influence product decisions rather than existing as a disconnected AI feature.&lt;/p&gt;

&lt;p&gt;MongoDB Atlas provides persistence and semantic search, while ElevenLabs supplies the narration that makes the expedition experience more engaging. These are different technologies with different roles; I haven't tried to make every component solve the same problem.&lt;/p&gt;

&lt;p&gt;GrassQuest does still rely on hosted services for parts of its architecture, and local Gemma inference requires compatible hardware and setup. Open innovation doesn't eliminate every trade-off.&lt;/p&gt;

&lt;p&gt;What it makes possible is a design in which the most sensitive part of the experience — evaluating a personal photograph — can happen on the user's own machine.&lt;/p&gt;

&lt;p&gt;For a project about spending less time on screens, that distinction matters.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;I don't want AI to become another reason to stare at a screen. I want it to help people notice what's beyond it.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Prize Categories
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Best Use of Gemma
&lt;/h3&gt;

&lt;p&gt;Gemma 4 Vision runs locally through Ollama to evaluate outdoor quest photographs, return structured verdicts, and identify natural discoveries for the Field Guide. Its local execution also enables the application's photograph-privacy boundary.&lt;/p&gt;

&lt;h3&gt;
  
  
  Best Use of TabPFN
&lt;/h3&gt;

&lt;p&gt;TabPFN predicts quest completion probability and estimated duration. These predictions directly influence the three quest choices, making the model part of the core gameplay rather than a cosmetic integration.&lt;/p&gt;

&lt;h3&gt;
  
  
  Best Use of MongoDB Atlas
&lt;/h3&gt;

&lt;p&gt;MongoDB Atlas stores the quest library, player data, attempts, and progression. Atlas Vector Search also helps filter semantically repetitive quests using locally generated &lt;code&gt;bge-m3&lt;/code&gt; embeddings.&lt;/p&gt;

&lt;h3&gt;
  
  
  Best Use of ElevenLabs
&lt;/h3&gt;

&lt;p&gt;ElevenLabs Flash v2.5 generates The Ranger's narration, including context-specific departure briefings and reactions to quest outcomes. Pre-generated audio clips make these interactions available without repeatedly generating the same voice lines at runtime.&lt;/p&gt;




&lt;p&gt;Built Solo&lt;/p&gt;

&lt;p&gt;Built for the Hacktoberfest Open-Source AI Challenge, Week 1: Touch Grass.&lt;/p&gt;

&lt;p&gt;If you try GrassQuest, I'd love to hear what quest it gives you and what you discover along the way.&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>hf26challenge</category>
      <category>gemma</category>
      <category>mongodb</category>
    </item>
    <item>
      <title>My mom spends hours every week making test papers. I built her a generator that runs offline on Gemma 4</title>
      <dc:creator>Nirav Neve</dc:creator>
      <pubDate>Sun, 04 Oct 2026 16:27:09 +0000</pubDate>
      <link>https://dev.to/notnirav/my-mom-spends-hours-every-week-making-test-papers-i-built-her-a-generator-that-runs-offline-on-5de2</link>
      <guid>https://dev.to/notnirav/my-mom-spends-hours-every-week-making-test-papers-i-built-her-a-generator-that-runs-offline-on-5de2</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/hacktoberfest-weekend-2026-10-01"&gt;Hacktoberfest Weekend Challenge: Build for a Friend&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;My mom is my first friend. She is also a Class 8 maths teacher, and for as long as I can remember, test week at our house has looked the same.&lt;/p&gt;

&lt;p&gt;The dining table disappears under the NCERT textbook, a stack of old question papers, a folder of worksheets and one notebook with a pencil tucked in it. She picks a question from one source, changes the numbers so the class can't copy last year's answers, works it out, writes the answer key, and moves on to the next one. A 40-mark paper is an evening. If she spots one bad question at the end, the whole thing gets retyped.&lt;/p&gt;

&lt;p&gt;When I asked how I could help, her answer was simple: "I don't need new questions from the internet. I need questions from my books, in my style, and the answers have to be right."&lt;/p&gt;

&lt;p&gt;So I built her a test paper generator that runs on her laptop.&lt;/p&gt;

&lt;p&gt;She fills in a short form: total marks, how many MCQs, short answers, case studies and so on, the chapters, and a line like "more word problems, keep numbers simple". She presses one button. About twenty minutes later she has two Word files: the question paper and a separate answer key with a step-by-step marking scheme.&lt;/p&gt;

&lt;p&gt;What it does for her:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Writes new questions&lt;/strong&gt; from her own material. It reads her textbook chapters, 9 past papers and 15 worksheets, then writes fresh questions in the same style. Different numbers, new contexts, same chapter.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Checks every numeric answer key&lt;/strong&gt; with code before it reaches her. If a key doesn't match the working, the question is rewritten.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Balances difficulty.&lt;/strong&gt; By default a paper is 20% easy, 60% medium and 20% hard, the split most school papers follow, and she can change it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Lets her replace one question&lt;/strong&gt; without touching the rest. "Too hard", "too easy", "out of syllabus", or a note of her own, and only that question is rewritten.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hands her real Word files&lt;/strong&gt;, with proper fractions, powers and roots as Word equations, ready for her school's header.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Never loses work.&lt;/strong&gt; The paper is saved after every question, so closing the laptop halfway through costs nothing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Runs offline.&lt;/strong&gt; Her books and her school's papers never leave the laptop.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Test week: before and after
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Before (by hand)&lt;/th&gt;
&lt;th&gt;After (the generator)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Making a 40-mark paper&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;An evening at the dining table&lt;/td&gt;
&lt;td&gt;~35–40 min of laptop time, a few minutes of hers&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Finding questions&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Flipping through the textbook, old papers and worksheets&lt;/td&gt;
&lt;td&gt;Searches all 13 chapters and 681 of her questions automatically&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Fresh questions&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Changing numbers one by one&lt;/td&gt;
&lt;td&gt;New numbers and contexts, with a check that nothing is copied&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Answer key&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Solved and written by hand&lt;/td&gt;
&lt;td&gt;Written with every step, and checked by code&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Difficulty balance&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;By feel&lt;/td&gt;
&lt;td&gt;20% easy / 60% medium / 20% hard by default&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;One bad question&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Retype the paper&lt;/td&gt;
&lt;td&gt;Press &lt;strong&gt;Replace&lt;/strong&gt;, about 1.5 minutes, nothing else moves&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Formatting&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Typing fractions and powers into Word&lt;/td&gt;
&lt;td&gt;Word files with real equations, ready for the school header&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;If she stops halfway&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Start again from her notes&lt;/td&gt;
&lt;td&gt;Saved after every question, press &lt;strong&gt;Resume&lt;/strong&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Cost and privacy&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;Free, offline, her books never leave the laptop&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/PVjbxCvTPt4" width="710" height="399"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Describe the paper, press Generate.&lt;/strong&gt; The summary turns green when the rows add up to the total marks.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fq0e49rr2s6ejatgbtoz8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fq0e49rr2s6ejatgbtoz8.png" alt="New paper form with live marks summary" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Review it, download it, or replace a single question.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fq333o1rx9d2sxp3flmeu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fq333o1rx9d2sxp3flmeu.png" alt="Finished paper with the Replace panel open" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What lands in Word.&lt;/strong&gt; The question paper first, then the answer key with every step. No LaTeX symbols, no cleanup.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fb63v05caymg38q9tl22x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fb63v05caymg38q9tl22x.png" alt="Generated question paper in Word" width="800" height="784"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fbuqnsfxicm8qma72lfgf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fbuqnsfxicm8qma72lfgf.png" alt="Answer key with step-by-step working" width="800" height="732"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here's one question from a generated 20-mark paper, exactly as it came out:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Q12.&lt;/strong&gt; A shopkeeper purchased a refrigerator for ₹ 8,000 and a washing machine for ₹ 12,000. He sold the refrigerator at a profit of 10% and the washing machine at a loss of 5%. Find the overall profit or loss percent on the entire transaction. &lt;strong&gt;[3]&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key:&lt;/strong&gt; SP = 8,800 + 11,400 = ₹ 20,200, CP = ₹ 20,000, profit ₹ 200, so &lt;strong&gt;1% profit&lt;/strong&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That paper had 13 questions, and all 13 answer keys were confirmed by the code checker on the first try.&lt;/p&gt;
&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/NotNirav" rel="noopener noreferrer"&gt;
        NotNirav
      &lt;/a&gt; / &lt;a href="https://github.com/NotNirav/Paper-Generation-system" rel="noopener noreferrer"&gt;
        Paper-Generation-system
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Offline Test Paper Generator (Class 8 Maths)&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;A local tool for a Class 8 (CBSE) maths teacher. Describe a paper ("6 MCQs of 1 mark, 3 short answers of 2 marks
chapters 7 to 10, more word problems") and get back a &lt;strong&gt;Word question paper and a separate answer key with marking
schemes&lt;/strong&gt;. Questions are new, written from the teacher's own textbooks, worksheets and past papers (RAG), and every
numeric answer key is &lt;strong&gt;checked by code&lt;/strong&gt;. One bad question can be replaced without touching the rest.&lt;/p&gt;
&lt;p&gt;Everything runs on the laptop: a local open-weight model (Gemma 4 12B through Ollama). No internet, no hosting.&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Quick start (teacher)&lt;/h2&gt;
&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;Make sure &lt;strong&gt;Ollama&lt;/strong&gt; is installed (the page starts it if needed).&lt;/li&gt;
&lt;li&gt;Double-click &lt;strong&gt;&lt;code&gt;start.bat&lt;/code&gt;&lt;/strong&gt;. A browser page opens.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;New paper&lt;/strong&gt;: title, total marks, question rows (type, count, marks each), chapters, optional instructions and
difficulty split (default 20% easy / 60%…&lt;/li&gt;
&lt;/ol&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/NotNirav/Paper-Generation-system" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;Double-click start.bat, and the page opens in the browser. When she closes the tab, the app shuts itself down.&lt;/p&gt;

&lt;h2&gt;
  
  
  How I Built It
&lt;/h2&gt;

&lt;p&gt;The whole thing runs on a normal laptop: 16 GB RAM and an NVIDIA card with 6 GB of VRAM. The heart of it is Gemma 4 12B running locally through Ollama. What surprised me most is that one open model did three very different jobs.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjzes59x68gtkrst20nfd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjzes59x68gtkrst20nfd.png" alt="How Gemma 4 reads, sorts and writes questions" width="800" height="469"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Job 1: Gemma read her books&lt;/strong&gt;&lt;br&gt;
The textbooks are PDFs full of fractions and exponents. Plain text extraction turns ³⁄₂ into a "3" and a "2" on separate lines, and that would have poisoned everything downstream.&lt;/p&gt;

&lt;p&gt;So every page with maths on it is rendered to an image and handed to Gemma 4's vision side, which writes it back as clean Markdown with LaTeX. It read tables, it read a line graph correctly (all four values, both axes), and it kept every fraction in one piece. A small checker compares the digits Gemma wrote against the raw PDF text and re-reads any page that doesn't match.&lt;/p&gt;

&lt;p&gt;37 files went through, all on the laptop, in one overnight run. Nothing was uploaded anywhere.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Job 2: Gemma sorted the questions&lt;/strong&gt;&lt;br&gt;
Past papers don't say which chapter a question belongs to, and the generator needs that to find good examples. Gemma tagged 460 questions with a chapter, using structured output limited to the 13 chapter numbers. Not one of those calls returned broken JSON.&lt;/p&gt;

&lt;p&gt;Later I went through all 681 questions by hand and tagged each one with its chapter, a Bloom level and a difficulty. On chapters, I agreed with Gemma 94% of the time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Job 3: Gemma writes the questions&lt;/strong&gt;&lt;br&gt;
For each question slot, the app pulls a couple of textbook passages for that chapter and three real questions from her papers with the same marks, type and difficulty. Gemma sees them as style references and writes one new question.&lt;/p&gt;

&lt;p&gt;A few things made Gemma really shine here:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A JSON schema per question type. An MCQ must return four options and a correct letter. An assertion-reason question returns the two statements and three true/false flags, and the code builds the standard four options from them.&lt;/li&gt;
&lt;li&gt;A scratchpad field. The schema starts with a working field that students never see. Giving Gemma room to solve the problem first made the final answers noticeably cleaner.&lt;/li&gt;
&lt;li&gt;Thinking off, 16K context. Fast enough to write a question in about 90 seconds at roughly 10 tokens per second, on a 6 GB card.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Code checks the answers, not the model&lt;/strong&gt;&lt;br&gt;
A wrong answer key is the one mistake a teacher can't afford. So Gemma also returns the calculation behind its answer, in a form a computer can run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"compute"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"((8000*1.1) + (12000*0.95)) - (8000 + 12000)"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"claimed"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"200"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The app evaluates that with sympy, checks it matches the claim, and checks the claimed value is really the final answer in the key, or really the correct MCQ option. If anything disagrees, the question is rewritten. If it still can't be confirmed, it stays in the paper with a "check" badge so she knows exactly where to look.&lt;/p&gt;

&lt;p&gt;The same idea runs through the Word export. After every file is written, a checker reads it back and makes sure no LaTeX symbol slipped into the text and no number went missing on the way into Word.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Replace one question&lt;/strong&gt;&lt;br&gt;
Each question has a Replace button. Her reason ("too hard", "out of syllabus", or anything she types) goes into the prompt together with the question she rejected, the difficulty moves a step if she asked for easier or harder, and every check runs again. The other questions don't move. Every replacement is also saved to a feedback log, which is a lovely little dataset if I ever fine-tune Gemma on her taste.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The stack, all open&lt;/strong&gt;&lt;br&gt;
Gemma 4 12B and bge-m3 through Ollama, ChromaDB for search, sympy for the answer checks, pandoc for Word equations, and Streamlit for the page.&lt;/p&gt;
&lt;h2&gt;
  
  
  Why Does Open Innovation Matter?
&lt;/h2&gt;

&lt;p&gt;For this project, open wasn't a nice-to-have. It was the only way it could exist.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Her material stays hers. Textbooks and school question papers aren't mine to upload to someone else's server. With Gemma running locally, nothing leaves the laptop.&lt;/li&gt;
&lt;li&gt;It works with no internet. Test week doesn't wait for the Wi-Fi.&lt;/li&gt;
&lt;li&gt;It costs nothing per paper. No subscription, no API bill, no limit on how many times she presses Replace.&lt;/li&gt;
&lt;li&gt;I could shape the model's output exactly. Per-type JSON schemas, a hidden scratchpad, my own retry rules. Every model call goes through one small file, so swapping or upgrading the model is a one-line change.&lt;/li&gt;
&lt;li&gt;It's gentle on resources. It runs on a laptop she already owns, with no data-center round trip for every question. Replace rewrites one question instead of a whole paper. And because answer keys are checked before anything is printed, she isn't printing draft after draft to catch mistakes.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Prize Categories
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Best Use of Gemma.&lt;/strong&gt; &lt;br&gt;
Gemma 4 12B is the core of the project, and it does three separate jobs, all running locally on a 6 GB laptop GPU:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Reading: Gemma 4's vision turned every textbook, worksheet and past-paper page into clean Markdown and LaTeX.&lt;/li&gt;
&lt;li&gt;Sorting: it tagged 460 questions by chapter with structured output.&lt;/li&gt;
&lt;li&gt;Writing: it writes every question, answer and marking scheme.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I went in expecting to stitch together three different models. Gemma did all three, offline, with structured output I could rely on.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;To the Gemma team at Google&lt;/strong&gt; &lt;br&gt;
Thank you for putting a model this capable into a size that fits on a teacher's laptop. It turned "maybe one day" into a weekend project I could hand to my mom.&lt;/p&gt;

&lt;p&gt;This week it is going to be me and my mom enjoying tea while the test paper generator does all the hard work 😉&lt;/p&gt;
&lt;h2&gt;
  
  
  Voice Note From my Mom
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"It generated a test paper in a few minutes, which usually took me hours. It is a great help for me, and I am really proud of my son."&lt;/em&gt;&lt;br&gt;
— my mom, after trying it for the first time&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/slVRIz1HsvI" width="710" height="399"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>weekendchallenge</category>
      <category>hf26challenge</category>
      <category>gemma</category>
    </item>
  </channel>
</rss>
