DEV Community

chanveer singh
chanveer singh

Posted on

TrailPal Punjab: An Offline Open-Source AI Nature Guide That Gets You Off the Screen

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

TrailPal Punjab is an offline "what's that?" app for walks. Snap a plant, bird or insect and a local open-weight model names it and gives a fun fact, checked against a local list of Punjab species. A daily quest ("find 3 things") nudges you to go outside, and once it's done the app tells you to put the phone away. The screen is the shortest part of the experience. Built for hikers, kids, students and anyone curious about the trees and birds around them.

Demo

screenshots

Code

🌿 TrailPal Punjab

Offline "what's that?" for the outdoors. Point your camera at a plant, bird or insect, get the name plus a fun fact from a local open-weight model. No internet, no cloud, no photos leave your device. A daily quest (find 3 things) gets you outside.

Run it

# 1. install Ollama: https://ollama.com
ollama pull gemma3:4b          # one-time download (~3.3 GB); works offline after
pip install -r requirements.txt
streamlit run app.py
Enter fullscreen mode Exit fullscreen mode

Open on your phone via the "Network URL" Streamlit prints (same Wi-Fi/hotspot), or just run it on a laptop and carry it on a walk.

Open-source pieces

  • Gemma 3 (open-weight vision model) via Ollama (local inference)
  • Streamlit UI, Pillow, local JSON species list (data/species.json)
  • Swap the model by changing MODEL in app.py (e.g. qwen2.5vl:3b).

Add your own species

Edit data/species.json, no retraining needed.




How I Built It

  • Gemma 3 (4B), an open-weight vision model, run locally with Ollama
  • Streamlit for a simple camera-friendly UI
  • A local species.json of Punjab plants and birds to ground answers and reduce hallucinations
  • JSON-mode prompts so the model returns name, type, confidence and a fact
  • Sound tab: describe a bird call in words and the model suggests likely birds

Why Does Open Innovation Matter?

  • Works with no signal. Trails don't have bars. After a one-time model download it runs fully offline.
  • Privacy. Photos never leave the device.
  • Free. No API key, no per-call cost, which matters for students.
  • Swappable and tunable. Change one line to try another model, or add local species to the JSON. A closed API can't be tuned to Punjab's trees and birds.

How It Went Outside

Prize Categories

Top comments (1)

Collapse
 
chanveer_singh profile image
chanveer singh •

Built this for the Hacktoberfest Open-Source AI Challenge (Touch Grass week) 🌿
Code is open source: github.com/chanveersinghdev/trailpal
Which Punjab plant or bird should I add next? Drop it below! Pull requests welcome.