<?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: AKANGA ANDREW</title>
    <description>The latest articles on DEV Community by AKANGA ANDREW (@akanga_andrew_7066acbd769).</description>
    <link>https://dev.to/akanga_andrew_7066acbd769</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%2F1624172%2Fd259faad-6771-439b-8a05-862bfc1fe89d.png</url>
      <title>DEV Community: AKANGA ANDREW</title>
      <link>https://dev.to/akanga_andrew_7066acbd769</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/akanga_andrew_7066acbd769"/>
    <language>en</language>
    <item>
      <title>The New Curriculum Arrived. The Revision Books Didn't. So We Built an Offline Gemma 4 Physics Tutor.</title>
      <dc:creator>AKANGA ANDREW</dc:creator>
      <pubDate>Thu, 26 Nov 2026 13:33:46 +0000</pubDate>
      <link>https://dev.to/akanga_andrew_7066acbd769/the-new-curriculum-arrived-the-revision-books-didnt-so-we-built-an-offline-gemma-4-physics-tutor-4bbb</link>
      <guid>https://dev.to/akanga_andrew_7066acbd769/the-new-curriculum-arrived-the-revision-books-didnt-so-we-built-an-offline-gemma-4-physics-tutor-4bbb</guid>
      <description>&lt;p&gt;Soma Physics is a Physics tutor built on Uganda's NCDC lower-secondary syllabus. It runs on &lt;strong&gt;one laptop, with no internet&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Gemma 4 E4B runs locally&lt;/strong&gt; through Ollama. After setup, nothing leaves the laptop.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Learners join from their phones&lt;/strong&gt; over the classroom hotspot. The phone is only a screen.&lt;/li&gt;
&lt;li&gt;They can ask by &lt;strong&gt;text, photo or voice&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;It gives a &lt;strong&gt;hint first&lt;/strong&gt;. The full worked answer appears only when the learner asks for it.&lt;/li&gt;
&lt;li&gt;Every answer &lt;strong&gt;cites the syllabus topic&lt;/strong&gt; it came from.&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;calculator tool&lt;/strong&gt; does the arithmetic, and a &lt;strong&gt;second pass checks the working&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Teachers can ask for an &lt;strong&gt;activity&lt;/strong&gt;: a real-life task set in rural Uganda, using cheap local materials.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We won &lt;strong&gt;Best Use of Gemma 4&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%2Fck8jtqmvse04755rj6yd.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%2Fck8jtqmvse04755rj6yd.png" alt="Hacktoberfest 2026 certificate: Best Use of Gemma 4, Hacktoberfest Hack Day Kampala x GDG on Campus Makerere University, October 17, 2026" width="800" height="566"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Never let a small model do arithmetic.&lt;/strong&gt; Gemma decides &lt;em&gt;what&lt;/em&gt; to calculate. Python does the calculation. The final answer is told to use the calculator's numbers exactly, and the UI shows those results so a learner (or teacher) can check them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Structure beats clever prompting.&lt;/strong&gt; Every answer comes back as JSON with the same fields: &lt;code&gt;hint&lt;/code&gt;, &lt;code&gt;answer&lt;/code&gt;, &lt;code&gt;worked_steps&lt;/code&gt;, &lt;code&gt;citation&lt;/code&gt;, &lt;code&gt;check_question&lt;/code&gt;. That is what lets the UI hide the answer behind a button and always show where the answer came from.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Accuracy costs time, and I chose accuracy.&lt;/strong&gt; On my laptop (RTX 3050 6 GB GPU), a worked calculation takes about a minute. The tutor makes several Gemma calls in a row: one to solve with the calculator, one to write the answer, one to check it. I could drop the check to make it faster. But for a tutor, a fast wrong answer is worse than a slow right one. It also means I can't yet say it runs well on a cheap school laptop. Testing that is next.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Small models love Markdown and LaTeX.&lt;/strong&gt; If you look closely at the screenshots below, you'll see raw &lt;code&gt;**bold**&lt;/code&gt; and &lt;code&gt;$\frac{...}{...}$&lt;/code&gt; in places. Gemma writes them, and my no-build UI shows them as plain text. The fix is either to render them or to ask the model for plain text only.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Hackathon setup bites.&lt;/strong&gt; Partway through the day, &lt;code&gt;ollama pull gemma4:e4b&lt;/code&gt; failed because my Ollama was too old for Gemma 4. Update your tools before the event, not during it.&lt;/p&gt;
&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;🎥 &lt;strong&gt;&lt;a href="https://drive.google.com/file/d/1r_xGoWdyypqL1C4ZQ2dnJOlfSyZzXiot/view?usp=drivesdk" rel="noopener noreferrer"&gt;Watch the demo video&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;💻 &lt;strong&gt;Code (MIT):&lt;/strong&gt; &lt;a href="https://github.com/blackbody256/soma-physics" rel="noopener noreferrer"&gt;github.com/blackbody256/soma-physics&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The screenshots below are from a fresh run of the app, fully offline, using local Gemma 4 E4B.&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%2Fe8r820iu4p9mnie1bf56.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%2Fe8r820iu4p9mnie1bf56.png" alt="Soma Physics home screen on a laptop: &amp;quot;Ask a question. Find the physics.&amp;quot; with three starter questions and buttons for photo, voice and activity" width="800" height="504"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A worked calculation.&lt;/strong&gt; The learner gets a hint first. "Show full answer" reveals the working, the calculator results, a question to test themselves, and the syllabus topic. Answers like this take about a minute on my laptop.&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%2Ferb8ipot9c2ry1t1em3r.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%2Ferb8ipot9c2ry1t1em3r.png" alt="Left: the learner's question and a hint. Right: the full answer with working, calculator results, a test-yourself question and the Topic 1 citation" width="800" height="909"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;An activity and voice input.&lt;/strong&gt; I asked for an activity on heat transfer. It wrote a task about keeping a village cooking pot warm with clay, sand and foil. Voice questions are recorded on the phone and transcribed on the laptop.&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%2F9polx42lgwczggjn4f5z.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%2F9polx42lgwczggjn4f5z.png" alt="Left: an activity of integration about saving heat when cooking in a village. Right: the voice recording state with &amp;quot;Stop and send&amp;quot; and a listening indicator" width="800" height="960"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Partner Technologies
&lt;/h2&gt;

