DEV Community

Riya Dhami
Riya Dhami

Posted on

🥾TrailQuest AI: Forcing myself to touch grass with local Python, Gemma & Ollama 🌱

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

What I Built

I built TrailQuest AI, an offline-first, local AI outdoor adventure generator designed to break screen fatigue by turning local AI inference into physical outdoor quests.

As an engineering student spending long hours in front of my desktop PC, I noticed how easy it is to fall into screen lock when trying to take a break. TrailQuest AI minimizes screen interaction to under 30 seconds:

  1. You pick your available time (10 to 120 minutes) and challenge level.
  2. You select an outdoor vibe (Mindful & Chill, Scavenger Hunt, Energetic Walk, or Nature Photography) and current weather/setting.
  3. In seconds, local inference streams a structured 3-step "Quest Card" with route goals, mindfulness observation tasks, reflection photo challenges, and trail safety tips.

Once the card appears, your screen experience ends—you step outside and touch grass.


Demo

TrailQuest AI Running Locally

Example Quest Card Output (Sunlit Sojourn: A Mindful Walk):

  • Step 1 (Route & Goal): Complete a 1-mile loop around the park.
  • Step 2 (Observation & Mindfulness): Notice how sunlight filters through the leaves, creating dancing patterns on the ground. Count at least 5 different types of leaf shapes or colors as you walk.
  • Step 3 (Reflection & Photo Challenge): Snap a photo where you feel most relaxed and peaceful. Reflect on why this moment feels so rejuvenating.
  • Safety & Trail Tip: Stay hydrated and wear sunscreen to protect yourself from the sun's rays.

Code

🥾 TrailQuest AI — Offline Outdoor Adventure Generator

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


What I Built

TrailQuest AI is a lightweight, local-first web application that turns screen time into offline real-world outdoor adventures.

Instead of endlessly scrolling through social media or struggling to decide what to do outside, users pick their available time (e.g., 10–120 minutes), their desired outdoor vibe (Mindful & Chill, Scavenger Hunt, Energetic Walk, Nature Photography, Rainy Day Walks, Fall Foliage Tracker, Night Sky Observation, etc.), weather/season setting, and immediate location.

In seconds, TrailQuest AI generates a personalized, 3-step physical "Quest Card" with clear goals, observation challenges, reflection prompts, and safety tips. Once generated, the screen experience ends and the user steps outside to "touch grass."

It is built for students, remote workers, and anyone looking to break screen fatigue without exposing their daily location habits…


How I Built It

TrailQuest AI is built around a pure Python, production-grade local AI architecture:

  • Frontend & Dashboard: Built with Streamlit for a clean, dark-mode UI complete with real-time telemetry, model status indicators, and local sidebar controls.
  • Local AI Engine: Powered by Ollama running open-weight models (gemma:2b / qwen2.5:3b) locally on desktop hardware.
  • Real-Time Token Streaming: Renders generated quest cards character-by-character as tokens stream directly from the local LLM runtime.
  • Pydantic Schema Validation: Uses structured JSON output enforcement to guarantee every generated quest contains valid Route, Observation, Reflection, and Safety sections.
  • Multi-Model Fallback: Implements resilient fallback logic (qwen2.5:3b -> llama3.2:1b / gemma:2b) so quest generation succeeds even if the primary model is busy or uninitialized.
  • Offline Streak & Quest Logging: Built-in SQLite database (trailquest.db) that tracks local outdoor streaks and quest completion history without cloud telemetry.

Running it locally


bash
# Pull open-weight models via Ollama
ollama pull gemma:2b
ollama pull qwen2.5:3b

# Clone & run locally
git clone [https://github.com/RiyaDhami13/trailquest-ai.git](https://github.com/RiyaDhami13/trailquest-ai.git)
cd trailquest-ai
pip install -r requirements.txt
streamlit run app.py

##Why Does Open Innovation Matter?
Using open-weight models locally made this project fundamentally better than relying on a closed cloud API:

1. 100% Habit & Location Privacy: Personal routines, free time schedules, and local neighborhood traits stay strictly on my desktop PC. Zero prompt logs or location data leave the machine.

2. $0 Operational Cost: By running inference locally via Ollama, the app requires $0 in cloud API keys or monthly subscriptions, making open AI tools freely accessible to student builders.

3. True Offline Trail Capability: Open-weight models execute directly on consumer hardware without an active internet connection—allowing quest generators to run seamlessly on a laptop at remote trailheads with zero cell coverage.

##[](
![ ](https://dev-to-uploads.s3.us-east-2.amazonaws.com/uploads/articles/no6uohidvhdgbnf6v1sc.png))Taking It Outside 🥾
To test the app, I selected a 15-minute "Mindful & Chill" quest card on my PC, put my desktop on sleep mode, and went for a loop around my neighborhood.

The app tasked me with observing sunlight patterns through tree leaves and collecting 5 distinct leaf shapes without looking at my phone. Having the AI generate a structured, lightweight physical task made stepping away from my workstation effortless—the screen time took under 30 seconds, and I spent the next 20 minutes completely offline.
Enter fullscreen mode Exit fullscreen mode

Top comments (2)

Some comments may only be visible to logged-in visitors. Sign in to view all comments.