<?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: Prakul Chandra</title>
    <description>The latest articles on DEV Community by Prakul Chandra (@prakulchandra866).</description>
    <link>https://dev.to/prakulchandra866</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%2F4173928%2Fad5a07ce-c508-422f-aa91-0843ce0d056f.jpeg</url>
      <title>DEV Community: Prakul Chandra</title>
      <link>https://dev.to/prakulchandra866</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/prakulchandra866"/>
    <language>en</language>
    <item>
      <title>Fieldnotes: a nature journal that uses local Gemma 4, then tells you to put the phone away</title>
      <dc:creator>Prakul Chandra</dc:creator>
      <pubDate>Sat, 10 Oct 2026 12:03:09 +0000</pubDate>
      <link>https://dev.to/prakulchandra866/fieldnotes-a-nature-journal-that-uses-local-gemma-4-then-tells-you-to-put-the-phone-away-2d6i</link>
      <guid>https://dev.to/prakulchandra866/fieldnotes-a-nature-journal-that-uses-local-gemma-4-then-tells-you-to-put-the-phone-away-2d6i</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;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;Most nature apps want you to keep looking at them. Fieldnotes is built to end its own session.&lt;/p&gt;

&lt;p&gt;You photograph a bird, plant or insect, answer a couple of plain-language questions ("not sure" is always an allowed answer), and a Gemma 4 model running on your own computer reads the photo. It does not hand back a confident label. It tells you what it can actually see, offers up to three candidates with an honest likelihood, and lists what you should look for to be surer.&lt;/p&gt;

&lt;p&gt;Then comes the part I care about most. Saving the observation doesn't drop you into a feed. It opens a full-screen page with no navigation, one short quest written for &lt;em&gt;that&lt;/em&gt; observation, and a timer that keeps running while your screen is locked. A typical quest: sit quietly for five minutes and listen for the calls this bird makes. The page tells you to keep your phone in your pocket. When you come back, you add one line about what you noticed, and it goes into your offline journal next to the photo.&lt;/p&gt;

&lt;p&gt;It's for curious beginners, families, and anyone who would rather learn to &lt;em&gt;look&lt;/em&gt; than collect labels.&lt;/p&gt;

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

&lt;p&gt;&lt;a href="https://youtu.be/wU37paksRVc" rel="noopener noreferrer"&gt;&lt;/a&gt;&lt;br&gt;
I recorded it on my laptop: a real photo, Gemma analyzing it, the hedged result, saving to the journal, the go-and-look screen, and the journal entry afterwards.&lt;/p&gt;

&lt;p&gt;There is no live link, and that's deliberate. The AI runs on your own machine through Ollama, so a hosted copy of the page would have nothing to talk to. The repo below runs in four commands.&lt;/p&gt;
&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/prakulchandragit/fieldnotes" rel="noopener noreferrer"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ollama pull gemma4:e2b
npm &lt;span class="nb"&gt;install
&lt;/span&gt;npm run check:gemma path/to/photo.jpg   &lt;span class="c"&gt;# confirms the model can read an image&lt;/span&gt;
npm run dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The README covers model setup, limitations, and which model sizes to use on which hardware.&lt;/p&gt;

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