&lt;p&gt;The whole project is built on &lt;strong&gt;Google's Gemma 4&lt;/strong&gt;, run locally through Ollama. We also used the &lt;strong&gt;Gemini API&lt;/strong&gt; to run a hosted Gemma 4 model from the same code. Here is how each piece works.&lt;/p&gt;
&lt;h3&gt;
  
  
  One local model for text, images and audio
&lt;/h3&gt;

&lt;p&gt;Gemma 4 E4B is small enough to run on a laptop GPU, and it takes text, images and audio. So one model, &lt;code&gt;gemma4:e4b&lt;/code&gt; in Ollama, handles all three ways of asking:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Text&lt;/strong&gt; goes straight into the tutoring pipeline.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Photo:&lt;/strong&gt; the phone shrinks the image, and Gemma 4 first reads the question out of it. The extracted question then goes through the same pipeline as text.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Voice:&lt;/strong&gt; &lt;code&gt;ffmpeg&lt;/code&gt; converts the recording to 16 kHz WAV, and Gemma 4 transcribes it. If audio input fails, it falls back to &lt;code&gt;faster-whisper&lt;/code&gt;, which also runs locally.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Grounding answers in the syllabus
&lt;/h3&gt;

&lt;p&gt;We load pages of the NCDC Physics syllabus PDF with PyMuPDF. If a page's text comes out garbled, Gemma 4 reads the page as an image instead. The chunks are embedded with &lt;strong&gt;EmbeddingGemma&lt;/strong&gt; and stored in SQLite, alongside an FTS5 keyword index as a fallback.&lt;/p&gt;

&lt;p&gt;When a question comes in, the closest chunks are retrieved. If none scores above a threshold, the tutor kindly says the question is outside the syllabus instead of guessing.&lt;/p&gt;
&lt;h3&gt;
  
  
  Hint first, calculator always, then a check
&lt;/h3&gt;

