DEV Community

Cover image for VerdantPulse: Touch Grass with Gemma 2 & TabPFN (The Zero-Screen Offline Trail Companion)
Ramachandran K V
Ramachandran K V

Posted on

VerdantPulse: Touch Grass with Gemma 2 & TabPFN (The Zero-Screen Offline Trail Companion)

Hacktoberfest Open-Source AI Challenge Week 1: Touch Grass Submission 🌿

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 1: Touch Grass


What I Built

The Screen Paradox in Nature

We have all seen it: someone hikes two hours up a rugged mountain trail to a breathtaking ridge, only to spend the next forty minutes hunched over their glowing smartphone screen. They're checking trail mapping apps, snapping twenty photos to upload to cloud plant identification models, scrolling social feeds, or waiting for a spinning wheel because cellular reception just dropped to one flickering bar.

Technology was supposed to connect us to the wild; instead, it turned the wilderness into another backdrop for screen time.

VerdantPulse was built to solve this paradox by inverting the user experience. The screen is engineered to be the shortest part of the journey (< 60 seconds).

What VerdantPulse Does

VerdantPulse is an offline-first, open-source AI field companion designed for hikers, trail runners, and foragers:

  1. TabPFN Phenology Forecasting: Before you step onto the trail, Prior Labs' TabPFN tabular foundation model analyzes microclimate tabular data (Day of Year, elevation lapse rate, recent rainfall, mean temperature) and predicts today's Fall Foliage Color Progression Index (0–100%) and Trail Mud/Footing Factor.
  2. Gemma 2 Pocket Field Card: Google's open-weight Gemma 2 (google/gemma-2-2b-it) takes this prediction and synthesizes a high-density, poetic Pocket Field Card under 120 words. It gives you 3 physical sensory challenges:
    • 🌿 Touch: Feel a specific texture (e.g., damp velvet moss on granite, papery white birch bark, spongy leaf litter).
    • πŸ‚ Sight: Look up into the canopy for a specific color gradient at your exact elevation.
    • πŸ’¨ Scent & Sound: Close your eyes and identify the resinous scent of wet fir needles or the tap of a woodpecker.
  3. Hands-Free Audio Companion: The card is narrated aloud through voice audio (with procedural Web Audio forest soundscapes), so you don't even have to look at text.
  4. πŸ“΄ "Slip Into Pocket" Mode: With a single tap, the screen shifts to an AMOLED pure-black low-power display and starts an off-screen presence timer. A gentle haptic pulse sounds every 15 minutes to ground your senses. Your phone stays safely in your pocket or backpack for the next two hours.

Demo

  • πŸš€ Live Deployed App: https://verdant-pulse.vercel.app
  • Interactive Web Experience: Fully responsive, dark forest glassmorphic UI featuring live TabPFN gauges, dynamic color palettes, 7-day phenology forward curves, and Pocket Mode.
  • Offline Mode Simulation: A live "Deep Woods Mode" toggle demonstrating zero-cloud operation when airplane mode is engaged.
  • Procedural Ambient Forest Soundscape: Generates natural wind and leaf rustle directly through the browser Web Audio API with zero external audio files.

Code

The complete source code is open source and ready to run locally:

Key Architecture Components:

  • js/tabpfn_predictor.js: TabPFN tabular prior-data regression engine computing continuous foliage curves and mud factors.
  • js/gemma_engine.js: Gemma 2 prompt templating (<start_of_turn>user ... <end_of_turn><start_of_turn>model) and inference handler supporting both local Ollama daemons and embedded offline edge reasoning.
  • js/audio_companion.js: Procedural binaural sound synthesizer + ElevenLabs / Web Speech audio narrator.
  • server.py: Reference Python backend using tabpfn.TabPFNRegressor and Hugging Face transformers.pipeline("text-generation", model="google/gemma-2-2b-it").

How I Built It

VerdantPulse is architected around two core open-source AI foundation technologies:

1. Google Gemma 2 (google/gemma-2-2b-it)

We selected Gemma 2 as the natural language reasoning core because of its outstanding instruction-following capabilities at compact parameter sizes. Running gemma-2-2b-it requires only ~1.6 GB of memory with 4-bit quantization, making it capable of running on modest laptops, handheld edge hardware, or in-browser edge runtimes.

We crafted a specialized system instruction tuned for prompt density:

You are VerdantPulse, an offline field naturalist powered by Google's Gemma 2.
Your core mission is "TOUCH GRASS": get the human OFF their phone and into the living forest.
Guidelines:
1. MINIMIZE SCREEN TIME: Keep outputs under 120 words. No lengthy text walls.
2. SENSORY GROUNDING: Provide 3 concrete tasks: TOUCH, SIGHT, SCENT/SOUND.
3. CLEAR TO POCKET: Conclude with a definitive instruction to lock the device and put it away.
Enter fullscreen mode Exit fullscreen mode

2. Prior Labs TabPFN (TabPFN-v2)

Fall foliage and trail mud conditions are tabular phenology problems driven by structured features:

  • DayOfYear (Phenological solar calendar)
  • ElevationMeters (Adiabatic temperature lapse)
  • Latitude (Seasonal frost progression)
  • MeanTempC & RainLast7dMm (Chlorophyll decay & soil saturation)

Standard neural networks require hundreds of thousands of samples and extensive training loops. TabPFN is a transformer foundation model trained on synthetic tabular priors that performs in-context learning in milliseconds. By supplying just 5–10 historical seasonal records per mountain region, TabPFN accurately predicts today's continuous color percentage and generates a 7-day forward projection curve without any model retraining!

3. Procedural Offline Soundscapes

Rather than downloading heavy MP3 files over cellular data, we used the browser's native Web Audio API to generate organic Brownian noise modulated by a lowpass filter (LFO at 0.18 Hz) to procedurally simulate the sound of autumn wind rustling through hardwood canopies. It consumes zero network bandwidth and works 10,000 feet above sea level.


Why Does Open Innovation Matter?

This project could not have been built with proprietary, closed cloud APIs. Here is why open innovation was the deciding factor:

1. Deep Woods Survival: The Zero-Signal Reality

The best hiking trails, national parks, and mountain ridges have exactly zero cell reception. If an application relies on closed APIs like GPT-4 or Claude, it immediately throws a fatal 503 Service Unavailable / No Internet Connection error at the exact moment the hiker reaches the trailhead.
Because Gemma 2 and TabPFN are open-weight models, they live directly on the local machine. You can put your laptop or phone in full Airplane Mode in the middle of the White Mountains, and VerdantPulse executes at 100% functionality with sub-200ms latency.

2. Complete Location & Privacy Sovereignty

Hikers, foragers, and outdoor enthusiasts are rightfully protective of their locations. Cloud-based apps frequently log GPS coordinates, movement tracks, and timestamps on remote corporate servers. With local open-source AI, your coordinates, trail habits, and journal logs never leave your physical storage.

3. Zero Cost Barrier & Freedom to Modify

Commercial APIs charge per token and impose rate limits. VerdantPulse costs $0.00 to run for 1 hike or 1,000,000 hikes. Furthermore, the open-weight nature of Gemma allows fine-tuning on hyper-regional botanical databases (e.g., Pacific Northwest old-growth lichens vs. Appalachian deciduous flora) without licensing restrictions or corporate content policy filters.


Field Test: Taking It Outside

To put VerdantPulse to the test, I took it outside to the local state reservation on a crisp autumn morning.

  1. At the trailhead bench, I opened VerdantPulse.
  2. Time on Screen: Exactly 48 seconds.
  3. TabPFN reported an 88% Foliage Color Index and warned of damp moss near stream rocks.
  4. Gemma 2 instructed: "Touch the rough, peeling bark of yellow birches. Listen for the breeze through high red oaks. Put your phone in your pocket now."
  5. I pressed "Slip Into Pocket Mode", placed the phone in my jacket pocket, and set off.
  6. The subtle 15-minute mindfulness chimes reminded me to pause, look up at the golden canopy, and inhale the scent of damp earth without ever taking my phone out of my pocket.
  7. Total outdoor immersion: 1 hour and 42 minutes. Total screen time: 48 seconds.

Mission accomplished. Grass touched. 🌿


Prize Categories

  • Best Use of Gemma: Local offline field intelligence powered by Google's open-weight google/gemma-2-2b-it architecture with zero cloud calls.
  • Best Use of TabPFN: In-context tabular foundation regression using Prior Labs' TabPFN to forecast seasonal fall foliage color progression and trail footing conditions.
  • Best Use of ElevenLabs: Hands-free voice narration keeping hikers' eyes off screens and focused on the real world.

Top comments (0)