&lt;p&gt;&lt;strong&gt;The stack:&lt;/strong&gt; React + Vite, installable as a PWA, with the journal and quests stored on the device. The AI is &lt;strong&gt;Gemma 4&lt;/strong&gt;, an open-weight model from Google, served locally by &lt;strong&gt;Ollama&lt;/strong&gt;. Photos and answers go from the app to Ollama on the same machine and nothing is sent to a cloud service.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why Gemma 4:&lt;/strong&gt; I needed a model that understands images and runs on a laptop. Gemma 4 comes in several sizes that accept images, and the small "E" variants are meant for modest hardware. I develop on an i7 (12th gen) with 16 GB RAM and an RTX 3050 Ti, which has only a small amount of video memory, so I started with &lt;code&gt;gemma4:e2b&lt;/code&gt; and tested &lt;code&gt;gemma4:e4b&lt;/code&gt; for better vision. The model name is one environment variable, so switching is a one-line change.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Structured output:&lt;/strong&gt; I ask Gemma for JSON that matches a schema (what it can see, what's missing, up to three candidates with a likelihood band, a short quest) rather than free text. Then I don't trust it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Guardrails in code, not just in the prompt.&lt;/strong&gt; A small model's own confidence score isn't a real probability, so the app enforces its own rules after the model replies:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;There is no "certain" level, only &lt;em&gt;unlikely&lt;/em&gt;, &lt;em&gt;possible&lt;/em&gt; and &lt;em&gt;probable&lt;/em&gt;. Sentences like "this is definitely..." are removed.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Probable&lt;/em&gt; needs a photo, at least three visible features, and no equally likely rival.&lt;/li&gt;
&lt;li&gt;With no photo, nothing can rise above &lt;em&gt;possible&lt;/em&gt;. If the photo is unusable, every candidate drops to &lt;em&gt;unlikely&lt;/em&gt; and no name is shown.&lt;/li&gt;
&lt;li&gt;Anything below &lt;em&gt;probable&lt;/em&gt; is displayed as "Possibly X", so the headline carries the doubt, not just the paragraph underneath.&lt;/li&gt;
&lt;li&gt;Plants and fungi always carry a "never eat or handle based on this result" notice.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I wrote unit tests for these rules using deliberately overconfident fake model output, so they're checked without needing a model.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Smaller engineering details:&lt;/strong&gt; browsers can't call Ollama directly (CORS), so Vite proxies &lt;code&gt;/ollama&lt;/code&gt; to the local server. The service worker deliberately never caches Ollama requests, otherwise a stale cached reply could make the app claim the model was available when it wasn't.&lt;/p&gt;

&lt;h3&gt;
  
  
  What went wrong
&lt;/h3&gt;

&lt;p&gt;I tested with a photo of a Great Tit (black head, white cheek patch, yellow belly). With &lt;code&gt;gemma4:e2b&lt;/code&gt; and no location information, Gemma suggested a &lt;strong&gt;Yellow-rumped Warbler&lt;/strong&gt;, a North American species. It was wrong, and it had no way of knowing where I was.&lt;/p&gt;

&lt;p&gt;The app handled it the way I'd hoped: it said it couldn't determine the exact species from the image alone, listed what to check, and told me to keep my phone in my pocket. But the first version still put a confident-looking species name in the headline above that hedge. That was a design bug, and it's why anything below &lt;em&gt;probable&lt;/em&gt; now shows as "Possibly...".&lt;/p&gt;

&lt;p&gt;To see what actually helps, I ran the same photo three ways:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Setup&lt;/th&gt;
&lt;th&gt;What Gemma said&lt;/th&gt;
&lt;th&gt;Time&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;e2b&lt;/code&gt;, no region&lt;/td&gt;
&lt;td&gt;Yellow-rumped Warbler (or similar)&lt;/td&gt;
&lt;td&gt;9:00PM&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;[FILL: two or three sentences on what changed and what surprised you. Report it honestly, even if the answer was still wrong.]&lt;/p&gt;

&lt;p&gt;Recently I went on a hike , pictured a birds or two , helped me to narrow down my choices&lt;/p&gt;

&lt;h3&gt;
  
  
  Limits
&lt;/h3&gt;

&lt;p&gt;Gemma is a general vision-language model, not a species classifier. Expect sensible answers at the level of "a tit-like bird" and weaker ones between close look-alikes, juveniles, or poor photos. On a laptop with a small GPU, answers take noticeably longer than a cloud API. And this version runs on the computer, with the phone talking to it over the same network, so it's local rather than fully in-your-pocket.&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Privacy.&lt;/strong&gt; Photos of a garden, a balcony, or a child's hand holding a leaf never leave the machine. With a closed API, every photo would be sent to someone else's server.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No signal needed.&lt;/strong&gt; Trails rarely have coverage. Analysis needs no internet, only a local connection to the computer running the model.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Free to run, no account.&lt;/strong&gt; There's no API key and no per-photo cost, which matters for something people should want to use every day.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Swappable and tunable.&lt;/strong&gt; I changed the model size, the sampling temperature and a location hint just by editing environment variables, and I could point the same code at a fine-tuned species model later.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Auditable.&lt;/strong&gt; The weights are released under Apache 2.0, so anyone can reproduce my demo and check what it does.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I also want to be honest about where closed would have been better. A larger closed model, or a dedicated species-identification service, would probably name species more accurately than a small local model on my hardware. For this app, I'd rather have a slightly less accurate guess that stays private, works offline, and openly shows its doubt.&lt;/p&gt;

&lt;h2&gt;
  
  
  My Agent Session
&lt;/h2&gt;

&lt;p&gt;I used Claude (Anthropic) as a coding assistant while building this. Gemma is the model inside the app and does all the identification. &lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Best Use of Gemma:&lt;/strong&gt; Gemma 4 runs locally through Ollama and is the core of the app, and I tested more than one model size.&lt;/li&gt;
&lt;/ul&gt;

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