<?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: Pawan Shivaji ghule</title>
    <description>The latest articles on DEV Community by Pawan Shivaji ghule (@pawan_shivajighule_cd68b).</description>
    <link>https://dev.to/pawan_shivajighule_cd68b</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%2F3533123%2F0c22ec5d-463d-4dae-9414-3e2f1225daca.jpg</url>
      <title>DEV Community: Pawan Shivaji ghule</title>
      <link>https://dev.to/pawan_shivajighule_cd68b</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/pawan_shivajighule_cd68b"/>
    <language>en</language>
    <item>
      <title>GrassWhisperer 🌿 — A Local AI Outdoor Companion That Works With No Signal</title>
      <dc:creator>Pawan Shivaji ghule</dc:creator>
      <pubDate>Sun, 11 Oct 2026 06:30:36 +0000</pubDate>
      <link>https://dev.to/pawan_shivajighule_cd68b/grasswhisperer-a-local-ai-outdoor-companion-that-works-with-no-signal-38c</link>
      <guid>https://dev.to/pawan_shivajighule_cd68b/grasswhisperer-a-local-ai-outdoor-companion-that-works-with-no-signal-38c</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;I built &lt;strong&gt;GrassWhisperer&lt;/strong&gt; 🌿 — a local-first AI outdoor companion that gets you off the screen and into the world in under 30 seconds.&lt;/p&gt;

&lt;p&gt;It's a beautifully designed web app with &lt;strong&gt;four AI-powered tools&lt;/strong&gt;, all running 100% on your laptop with no internet connection, no API keys, and no accounts:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Tool&lt;/th&gt;
&lt;th&gt;What It Does&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;🐦 &lt;strong&gt;Bird Whisperer&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;Describe what you see or hear on the trail → instant species ID, call sounds, field tips&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;🌱 &lt;strong&gt;Garden Oracle&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;Your city + USDA zone → personalized weekly planting calendar with local frost dates&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;🥾 &lt;strong&gt;Trail Finder&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;Location + available time → seasonal trail picks (fall foliage, wildflowers, sunrise) + gear list&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;🤔 &lt;strong&gt;Ask Nature&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;Free-form outdoor Q&amp;amp;A — foraging, stargazing, animal tracking, gear, safety&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Who is it for?&lt;/strong&gt; Hikers, birders, gardeners, runners, and anyone who wants to feel more connected to the natural world. The app is built around a single principle: &lt;strong&gt;the screen time should be the shortest part of the experience.&lt;/strong&gt; Open it, get your answer, close it, go outside.&lt;/p&gt;




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

&lt;p&gt;🚀 &lt;strong&gt;Run it locally in 3 commands:&lt;/strong&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 llama3.2:1b          &lt;span class="c"&gt;# one-time model download (~700MB)&lt;/span&gt;
git clone https://github.com/PawanTheGod/grasswhisperer
&lt;span class="nb"&gt;cd &lt;/span&gt;grasswhisperer &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; npm start
&lt;span class="c"&gt;# → open http://localhost:3333&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;App in action:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The Bird Whisperer tab — describe a bird from the field and get a full identification with call sounds and ID tips:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Type: "small bird, bright yellow belly, black cap, white cheeks, pine tree, making 'chickadee-dee-dee' call"&lt;/em&gt;&lt;br&gt;
→ Identifies: &lt;strong&gt;Black-capped Chickadee&lt;/strong&gt; with habitat, call description, and field tips&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The Garden Oracle — enter your city and get a planting calendar for this exact week, with frost dates pulled from the model's training data:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Type: "Portland, Oregon, Zone 8b"&lt;/em&gt;&lt;br&gt;
→ Get: garlic to plant now, frost date info, soil prep task, and what to wait on until spring&lt;/p&gt;
&lt;/blockquote&gt;


