<?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: Swasti Jain</title>
    <description>The latest articles on DEV Community by Swasti Jain (@swasti2004).</description>
    <link>https://dev.to/swasti2004</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%2F4165565%2F30ad8216-6a19-43cd-a491-511772e81a37.png</url>
      <title>DEV Community: Swasti Jain</title>
      <link>https://dev.to/swasti2004</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/swasti2004"/>
    <language>en</language>
    <item>
      <title>Touch Grass Planner: A local Gemma model that picks your next 30 minutes outside</title>
      <dc:creator>Swasti Jain</dc:creator>
      <pubDate>Sun, 11 Oct 2026 14:14:41 +0000</pubDate>
      <link>https://dev.to/swasti2004/touch-grass-planner-a-local-gemma-model-that-picks-your-next-30-minutes-outside-3mhi</link>
      <guid>https://dev.to/swasti2004/touch-grass-planner-a-local-gemma-model-that-picks-your-next-30-minutes-outside-3mhi</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;The hardest part of taking a break outdoors is often decision fatigue: you need to pick somewhere, check the weather, see if you have time, and you end up scrolling on your phone instead of heading outside.&lt;/p&gt;

&lt;p&gt;The repository is called &lt;strong&gt;blaze-and-back&lt;/strong&gt; after the blaze markers painted on hiking trails and the concept of an outing that comfortably fits a time budget. On DEV, it is published as &lt;strong&gt;Touch Grass Planner&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Touch Grass Planner&lt;/strong&gt; is a local-first web app designed to minimize screen time to under 30 seconds: you give it three quick inputs, it suggests where to go, and you put the phone away.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;How many minutes you have free&lt;/strong&gt; (15 to 240 minutes)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Your current energy level&lt;/strong&gt; (Low, Medium, High)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Where you are&lt;/strong&gt; (geolocation button or typed town) — plus optional interest tags (quiet, water, views, greenery, exercise, photography) or your own custom typed mood.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If someone doesn't have anything specific in mind, there is a &lt;strong&gt;"✨ Surprise me"&lt;/strong&gt; mode that injects exploratory themes (like micro-adventures or hidden gems) so the model finds an interesting novelty spot.&lt;/p&gt;

&lt;p&gt;The app fetches current weather and precipitation forecasts from Open-Meteo, discovers nearby parks, gardens, nature reserves, viewpoints, and beaches from OpenStreetMap, filters out infeasible or unsafe trips in deterministic code, and prompts a local open-weight &lt;strong&gt;Gemma&lt;/strong&gt; model running through Ollama to select and explain the best options. You choose one, download a self-contained offline "outing card" (a standalone HTML file), and leave.&lt;/p&gt;

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

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

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Direct Video Link&lt;/strong&gt;: &lt;a href="https://youtu.be/DMELZJ57C5Y" rel="noopener noreferrer"&gt;Watch the walkthrough demo on YouTube&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GitHub Repository&lt;/strong&gt;: &lt;a href="https://github.com/Swasti2004/blaze-and-back" rel="noopener noreferrer"&gt;https://github.com/Swasti2004/blaze-and-back&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Repository created and developed inside the challenge window (October 2026).&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;&lt;strong&gt;Disclosure:&lt;/strong&gt; The initial project scaffold — backend, tests, interface, and documentation — was generated with Claude on 2026-10-07 (&lt;code&gt;53c3e4f&lt;/code&gt;). Subsequent functional improvements and resilient production features were built iteratively using the Antigravity AI coding agent across clear, verified commits:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;5aa15c7&lt;/code&gt; — 10-minute in-memory cache for weather and places lookups (keyed by coarsened coordinates)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;361c782&lt;/code&gt; — Polite exponential retry with random jitter on Overpass API transient errors (&lt;code&gt;429&lt;/code&gt;, &lt;code&gt;502&lt;/code&gt;, &lt;code&gt;503&lt;/code&gt;, &lt;code&gt;504&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;1011db0&lt;/code&gt; — Local outing history API (&lt;code&gt;GET /api/history&lt;/code&gt;, &lt;code&gt;DELETE /api/history&lt;/code&gt;) and front-end management&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;c5aa8a0&lt;/code&gt; — Accessibility pass: keyboard order and programmatic focus management for errors and suggestions&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;922e796&lt;/code&gt; — Automatic OpenStreetMap Nominatim fallback when global Overpass servers are overloaded&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;94dc1ba&lt;/code&gt; &amp;amp; &lt;code&gt;4a98bd0&lt;/code&gt; — Custom typed mood/activity input and top-level "✨ Surprise me" mode&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  The Stack
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Backend&lt;/strong&gt;: FastAPI on Python 3.11+.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Frontend&lt;/strong&gt;: Vanilla HTML5, CSS3, and JavaScript — zero frameworks, no build step, pure CSS design with trail-blaze effort badges.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Local Model&lt;/strong&gt;: Tested with &lt;code&gt;gemma2:9b&lt;/code&gt;. The code's default environment tag is &lt;code&gt;gemma4&lt;/code&gt; (untested on this machine).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Open Data&lt;/strong&gt;: Open-Meteo for real-time weather and OpenStreetMap (Overpass + Nominatim fallback) for geographic features.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Local Persistence&lt;/strong&gt;: Local SQLite database storing accepted, skipped, and completed outings to prevent repeated destinations and adapt after high-effort days.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Core Architecture Rules
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Rules decide what is possible; the model decides what is good.&lt;/strong&gt; Weather hazards (thunderstorms, rain probability ≥ 60% over the next 3 hours, winds ≥ 50 km/h, extreme temperatures), darkness, and trips exceeding walking-time or energy limits are filtered out in code before the model is called.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Never trust the model's output.&lt;/strong&gt; Suggestions returned by Ollama are checked against the explicit candidate list provided in the prompt. Hallucinated place IDs, invalid JSON, or impossible durations are rejected. If nothing valid remains or Ollama is offline, the app falls back to a deterministic rule-based ranking and clearly notes it.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Testing
&lt;/h3&gt;

