DEV Community

Krishna Potdar
Krishna Potdar

Posted on

Touch Grass Nudger: A Local Llama That Tells Me When to Close the Laptop

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

Touch Grass Nudger is a tiny command-line tool that answers one question: what should I do outside right now?

You type how many minutes you have. It reads live weather for Solapur, India, and asks a local AI model for one specific outdoor activity that fits your time, the heat, the UV index and whether it is day or night. Then it prints three lines and says: "Now close the laptop and go!"

The screen part takes under a minute. Everything after that happens outside.

It is for anyone who sits at a laptop all day and loses an hour deciding whether going out is worth it.

Demo

Online run: live weather from Open-Meteo, suggestion from the local model.

Online run: weather fetched, model suggests an activity

Offline run: Wi-Fi off, cached weather, and the local model still answers.

Offline run: no internet, cached weather, local model still answers

Outdoor test: [WRITE YOUR REAL STORY: where you went, what the model suggested, what happened.]

Screen time vs outside time: [X] minutes on screen, [Y] minutes outside.

Code

Touch Grass Nudger

A tiny CLI that tells you what to do outside right now, in under a minute. It reads live weather (Open-Meteo, no API key) and asks a local open-weight model (Llama 3.2 3B via Ollama) for one outdoor activity that fits your free minutes. Works offline using the last cached weather.

Setup

  1. Install Ollama from https://ollama.com
  2. ollama pull llama3.2:3b
  3. pip install -r requirements.txt
  4. python nudge.py

How it works

  • Python decides day or night from sunrise/sunset (small models are bad at this).
  • The model only picks from a list of real local places, so it can't invent any.
  • No internet? It uses the last cached weather. Inference is always local.

Customize

Edit PLACES, the coordinates, or MODEL at the top of nudge.py.




How I Built It

  • Model: Llama 3.2 3B (open weights), run locally with Ollama
  • Weather: Open-Meteo API (free, no API key)
  • Language: Python with just the requests library, about 100 lines

The flow: fetch weather, cache it to a JSON file, summarize the 7 values that matter, build a prompt, send it to the local model, print 3 lines.

What went wrong (and how I fixed it)

Run 1: the model invented a place. It told me to hike the "hill at Chakreshwar Temple", a place I could not find or verify near Solapur. A small 3B model will confidently make up local names.
Fix: I gave it a short list of real places (Siddheshwar Lake, Smruti Van, Bhuikot Fort, Hipparga Lake) and told it to choose only from that list. The invented names stopped.

Run 2: it sent me for a garden walk at midnight. I ran the script at 23:54 and it said "It's dark, making it a safe activity." The model could not reliably tell if it was night.
Fix: I stopped asking the model to decide. Python now compares the clock with sunrise and sunset, and tells the model plainly: it is night, suggest a 5-minute balcony stretch and name a good time tomorrow morning.

Lesson: with small open models, let code handle facts (time, daylight, place lists) and let the model handle the friendly wording.

Why Does Open Innovation Matter?

  • It works with no internet. The model lives on my laptop, so the nudge works on a trail with no signal (using cached weather).
  • My data stays with me. My location and habits never go to someone else's server.
  • It costs nothing to run. No API key, no per-request bill, no rate limit.
  • I could fix its behavior. Because I control the model and the prompt, I could add a places list and day/night rules. I could swap Llama for Qwen or Gemma by changing one line (MODEL = "llama3.2:3b").
  • Failures were visible. When the model hallucinated, I could see why and design around it instead of guessing at a black box.

Top comments (0)