&lt;p&gt;Gemma 4 answers in a fixed JSON schema (passed to Ollama's &lt;code&gt;format=&lt;/code&gt;). For calculation questions, it first solves the problem with thinking turned on and a &lt;code&gt;calculate&lt;/code&gt; tool. The tool is a small safe calculator: it parses the expression with Python's &lt;code&gt;ast&lt;/code&gt; and allows only &lt;code&gt;+ - * / **&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;solve_with_tools&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;question&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;provider&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="no"&gt;LOCAL&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;messages&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"role"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"system"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"content"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;SOLVER_PROMPT&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"role"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"user"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"content"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"SYLLABUS CONTEXT:\n{context}\n\nQUESTION: {question}"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="n"&gt;results&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;msg&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;chat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;provider&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;provider&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tools&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;calculate&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                   &lt;span class="n"&gt;think&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="no"&gt;USE_THINKING&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;options&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="no"&gt;CALC_OPTIONS&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tool_calls&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;content&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;results&lt;/span&gt;
        &lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"role"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"assistant"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"content"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;content&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"tool_calls"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tool_calls&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;call&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tool_calls&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;expr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;call&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;function&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;arguments&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"expression"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="n"&gt;out&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;calculate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;expr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="n"&gt;results&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"{expr} = {out}"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"role"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"tool"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"content"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;out&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"tool_name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;call&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;function&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;results&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The calculator results are passed into the final answer prompt as &lt;code&gt;CALCULATOR RESULTS (use exactly)&lt;/code&gt;. Then a &lt;strong&gt;self-check&lt;/strong&gt; call at low temperature (0.2) compares the worked steps against those results. If they disagree, the learner sees a warning with the correction.&lt;/p&gt;

&lt;h3&gt;
  
  
  Gemini API: the same harness on a bigger Gemma
&lt;/h3&gt;

&lt;p&gt;To prototype quickly, we added a dropdown that switches from local Gemma to &lt;strong&gt;Gemma 4 26B A4B hosted on the Gemini API&lt;/strong&gt; (using the &lt;code&gt;google-genai&lt;/code&gt; SDK). We didn't want two copies of the tutoring logic, so &lt;code&gt;model_router.py&lt;/code&gt; translates Ollama-style messages into Gemini API content. That includes images and tool calls, which become &lt;code&gt;Part.from_function_call&lt;/code&gt; and &lt;code&gt;Part.from_function_response&lt;/code&gt;. The calculator loop, the JSON schema and the self-check all run unchanged on either model.&lt;/p&gt;

&lt;p&gt;Cloud mode is off unless the server has a &lt;code&gt;GEMINI_API_KEY&lt;/code&gt;. The UI warns that cloud mode sends the question and photo to Google, while voice transcription and retrieval stay on the laptop.&lt;/p&gt;

&lt;h3&gt;
  
  
  An Agent Skill for the teaching rules
&lt;/h3&gt;

&lt;p&gt;The teaching rules live in &lt;code&gt;skills/ncdc-physics-tutor/SKILL.md&lt;/code&gt;, written in the open Agent Skills format. They include: short sentences (English is many learners' second language), SI units in every step, everyday Ugandan examples, and a hint before the answer. The same tutor behaviour can then be reused in other agent harnesses, not just this app.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hackathon Experience
&lt;/h2&gt;

&lt;p&gt;On &lt;strong&gt;17 October 2026&lt;/strong&gt;, we joined &lt;strong&gt;Hacktoberfest Hack Day Kampala&lt;/strong&gt;, hosted by &lt;strong&gt;GDG on Campus Makerere University&lt;/strong&gt;, powered by &lt;strong&gt;MLH × DEV&lt;/strong&gt;, with &lt;strong&gt;DigitalOcean&lt;/strong&gt; as presenting partner. This year Hacktoberfest focused on open-source AI. The question we set ourselves was simple: &lt;em&gt;what can we build with an open model that actually helps a student in Uganda?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The day moved fast. We started by getting the pipeline running: loading syllabus pages, pulling the models, and fighting the Ollama version error. Then the first answer took over a minute, even with a GPU, and we had to decide whether to keep the self-check. We kept it. The afternoon and evening were a run of small commits: the mobile UI, photo and voice input, the name and new look, the local/cloud switch, conversation memory, and a recording animation so learners can see the app is listening. The last commit, at 19:40, added the demo video to the README.&lt;/p&gt;

&lt;p&gt;What I'll remember most is that the idea came from home. It wasn't a generic AI demo. It came from a real gap I know from studying Physics here. Being named &lt;strong&gt;Best Use of Gemma 4&lt;/strong&gt; for something built around Uganda's own syllabus meant a lot.&lt;/p&gt;

&lt;p&gt;Thank you to &lt;strong&gt;GDG on Campus Makerere University&lt;/strong&gt; and &lt;strong&gt;MLH&lt;/strong&gt; for running the Hack Day, to &lt;strong&gt;Tugume Keith&lt;/strong&gt; for leading it, and to &lt;strong&gt;Terence&lt;/strong&gt; for building this with me.&lt;/p&gt;

&lt;p&gt;Soma Physics is still early. The next step is testing it with real learners and teachers, on the kind of laptops schools actually have. &lt;strong&gt;If you teach Physics or work with schools in Uganda, I'd love your feedback.&lt;/strong&gt; Open an issue on the repo or message me.&lt;/p&gt;

&lt;h1&gt;
  
  
  mlhacks
&lt;/h1&gt;

</description>
      <category>mlhacks</category>
      <category>devchallenge</category>
      <category>hackathon</category>
      <category>ai</category>
    </item>
  </channel>
</rss>
