<?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: Manswi Pradhan</title>
    <description>The latest articles on DEV Community by Manswi Pradhan (@newton_lebniz).</description>
    <link>https://dev.to/newton_lebniz</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%2F4154248%2F8146ea21-8628-4850-a3a0-81006b9c1a77.jpg</url>
      <title>DEV Community: Manswi Pradhan</title>
      <link>https://dev.to/newton_lebniz</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/newton_lebniz"/>
    <language>en</language>
    <item>
      <title>OUTSIDE: a local Gemma picks your next quest and tells you to put the phone away</title>
      <dc:creator>Manswi Pradhan</dc:creator>
      <pubDate>Sun, 11 Oct 2026 17:30:30 +0000</pubDate>
      <link>https://dev.to/newton_lebniz/outside-a-local-gemma-picks-your-next-quest-and-tells-you-to-put-the-phone-away-53k9</link>
      <guid>https://dev.to/newton_lebniz/outside-a-local-gemma-picks-your-next-quest-and-tells-you-to-put-the-phone-away-53k9</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;OUTSIDE tells you what to do outside right now.&lt;/p&gt;

&lt;p&gt;It reads the time, the weather, how long until sunset, any event nearby and what you have already done today, then gives you one quest. At 5:45 PM on a clear day the quest is "find an open western view and watch the sunset for five minutes." If cloud rolls in, that quest is cancelled and replaced with something that does not need the sky. If a stargazing night is 3 km away then it becomes a special quest worth 500 XP.&lt;/p&gt;

&lt;p&gt;When you press Start, the screen says "Put your phone away" and shows a timer. That screen is the whole idea. The app has one job, which is to get you out of the door and then it gets out of your way.&lt;/p&gt;

&lt;p&gt;It is for anyone who opens their phone to decide what to do and ends up scrolling instead. There is no feed and no list to choose from, just one concrete thing to do.&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&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%2Fmzfn6ecgizynvze2157f.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%2Fmzfn6ecgizynvze2157f.png" alt="A sample quest" width="800" height="476"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The demo follows one evening:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A live quest for the current weather.&lt;/li&gt;
&lt;li&gt;A simulated 5:45 PM with a clear sky: a sunset quest, with the minutes until sunset on the card.&lt;/li&gt;
&lt;li&gt;Heavy cloud switched on: the banner reads "The sky isn't cooperating", the sunset quest is struck through and a different quest replaces it.&lt;/li&gt;
&lt;li&gt;Demo events switched on: a stargazing night 3.2 km away becomes a gold-outlined special quest, 500 XP, about 38 minutes on foot.&lt;/li&gt;
&lt;li&gt;Start the quest, see the "Put your phone away" screen, finish, collect the XP.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The weather and time controls exist only for demos. They let me show a cloudy evening without waiting for one.&lt;/p&gt;

&lt;h2&gt;
  
  
  Taking it outside
&lt;/h2&gt;

&lt;p&gt;So I majorly had the idea of this app due to my friend,as she always says that she has nothing to do outside and so she just ends up scrolling all day.&lt;br&gt;
So I tried it with her yesterday during the evening and we got the task to watch the sunset. We went and watched the sunset ,talked a bit and she said she enjoyed it, and even felt calm.&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%2Fx916ao9nueo1v78latj0.jpg" 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%2Fx916ao9nueo1v78latj0.jpg" alt="The picture we took later" width="591" height="1280"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/newton-lebniz/outside" rel="noopener noreferrer"&gt;Github Repo Link&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To run it you need Python 3.10+ and &lt;a href="https://ollama.com" rel="noopener noreferrer"&gt;Ollama&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 gemma3:1b
pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt; requirements.txt
uvicorn backend.main:app &lt;span class="nt"&gt;--reload&lt;/span&gt;   &lt;span class="c"&gt;# then open http://127.0.0.1:8000&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;&lt;strong&gt;The model:&lt;/strong&gt; Gemma 3 1B, running locally through Ollama. Ollama's &lt;code&gt;format&lt;/code&gt; option takes a JSON schema, so the model's reply is forced into the shape the app needs: quest type, title, action, duration and a one-sentence reason.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The stack:&lt;/strong&gt; a FastAPI backend and a plain HTML, CSS and JavaScript frontend with no build step. Weather and sunset time come from Open-Meteo, which is free and needs no key.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The loop:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;location + time + weather + sunset + events + today's history
      -&amp;gt; context engine
      -&amp;gt; local Gemma (JSON schema)
      -&amp;gt; rule check
      -&amp;gt; quest   (or a rule-based quest after two rejections)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;The model proposes and the code checks.&lt;/strong&gt; I did not trust a 1B model with the rules, so there is a validator between the model and the screen. If a quest breaks a rule, the model is asked once more with the reason. If it breaks a rule again, a rule-based generator answers instead and the card says so. The rules are small: no sky quest under heavy cloud or in the rain, no run on a hot day or after you already ran, short quests when it is wet, and an event quest has to name the real event.&lt;/p&gt;

