This is a submission for the Hacktoberfest Open-Source AI Challenge Week 1: Touch Grass
What I Built
Every October the same thing happens: you look up from the screen and the light is already gone. In Dubuque, Iowa, the days are getting almost three minutes shorter every day right now, and "I'll go for a walk later" quietly turns into "tomorrow."
Daylight Left is a small command-line tool that answers one question: how much light do I have, and which of my places still fits?
You keep a plain-text list of spots you actually like (a trail loop, the community garden, an overlook) with how far away each one is and how long you want there. Daylight Left works out today's sunset for where you are, keeps a 15-minute buffer so you're back before it's properly dark, picks the spot that fits, and tells you when to leave. A local open-weight model writes one friendly line at the bottom. Then the card says to close the laptop.
It's for anyone who means to get outside after work and keeps missing the window. The screen part takes about three seconds, and the rest happens outside.
Demo
Real output (8-CPU Linux machine, no GPU, --now pinned so it's reproducible). It's 6:05 PM in Dubuque, Iowa, on October 5:
$ daylight-left --lat 42.50 --lon -90.66 --tz America/Chicago --spots spots.txt --model gemma-3-1b-it-Q4_K_M.gguf
DAYLIGHT LEFT Mon Oct 05 (America/Chicago)
sunrise 07:04 AM sunset 06:36 PM
you have 16 min of usable light (back 15 min before sunset)
GO: Block loop (0 min away, 15 min there)
stretch your legs before dinner
leave by 06:06 PM
Hey, it's getting late – let's go for a walk. We'll be at the Block Loop by 06:06 PM.
At 4:30 PM the same day it has 111 minutes to work with, so it sends you to the trail:
you have 111 min of usable light (back 15 min before sunset)
GO: Riverside trail loop (10 min away, 45 min there)
walk the loop and watch the maples turn
leave by 05:16 PM
also fits: Community garden plot (40 min total)
also fits: Bluff overlook (70 min total)
Close the laptop. The rest of this happens outside.
That last line is the fallback, and there's a story behind it (see below).
Code
Source code, MIT-licensed and hosted on Hugging Face: maddiebrooks208/daylight-left
Zero required dependencies for the core tool. pip install -e ".[llm]" adds llama-cpp-python for the model. 27 tests.
How I Built It
The facts come from plain Python. Sunrise and sunset come from the NOAA Solar Calculator equations (after Meeus, Astronomical Algorithms), in about 75 lines of standard-library Python. My first version used NOAA's shorter "general solar position" formulas, and the tests caught it running up to about four minutes off around the equinoxes at high latitudes. Re-evaluating the sun's position at the moment of the event, using the fuller spreadsheet equations, brought it to within two minutes of the independent astral library for Dubuque, Seattle, Quito, Sydney and Oslo on both solstices, both equinoxes, and October 5.
The model only does the wording. I run Gemma 3 1B instruction-tuned as a 4-bit GGUF (806 MB) through llama.cpp and llama-cpp-python, on CPU. It gets a short paragraph of facts that are already computed (sunset, minutes left, spot, leave-by time) and is asked for two warm sentences. Load takes about 1 s and generation about 2 s for roughly 30 to 40 tokens.
The guard. The first time I ran it, Gemma said the trail was a great idea and that we'd "be at Riverside trail loop by 10:00 AM." At 4:30 PM. Later, after sunset, it suggested leaving "around 8 AM tomorrow," a time it made up.
A card that tells you the wrong time to leave is worse than no card at all, so every response now goes through a small check: pull every clock time out of the model's text, and if any of them isn't in the facts it was given, throw the text away and print the fixed line instead. In my three demo runs, the guard rejected two of Gemma's three outputs. Both rejected lines are kept in the repo's log on purpose.
I also tried SmolLM2-360M first. It never invented anything, but it just read the facts back word for word, which isn't much of a nudge. Gemma 3 1B is the smallest model I found that sounds like a person, and the guard covers the cost of that.
Why Does Open Innovation Matter?
- It works where you're going. After the one-time model download it needs no internet. Sunset maths doesn't need a server, and neither does a two-line pep talk.
- Your places stay yours. Your list of where you walk, garden and sit is a map of your routine. It never leaves your machine.
- I could look inside and fix it. Because the model runs locally with fixed settings, I could rerun the same prompt, see exactly when it invented a time, and build a guard around that behavior. Swapping SmolLM2 for Gemma was one file path.
- It costs nothing to run, every day, forever.
Where a closed API would honestly have been better: a big hosted model would probably have written nicer lines and invented fewer times. But that would mean sending your location and routine to someone else every afternoon so they can tell you to go outside, which is backwards for a tool that's meant to get you off the screen.
Prize Categories
- Best Use of Gemma: Gemma 3 1B instruction-tuned, running locally through llama.cpp, writes the nudge, with a guard against invented times.
Built with AI coding assistance. Every number above comes from the logs in the repo. Credits: Gemma 3 (Google, Gemma Terms of Use), GGUF from ggml-org, llama.cpp and llama-cpp-python (MIT), astral (Apache-2.0) as the test oracle, SmolLM2 (Hugging Face, Apache-2.0), and the NOAA Global Monitoring Laboratory solar calculator.
Top comments (0)