&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/PawanTheGod" rel="noopener noreferrer"&gt;
        PawanTheGod
      &lt;/a&gt; / &lt;a href="https://github.com/PawanTheGod/grasswhisperer" rel="noopener noreferrer"&gt;
        grasswhisperer
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      🌿 Local AI outdoor companion — bird ID, garden planner, trail finder. Powered by Ollama + llama3.2. No cloud, no API keys. Hacktoberfest Touch Grass 2024.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;🌿 GrassWhisperer&lt;/h1&gt;
&lt;/div&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Hacktoberfest 2024 · Challenge 1: Touch Grass&lt;/strong&gt;&lt;br&gt;
Local AI outdoor companion — 100% open-source, runs on your laptop, no internet needed.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;What It Does&lt;/h2&gt;
&lt;/div&gt;

&lt;p&gt;GrassWhisperer is a &lt;strong&gt;local-first AI app&lt;/strong&gt; that helps you get off the screen and into the world:&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;&lt;div class="table-wrapper-paragraph"&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;table&gt;

&lt;thead&gt;

&lt;tr&gt;

&lt;th&gt;Feature&lt;/th&gt;

&lt;th&gt;Description&lt;/th&gt;

&lt;/tr&gt;

&lt;/thead&gt;

&lt;tbody&gt;

&lt;tr&gt;

&lt;td&gt;🐦 &lt;strong&gt;Bird Whisperer&lt;/strong&gt;&lt;br&gt;
&lt;/td&gt;

&lt;td&gt;Describe what you see or hear — get an instant ID with field tips&lt;/td&gt;

&lt;/tr&gt;

&lt;tr&gt;

&lt;td&gt;🌱 &lt;strong&gt;Garden Oracle&lt;/strong&gt;&lt;br&gt;
&lt;/td&gt;

&lt;td&gt;Enter your city/zone, get a personalized weekly planting calendar&lt;/td&gt;

&lt;/tr&gt;

&lt;tr&gt;

&lt;td&gt;🥾 &lt;strong&gt;Trail Finder&lt;/strong&gt;&lt;br&gt;
&lt;/td&gt;

&lt;td&gt;Find the best hike near you for the season (fall foliage, wildflowers, etc.)&lt;/td&gt;

&lt;/tr&gt;

&lt;tr&gt;

&lt;td&gt;🤔 &lt;strong&gt;Ask Nature&lt;/strong&gt;&lt;br&gt;
&lt;/td&gt;

&lt;td&gt;Free-form Q&amp;amp;A — foraging, stargazing, wildlife tracking, gear&lt;/td&gt;

&lt;/tr&gt;

&lt;/tbody&gt;

&lt;/table&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Why Open Source Matters Here&lt;/h2&gt;
&lt;/div&gt;

&lt;p&gt;This runs &lt;strong&gt;entirely on your laptop using &lt;a href="https://ollama.com" rel="nofollow noopener noreferrer"&gt;Ollama&lt;/a&gt; + llama3.2:1b&lt;/strong&gt; — a tiny open-weight model that fits in under 1GB of RAM.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;✅ &lt;strong&gt;Works offline on the trail&lt;/strong&gt; — no cell signal needed&lt;/li&gt;
&lt;li&gt;✅ &lt;strong&gt;Your data never leaves your device&lt;/strong&gt; — no API keys…&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/PawanTheGod/grasswhisperer" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;📂 Repository:&lt;/strong&gt; &lt;a href="https://github.com/PawanTheGod/grasswhisperer" rel="noopener noreferrer"&gt;github.com/PawanTheGod/grasswhisperer&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key files:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/PawanTheGod/grasswhisperer/blob/master/server.js" rel="noopener noreferrer"&gt;&lt;code&gt;server.js&lt;/code&gt;&lt;/a&gt; — Express server + all 4 Ollama AI endpoints&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/PawanTheGod/grasswhisperer/blob/master/public/index.html" rel="noopener noreferrer"&gt;&lt;code&gt;public/index.html&lt;/code&gt;&lt;/a&gt; — Full UI with tab navigation&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/PawanTheGod/grasswhisperer/blob/master/public/style.css" rel="noopener noreferrer"&gt;&lt;code&gt;public/style.css&lt;/code&gt;&lt;/a&gt; — Dark forest theme with micro-animations&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/PawanTheGod/grasswhisperer/blob/master/public/app.js" rel="noopener noreferrer"&gt;&lt;code&gt;public/app.js&lt;/code&gt;&lt;/a&gt; — Vanilla JS, zero frameworks&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/PawanTheGod/grasswhisperer/blob/master/setup.js" rel="noopener noreferrer"&gt;&lt;code&gt;setup.js&lt;/code&gt;&lt;/a&gt; — Auto-setup: checks Ollama, pulls model&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Tech Stack:&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;Runtime  → Ollama (MIT license) — local LLM server
Model    → llama3.2:1b (Meta open weights) — ~700MB, &amp;lt;1GB RAM
Server   → Node.js + Express
Frontend → Vanilla HTML / CSS / JS  (no build step, no bundler)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






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