&lt;p&gt;My first runs showed why this matters. An event quest came back one minute long. A sunset quest came back as "Observe the evening sky." Neither broke a rule I had written, so I added rules. Actions must be one or two concrete sentences, and an event quest's duration now comes from the walking time, calculated in code.&lt;/p&gt;

&lt;p&gt;The next problem was subtler. The model labelled 6 of my 7 test quests "nature", including the sunset one. That mattered because the "no sky quests under cloud" rule only checks quests labelled "sky", so a mislabelled stargazing quest would have walked straight past it. Now the prompt lists the quest types that are allowed right now, and code relabels any quest that mentions a sunset or stars as a sky quest before it is checked.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Testing.&lt;/strong&gt; I run the same seven situations through the model: a clear morning, a hot afternoon after a run, a clear sunset, a cloudy sunset, a stargazing event nearby, rain, and a cloudy night. Here is Gemma 3 1B before and after that fix:&lt;/p&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;Labelled "nature"&lt;/th&gt;
&lt;th&gt;Situation checks passed&lt;/th&gt;
&lt;th&gt;Answered by the model&lt;/th&gt;
&lt;th&gt;Right on first try&lt;/th&gt;
&lt;th&gt;Median latency&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Before the fix&lt;/td&gt;
&lt;td&gt;6 of 7&lt;/td&gt;
&lt;td&gt;5 of 6&lt;/td&gt;
&lt;td&gt;7 of 7&lt;/td&gt;
&lt;td&gt;6 of 7&lt;/td&gt;
&lt;td&gt;9.0 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;After the fix&lt;/td&gt;
&lt;td&gt;4 of 7&lt;/td&gt;
&lt;td&gt;6 of 6&lt;/td&gt;
&lt;td&gt;7 of 7&lt;/td&gt;
&lt;td&gt;6 of 7&lt;/td&gt;
&lt;td&gt;11.7 s&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;"Situation checks passed" is a low bar, because the validator enforces most of them. It tells me the whole system behaves, not that the model is good by itself. What separates models is how often they need a retry or the fallback, and how good the text is. &lt;br&gt;
I only tested Gemma 3 1B. The code lets you swap models with one environment variable, but I have not compared other models yet, so that is a feature of the design, not a result.&lt;/p&gt;

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

&lt;p&gt;A quest app needs your location, the times you are free and the places you go. I did not want to send that to a hosted API just to be told to go and look at a tree. With an open-weight model the quest generator runs on my own machine, so none of those prompts leave it.&lt;/p&gt;

&lt;p&gt;The limit of that claim matters, so here it is: the weather lookup goes to Open-Meteo, which receives my coordinates rounded to about 1 km, and it needs internet. The model does not.&lt;/p&gt;

&lt;p&gt;Three other things I got from an open model:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Swapping the model is one environment variable&lt;/strong&gt; (&lt;code&gt;OUTSIDE_MODEL&lt;/code&gt;), with the same prompt, schema and tests for every model.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A quest costs nothing to generate.&lt;/strong&gt; Nobody has to decide whether a tap is worth a bill.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Constrained output.&lt;/strong&gt; The reply has to match my schema, and I could test it against fixed situations on my own hardware.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A larger closed model would do some things better than my 1B model, and I would rather say so. Several of my test quests sent people to "the nearby creek" or "a quiet bench near a small green space". The model has no map, so it invents places. At night, my cloudy-night quest told the user to watch "the shadows beneath the trees" even though I had told the model it was dark. A bigger model would likely follow that. The validator catches what I thought to write a rule for, and nothing else.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Did Not Work
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Completion is an honor-system button. Nothing checks that you went outside.&lt;/li&gt;
&lt;li&gt;Events are demo data. I did not find a free events API worth using, so events are a list, and the app labels demo events "(demo event)" on the card.&lt;/li&gt;
&lt;li&gt;A quest takes about 11 seconds on my laptop with the 1B model, so the loading screen cycles through what the app is doing.&lt;/li&gt;
&lt;li&gt;I wanted Jupiter in the sky quests and cut it to finish the core loop. Sky quests use sunset time, cloud cover and time of day.&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; The quest generator is Gemma 3 1B running locally through Ollama with schema-constrained output. I tested it against seven fixed situations and measured how often its first answer passed my rules.&lt;/p&gt;

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