&lt;p&gt;47 automated unit and integration tests run via &lt;code&gt;pytest&lt;/code&gt;. They cover weather code parsing, geographic coarsening, Overpass response sanitization, LLM JSON validation, SQLite history tracking, and cache TTL expiry. Every outside service is mocked with fake HTTP transports, so the suite executes with zero network and no running model required.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Open Source and Local Inference
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Privacy.&lt;/strong&gt; Your prompt — time available, energy level, interests, recent outings, and candidate places — goes only to the local Ollama server on your own computer. The only data that leaves your device are coordinates rounded to about 110 m, sent to Open-Meteo and OpenStreetMap for weather and map queries.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Swappable models.&lt;/strong&gt; Changing one environment variable (&lt;code&gt;OLLAMA_MODEL&lt;/code&gt;) swaps the model. No vendor lock-in and zero per-request fees.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Zero API cost, and a card that works without signal.&lt;/strong&gt; Running locally costs nothing per query. While weather and map lookups require an active internet connection (making it local-first, not fully offline), the generated outing card is a standalone HTML document that opens reliably in airplane mode with zero connectivity.&lt;/p&gt;

&lt;h3&gt;
  
  
  Local Model Comparison
&lt;/h3&gt;

&lt;p&gt;Benchmarked using &lt;code&gt;scripts/compare_models.py&lt;/code&gt; with &lt;code&gt;--runs 1&lt;/code&gt; across three fixed planning scenarios (totaling 3 calls per model):&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Model&lt;/th&gt;
&lt;th&gt;Scenarios run&lt;/th&gt;
&lt;th&gt;Valid replies&lt;/th&gt;
&lt;th&gt;Median latency (s)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;gemma2:9b&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;3/3 (100%)&lt;/td&gt;
&lt;td&gt;28.2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;llama3.2:latest&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;3/3 (100%)&lt;/td&gt;
&lt;td&gt;13.9&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Both models achieved 100% schema compliance. On this machine, &lt;code&gt;llama3.2:latest&lt;/code&gt; was roughly twice as fast, but &lt;code&gt;gemma2:9b&lt;/code&gt; was selected as the primary engine for its reasoned explanations and adherence to the open-weight Gemma challenge requirements.&lt;/p&gt;

&lt;h2&gt;
  
  
  Known Limits
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Local Model Latency:&lt;/strong&gt; &lt;code&gt;gemma2:9b&lt;/code&gt; takes approximately 28 seconds per planning request on this hardware.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;OpenStreetMap Coverage:&lt;/strong&gt; OpenStreetMap density varies significantly by locality; sparse areas may yield fewer named natural features.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Walking Time Heuristics:&lt;/strong&gt; Walk durations are estimated using straight-line distance × 1.3 at 4.8 km/h. Actual terrain and street layout will vary.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Places Only:&lt;/strong&gt; Currently suggests physical outdoor spaces rather than live or ticketed events.&lt;/li&gt;
&lt;/ul&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; &lt;code&gt;gemma2:9b&lt;/code&gt; runs completely on-device through Ollama, acting as the decision-making engine that analyzes open-data candidates and synthesizes actionable outdoor suggestions without cloud APIs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GitHub Actions CI:&lt;/strong&gt; The repository implements an automated test workflow (&lt;code&gt;.github/workflows/ci.yml&lt;/code&gt;) that verifies all 47 unit and integration tests on push and pull requests with zero third-party credentials.&lt;/li&gt;
&lt;/ul&gt;

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