<?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: Shadow</title>
    <description>The latest articles on DEV Community by Shadow (@shadow16ua).</description>
    <link>https://dev.to/shadow16ua</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%2F4155614%2F5fd14b76-d881-4419-976e-ec2cb40b8722.jpg</url>
      <title>DEV Community: Shadow</title>
      <link>https://dev.to/shadow16ua</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/shadow16ua"/>
    <language>en</language>
    <item>
      <title>StudyBuddy AI: Taming Gemma 2B to Build a Local Quiz Generator for a Friend</title>
      <dc:creator>Shadow</dc:creator>
      <pubDate>Sun, 04 Oct 2026 14:39:41 +0000</pubDate>
      <link>https://dev.to/shadow16ua/studybuddy-ai-taming-gemma-2b-to-build-a-local-quiz-generator-for-a-friend-4mpo</link>
      <guid>https://dev.to/shadow16ua/studybuddy-ai-taming-gemma-2b-to-build-a-local-quiz-generator-for-a-friend-4mpo</guid>
      <description>&lt;h2&gt;
  
  
  Who I Built It For
&lt;/h2&gt;

&lt;p&gt;My friend is currently preparing for university exams and technical interviews (focusing on databases and C#). Reading dry documentation gets boring quickly, so I wanted to build an interactive, multiple-choice quiz partner that tests their knowledge on any given topic. Since it's for a student, it had to be completely free and accessible without internet restrictions.&lt;/p&gt;

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

&lt;p&gt;I built &lt;strong&gt;StudyBuddy AI&lt;/strong&gt; — a lightweight, completely local web application that generates 3-question multiple-choice quizzes on any subject. &lt;/p&gt;

&lt;p&gt;GitHub Repository: &lt;a href="https://github.com/Shadow16Ua/StudyBuddy-AI" rel="noopener noreferrer"&gt;https://github.com/Shadow16Ua/StudyBuddy-AI&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Tech Stack:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;AI Model:&lt;/strong&gt; Google's &lt;code&gt;gemma2:2b&lt;/code&gt; running locally via Ollama.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Backend:&lt;/strong&gt; .NET 10 Minimal API (C#) to handle prompting and JSON parsing.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Frontend:&lt;/strong&gt; Pure HTML, CSS, and Vanilla JavaScript (with a sleek dark mode).&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  📸 Demo
&lt;/h3&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%2F35sytt21dmaq4d3o89iw.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%2F35sytt21dmaq4d3o89iw.PNG" alt=" " width="800" height="496"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Open Innovation Matters Here
&lt;/h2&gt;

&lt;p&gt;Choosing an open-weight model like Gemma 2B over a closed API (like OpenAI) was crucial for this project for three main reasons:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; &lt;strong&gt;Zero Cost &amp;amp; Privacy:&lt;/strong&gt; My friend can generate hundreds of quizzes without worrying about API limits, subscription fees, or sending their study data to a third-party server.&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;100% Offline Capability:&lt;/strong&gt; It runs perfectly on a standard laptop CPU, meaning they can study during commutes or internet outages.&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;The Engineering Challenge (Taming the 2B Model):&lt;/strong&gt; This was the most interesting part. I quickly realized that small 2B models struggle to output complex JSON arrays (like 3 questions at once). It would constantly hallucinate structures or merge answers. Because I had full control over the local inference, I was able to completely redesign the backend pipeline. Instead of asking for 3 questions in one prompt, my C# backend asynchronously asks Gemma for &lt;em&gt;one&lt;/em&gt; question, exactly 3 times in a loop, and then manually constructs a bulletproof JSON array. This guarantees perfect UI rendering every single time. I also shifted the "shuffle options" logic to the frontend to prevent the AI from confusing correct/incorrect indexes. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Open source allowed me to iterate rapidly, observe the raw output locally, and engineer a robust wrapper around a lightweight model to make it perform like a much heavier one.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Note: I'm submitting this project for the Best Use of Gemma category as well!&lt;/em&gt;&lt;/p&gt;

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