&lt;h3&gt;
  
  
  Architecture
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Browser → Express (localhost:3333) → Ollama API (localhost:11434) → llama3.2:1b
                                              ↑
                                 Runs entirely on your machine.
                                 No packets leave your network.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Open-Source AI Core: Ollama + llama3.2:1b
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://ollama.com" rel="noopener noreferrer"&gt;Ollama&lt;/a&gt; is the open-source runtime that makes all of this possible. It manages model downloads, runs a local REST API server (identical interface to OpenAI), and handles inference — all through a dead-simple &lt;code&gt;http://localhost:11434&lt;/code&gt; endpoint.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;llama3.2:1b&lt;/code&gt; is Meta's smallest open-weight Llama 3 model. At ~700MB and under 1GB RAM it runs comfortably on a 4-year-old laptop. Fast enough for real-time Q&amp;amp;A (5–15 seconds per response on CPU).&lt;/p&gt;

&lt;h3&gt;
  
  
  Prompt Engineering for Structured Output
&lt;/h3&gt;

&lt;p&gt;The key challenge with compact local models is reliable JSON output. I solved this with tight, schema-pinned system prompts:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// server.js — Bird Whisperer system prompt&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;system&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`You are a friendly field ornithologist.
Respond in this EXACT JSON format (no markdown):
{
  "name": "Common Name",
  "scientific": "Scientific name",
  "confidence": "high/medium/low",
  "calls": "What its call sounds like",
  "habitat": "Where to find it",
  "funFact": "One surprising fact",
  "look_for": "Key identification tips outdoors"
}`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then the server extracts JSON safely using &lt;code&gt;raw.match(/\{[\s\S]*\}/)&lt;/code&gt; — handling cases where the model wraps its response in extra prose.&lt;/p&gt;

&lt;h3&gt;
  
  
  Swapping Models is One Line
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// In server.js — change this to any Ollama model:&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;MODEL&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;llama3.2:1b&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;   &lt;span class="c1"&gt;// default — tiny, fast, any laptop&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;MODEL&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;llama3.2:3b&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;   &lt;span class="c1"&gt;// smarter, better JSON reliability&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;MODEL&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;mistral&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;        &lt;span class="c1"&gt;// excellent at instruction following&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;MODEL&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;phi3:mini&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;      &lt;span class="c1"&gt;// Microsoft's ultralight model&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






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

&lt;p&gt;A bird ID app that needs the cloud to work &lt;strong&gt;doesn't work when you need it most&lt;/strong&gt; — standing in the woods with no signal watching an unfamiliar bird disappear into the trees.&lt;/p&gt;

&lt;p&gt;Here's exactly where open-source AI beat every closed alternative for this use case:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. 📶 It works offline on the trail.&lt;/strong&gt;&lt;br&gt;
Once &lt;code&gt;llama3.2:1b&lt;/code&gt; is downloaded (one time, 700MB), GrassWhisperer works with zero connectivity. No OpenAI API key. No Gemini quota. No network at all. That's a genuine difference in the real world.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. 🔒 Your data never leaves your machine.&lt;/strong&gt;&lt;br&gt;
Where you hike, what birds you're seeing, your garden's location, questions about foraging near your home — none of that touches a server. With closed APIs, every question is logged and potentially used for training. With Ollama + open weights, it stays in RAM and disappears when you close the tab.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. 💸 It costs nothing to run.&lt;/strong&gt;&lt;br&gt;
Closed APIs charge per token. Heavy outdoor Q&amp;amp;A use could easily add up to $10–20/month. GrassWhisperer has zero marginal cost after setup — no metering, no billing, no surprises.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. 🔧 You can swap, extend, or fine-tune the model.&lt;/strong&gt;&lt;br&gt;
Want a model fine-tuned on bird taxonomy? Swap it in — one line change. Want to add plant identification using a vision model like &lt;code&gt;llava&lt;/code&gt;? It's one new endpoint. Closed APIs lock you into their update schedule, their capabilities, and their pricing. Open weights give you full sovereignty.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. 💻 It runs on cheap hardware.&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;llama3.2:1b&lt;/code&gt; uses under 1GB RAM and responds in under 15 seconds on a CPU. A $35 Raspberry Pi 5 could run this at a community garden, a nature center, or a trail head kiosk. That kind of democratization only happens with open weights.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The screen should be the &lt;strong&gt;shortest&lt;/strong&gt; part of a Touch Grass experience. Open-source AI makes that possible by putting the intelligence on the device in your pocket — not in a data center you're permanently paying to rent access to.&lt;/p&gt;
&lt;/blockquote&gt;




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

&lt;p&gt;This project was built collaboratively with an AI coding agent (Antigravity IDE). The agent:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Scaffolded the full Express + Ollama integration from scratch&lt;/li&gt;
&lt;li&gt;Designed the prompt engineering strategy for extracting structured JSON from compact models&lt;/li&gt;
&lt;li&gt;Built the dark forest-themed CSS with ambient animations and glassmorphism cards&lt;/li&gt;
&lt;li&gt;Wrote the auto-setup script to detect Ollama status and pull models&lt;/li&gt;
&lt;li&gt;Built the full frontend — tabs, result rendering, error states, example chips&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The entire project went from zero to running in a single session — made possible by the simplicity of the open-source stack. No API key management. No cloud deployment. No billing dashboard. Just &lt;code&gt;npm start&lt;/code&gt; and it works.&lt;/p&gt;




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

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Best Use of Ollama / Local Inference:&lt;/strong&gt; GrassWhisperer is built entirely around Ollama as its open-source inference runtime. Without Ollama, the app doesn't exist — it's not an afterthought, it's the foundation. Every AI feature runs through the local Ollama API with zero cloud dependencies.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>devchallenge</category>
      <category>hf26challenge</category>
    </item>
    <item>
      <title>🐾 Sanctuary: Building a Living AI Companion with Gemma</title>
      <dc:creator>Pawan Shivaji ghule</dc:creator>
      <pubDate>Mon, 05 Oct 2026 06:24:27 +0000</pubDate>
      <link>https://dev.to/pawan_shivajighule_cd68b/sanctuary-building-a-living-ai-companion-with-gemma-39nk</link>
      <guid>https://dev.to/pawan_shivajighule_cd68b/sanctuary-building-a-living-ai-companion-with-gemma-39nk</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/hacktoberfest-weekend-2026-10-01"&gt;Hacktoberfest Weekend Challenge: Build for a Friend&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

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

&lt;p&gt;I built &lt;strong&gt;Sanctuary&lt;/strong&gt; — a living AI companion featuring a virtual roommate pet named &lt;strong&gt;Mochi&lt;/strong&gt;, powered by &lt;strong&gt;Google's open-weight Gemma 2B model&lt;/strong&gt; and optional &lt;strong&gt;ElevenLabs voice synthesis&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Instead of being another chatbot that waits for a prompt inside a text box, Mochi is an autonomous creature designed to share your digital workspace.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🐾 &lt;strong&gt;Continuous Autonomous Life Simulation:&lt;/strong&gt; Mochi has an ongoing internal state model including energy, happiness, curiosity, restfulness, boredom, and social need. It wanders, stretches, loafs, naps, and reacts to the user without continuously calling an AI model.&lt;/li&gt;
&lt;li&gt;👁️ &lt;strong&gt;Passive Workspace Awareness:&lt;/strong&gt; Mochi tracks cursor position, movement, proximity, and user activity. When the user is actively typing, it suppresses unnecessary interruptions and gives them space.&lt;/li&gt;
&lt;li&gt;🧠 &lt;strong&gt;Gemma-Powered Reflection:&lt;/strong&gt; When the user wants to talk or needs guidance, Mochi can activate Google's open-weight &lt;strong&gt;Gemma 2B&lt;/strong&gt; model for CBT-inspired reflection. It can help identify patterns such as catastrophizing or all-or-nothing thinking and turn them into more balanced perspectives and practical grounding steps.&lt;/li&gt;
&lt;li&gt;🗣️ &lt;strong&gt;Warm Voice Interaction:&lt;/strong&gt; Mochi can speak using &lt;strong&gt;ElevenLabs Flash v2.5&lt;/strong&gt;, with the browser's Web Speech API available as an alternative for users who want a local/offline voice option.&lt;/li&gt;
&lt;li&gt;🪟 &lt;strong&gt;Floating Companion Mode:&lt;/strong&gt; Mochi can move around the Sanctuary viewport and can be popped out into a browser-managed floating window using the &lt;strong&gt;Document Picture-in-Picture API&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;🫁 &lt;strong&gt;Grounding Tools:&lt;/strong&gt; Sanctuary includes guided breathing and ambient calming experiences, including procedural purring and rain sounds.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I built Sanctuary for my friend &lt;strong&gt;Alex&lt;/strong&gt;, a software engineer who struggles with late-night burnout, insomnia, and spiraling self-criticism during difficult work periods.&lt;/p&gt;

&lt;p&gt;The problem I wanted to solve was simple:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;When someone is overwhelmed, why should they have to open a blank chatbot and figure out what to type?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Mochi is designed to provide quiet digital companionship first. It can simply sit nearby, wander around, take a nap, or react to what you're doing. When you actually want to talk, it becomes an intelligent conversational companion.&lt;/p&gt;

&lt;p&gt;Sanctuary is intended as an emotional-support and mindful-grounding companion, &lt;strong&gt;not a clinical treatment or replacement for professional therapy&lt;/strong&gt;.&lt;/p&gt;

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

&lt;p&gt;🚀 &lt;strong&gt;Live Web App:&lt;/strong&gt; &lt;a href="https://sanctuary-0ib8.onrender.com/" rel="noopener noreferrer"&gt;https://sanctuary-0ib8.onrender.com/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In supported Chromium browsers such as Chrome and Edge, use the &lt;strong&gt;Pop-out PiP&lt;/strong&gt; button to detach Mochi into a browser-managed floating companion window while you continue working.&lt;/p&gt;

&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/PawanTheGod" rel="noopener noreferrer"&gt;
        PawanTheGod
      &lt;/a&gt; / &lt;a href="https://github.com/PawanTheGod/sanctuary" rel="noopener noreferrer"&gt;
        sanctuary
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;🌱 Sanctuary — Living AI Roommate Pet &amp;amp; Supportive Companion&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;&lt;a href="https://dev.to/challenges/hacktoberfest-weekend-2026-10-01" rel="nofollow"&gt;&lt;img src="https://camo.githubusercontent.com/693e309623128fd3399db97a4cb7ff21e182ff279f529726d77f9194bbb549fa/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4861636b746f62657266657374253230323032362d4275696c64253230666f7225323061253230467269656e642d3232633535653f7374796c653d666c61742d737175617265" alt="Hacktoberfest 2026"&gt;&lt;/a&gt;
&lt;a href="https://ai.google.dev/gemma" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/c8980d4eb863ff38762f1f693b1aa5d687da50c11aa5997b30dd5e03f03c784c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f427261696e2d476f6f676c6525323047656d6d6125323032422d3432383546343f7374796c653d666c61742d737175617265" alt="Powered by Gemma"&gt;&lt;/a&gt;
&lt;a href="https://elevenlabs.io" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/0523063cefcc6c12ab836a1d5d75e83abb9d845fd426ce477ba72026c7bc1c5b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f566f6963652d456c6576656e4c616273253230466c61736825323076322e352d6639373331363f7374796c653d666c61742d737175617265" alt="Voice by ElevenLabs"&gt;&lt;/a&gt;
&lt;a href="https://github.com/PawanTheGod/sanctuary/LICENSE" rel="noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/7d217ebb91a61cb4d98e70dee31eb08e0a5f71bc518ebd4151a73c6fb1191d00/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d626c75653f7374796c653d666c61742d737175617265" alt="License"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Sanctuary&lt;/strong&gt; is a supportive companion and living roommate pet ("Mochi") built for a friend navigating burnout, late-night insomnia, and acute anxiety spirals.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;em&gt;(Note: Sanctuary is an emotional support and mindful grounding companion, not a clinical treatment or replacement for professional therapy.)&lt;/em&gt;&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;✨ What Is Sanctuary?&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;Sanctuary is built around &lt;strong&gt;Mochi&lt;/strong&gt; — an autonomous creature that inhabits your digital workspace.&lt;/p&gt;
&lt;p&gt;Unlike traditional chatbot assistants that wait passively for text prompts or send intrusive pop-up notifications, Mochi runs a &lt;strong&gt;continuous 20Hz local life simulation&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;🐾 &lt;strong&gt;Living Presence:&lt;/strong&gt; Wanders across your screen, stretches, loafs, sleeps with floating Zzz particles, and gets playful micro-zoomies.&lt;/li&gt;
&lt;li&gt;👁️ &lt;strong&gt;Cursor Awareness:&lt;/strong&gt; Dynamic eye pupil tracking and proximity dwell detection relative to your cursor.&lt;/li&gt;
&lt;li&gt;🧠 &lt;strong&gt;Open-Source Gemma Brain:&lt;/strong&gt; Leverages &lt;strong&gt;Google's open-weight Gemma LLM&lt;/strong&gt; (running on-device via WebGPU / WebLLM or local Ollama) for CBT-inspired cognitive distortion reflection and…&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/PawanTheGod/sanctuary" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;📂 &lt;strong&gt;GitHub Repository:&lt;/strong&gt; &lt;a href="https://github.com/PawanTheGod/sanctuary" rel="noopener noreferrer"&gt;https://github.com/PawanTheGod/sanctuary&lt;/a&gt;&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;Vanilla JavaScript (ES Modules)&lt;/li&gt;
&lt;li&gt;HTML5&lt;/li&gt;
&lt;li&gt;CSS3&lt;/li&gt;
&lt;li&gt;Web Audio API&lt;/li&gt;
&lt;li&gt;WebGPU&lt;/li&gt;
&lt;li&gt;WebLLM (&lt;code&gt;@mlc-ai/web-llm&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Google Gemma 2B&lt;/li&gt;
&lt;li&gt;Ollama&lt;/li&gt;
&lt;li&gt;ElevenLabs API&lt;/li&gt;
&lt;li&gt;Document Picture-in-Picture API&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;Sanctuary is built around a decoupled architecture where Mochi's &lt;strong&gt;body and cognition are separate systems&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. MochiLifeEngine — The Body
&lt;/h3&gt;

&lt;p&gt;The core &lt;code&gt;mochi-engine.js&lt;/code&gt; runs a continuous local life simulation.&lt;/p&gt;

&lt;p&gt;Instead of asking an LLM what Mochi should do every few milliseconds, the engine maintains internal biological-style variables such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;energy&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;happiness&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;curiosity&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;boredom&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;sleepiness&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;socialNeed&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A priority arbitrator uses these values and the current context to select behaviors such as wandering, approaching the cursor, playing, loafing, stretching, affection, or sleeping.&lt;/p&gt;

&lt;p&gt;This means Mochi can feel alive &lt;strong&gt;without continuously consuming LLM tokens&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. ContextProvider — The Senses
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;context-provider.js&lt;/code&gt; acts as Mochi's sensory layer.&lt;/p&gt;

&lt;p&gt;It observes local interaction signals such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Cursor position and movement&lt;/li&gt;
&lt;li&gt;Cursor proximity to Mochi&lt;/li&gt;
&lt;li&gt;User activity and inactivity&lt;/li&gt;
&lt;li&gt;Typing activity&lt;/li&gt;
&lt;li&gt;Browser focus&lt;/li&gt;
&lt;li&gt;Session duration&lt;/li&gt;
&lt;li&gt;User interaction with Mochi&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These events allow Mochi to respond to its environment without requiring an LLM for every decision.&lt;/p&gt;

&lt;p&gt;One important design rule is that &lt;strong&gt;active typing suppresses unnecessary proactive interruptions&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Gemma — The Cognitive Layer
&lt;/h3&gt;

&lt;p&gt;When an interaction actually requires reasoning, Sanctuary escalates from the local life engine to Gemma.&lt;/p&gt;

&lt;p&gt;The primary local path uses:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Gemma 2B → WebLLM → WebGPU&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;with the model:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;gemma-2-2b-it-q4f16_1-MLC&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Sanctuary also supports a local Ollama path using:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;gemma2:2b&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Gemma is therefore not responsible for Mochi's continuous physical behavior.&lt;/p&gt;

&lt;p&gt;Instead:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Mochi's local life engine → meaningful interaction → Gemma reasoning → Mochi response&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This separation was one of the most important architectural decisions in the project.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. CBT-Inspired Reflection
&lt;/h3&gt;

&lt;p&gt;When the user shares a worry, Mochi can use Gemma to structure the conversation around CBT-inspired reflection.&lt;/p&gt;

&lt;p&gt;For example, it can help identify patterns such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Catastrophizing&lt;/li&gt;
&lt;li&gt;All-or-nothing thinking&lt;/li&gt;
&lt;li&gt;Mind reading&lt;/li&gt;
&lt;li&gt;Negative assumptions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It then helps turn the thought into a more balanced perspective and a small practical grounding action.&lt;/p&gt;

&lt;p&gt;The goal is not to replace therapy, but to make supportive reflection feel more natural and accessible.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Voice Layer
&lt;/h3&gt;

&lt;p&gt;For users who want spoken interaction, Sanctuary can route Mochi's responses through &lt;strong&gt;ElevenLabs Flash v2.5&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The browser's Web Speech API provides an alternative voice path, allowing the core companion experience to remain usable without requiring ElevenLabs.&lt;/p&gt;

&lt;h3&gt;
  
  
  6. Floating Companion Surface
&lt;/h3&gt;

&lt;p&gt;Mochi was originally designed as a website companion, but I wanted the pet itself to feel more persistent.&lt;/p&gt;

&lt;p&gt;Sanctuary therefore includes a dedicated floating companion layer and a &lt;strong&gt;Document Picture-in-Picture&lt;/strong&gt; surface.&lt;/p&gt;

&lt;p&gt;This allows Mochi to leave the main Sanctuary interface and remain visible in a browser-managed floating window while the user works elsewhere.&lt;/p&gt;

&lt;p&gt;It is deliberately browser-based rather than pretending to provide a native OS-wide overlay.&lt;/p&gt;

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

&lt;p&gt;Open innovation made an important part of Sanctuary possible: &lt;strong&gt;local AI cognition&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Instead of designing Sanctuary around a mandatory cloud LLM API, I could build the cognitive layer around an open-weight model that can run locally.&lt;/p&gt;

&lt;p&gt;With &lt;strong&gt;Gemma 2B running through WebLLM/WebGPU or Ollama&lt;/strong&gt;, users can run the reasoning component on their own machine.&lt;/p&gt;

&lt;p&gt;That changes the architecture significantly.&lt;/p&gt;

&lt;p&gt;The continuous life simulation doesn't need a cloud service at all. Mochi's behavior engine, state, context processing, and interaction logic can operate locally, while Gemma can also run locally when the user chooses a local inference path.&lt;/p&gt;

&lt;p&gt;This makes the companion:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Less dependent on network availability&lt;/li&gt;
&lt;li&gt;More responsive to local interactions&lt;/li&gt;
&lt;li&gt;More controllable by the developer&lt;/li&gt;
&lt;li&gt;Better suited to privacy-sensitive conversations when local inference is used&lt;/li&gt;
&lt;li&gt;Free from per-token cloud LLM costs in local mode&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Open-weight AI also allowed me to experiment with an architecture where the LLM is &lt;strong&gt;not the entire product&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Gemma is the cognitive layer.&lt;/p&gt;

&lt;p&gt;The rest of Mochi — its body, senses, behavior, memory/state, and personality — is software I designed around it.&lt;/p&gt;

&lt;p&gt;That was the part that made Sanctuary possible as more than another AI chat interface.&lt;/p&gt;

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

&lt;p&gt;I built Sanctuary through an intensive pair-programming workflow with an autonomous AI coding agent.&lt;/p&gt;

&lt;p&gt;The agent helped scaffold and iterate on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Mochi's life simulation&lt;/li&gt;
&lt;li&gt;ContextProvider&lt;/li&gt;
&lt;li&gt;Behavior prioritization&lt;/li&gt;
&lt;li&gt;Gemma/WebLLM integration&lt;/li&gt;
&lt;li&gt;Ollama fallback&lt;/li&gt;
&lt;li&gt;Voice integration&lt;/li&gt;
&lt;li&gt;Floating companion architecture&lt;/li&gt;
&lt;li&gt;Document Picture-in-Picture support&lt;/li&gt;
&lt;li&gt;Security and secret-leak checks&lt;/li&gt;
&lt;li&gt;Documentation and architecture files&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The development process was iterative: build → run → test → inspect → harden → repeat.&lt;/p&gt;

&lt;p&gt;The important architectural constraint throughout the process was to &lt;strong&gt;keep the 20Hz life engine independent from Gemma&lt;/strong&gt;, so the companion would remain responsive and autonomous rather than turning every movement into an LLM request.&lt;/p&gt;

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

&lt;h3&gt;
  
  
  🏆 Best Use of Gemma
&lt;/h3&gt;

&lt;p&gt;Gemma is the cognitive core of Sanctuary.&lt;/p&gt;

&lt;p&gt;The project uses Google's open-weight &lt;strong&gt;Gemma 2B&lt;/strong&gt; locally through WebLLM/WebGPU, with Ollama providing another local inference path.&lt;/p&gt;

&lt;p&gt;Rather than using Gemma simply as a chatbot, I integrated it into a larger autonomous companion architecture where it is selectively activated when meaningful reasoning is required.&lt;/p&gt;

&lt;h3&gt;
  
  
  🔊 Best Use of ElevenLabs
&lt;/h3&gt;

&lt;p&gt;ElevenLabs provides Mochi's expressive voice layer through &lt;strong&gt;ElevenLabs Flash v2.5&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The voice is designed to make Mochi feel more like a companion than a conventional text-based assistant, while Web Speech provides an alternative voice path.&lt;/p&gt;

&lt;h3&gt;
  
  
  🟣 Best Use of Render
&lt;/h3&gt;

&lt;p&gt;Sanctuary is deployed on &lt;strong&gt;Render&lt;/strong&gt;, providing a publicly accessible live application that anyone can try without setting up the project locally.&lt;/p&gt;

&lt;p&gt;🚀 &lt;strong&gt;Live Demo:&lt;/strong&gt; &lt;a href="https://sanctuary-0ib8.onrender.com/" rel="noopener noreferrer"&gt;https://sanctuary-0ib8.onrender.com/&lt;/a&gt;&lt;/p&gt;

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