DEV Community

David Nizeyimana
David Nizeyimana

Posted on

Tonight’s Sky: a local Gemma model that tells you when to go outside

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

Tonight's Sky is a small web page that tells you when to step outside and look up. It works out today's sunset time and the moon's phase, then a local AI model turns those numbers into a short, friendly tip, like:

Head out a little before sunset at 18:05. It's a new moon, so the sky will get very dark about an hour after, perfect for stargazing. Bring a flashlight.

It's for anyone who keeps meaning to go outside and watch the sky but never knows when. Open the page, read three sentences, and go.

Demo

Two night-sky photos with stars above the Tonight's Sky app showing sunset 18:05, a 2% moon and the plan

The top of the image is the night sky I photographed, and the bottom is the app on the same night.

Code

🌙 Tonight's Sky

A small web page that tells you when to step outside and look up.

It works out today's sunset time and the moon's phase, then a local AI model (Gemma, running through Ollama) turns those facts into a short, friendly tip:

Head out a little before sunset at 18:05. It's a new moon, so the sky will get very dark about an hour after, perfect for stargazing. Bring a flashlight.

Built for the Hacktoberfest Open-Source AI Challenge Week 1: Touch Grass.

How it works

  1. suncalc calculates sunset, moon phase and moonrise from your coordinates and the clock.
  2. The code turns those numbers into one clear sentence (for example "It is a new moon" or "The moon is 60% full and rises at 20:15").
  3. Gemma (gemma3:1b) writes the tip from that sentence, running locally through Ollama.
  4. Express and EJS show the result on one page.

No…

How I Built It

  • Sky math: suncalc calculates sunset, moon phase and moonrise from my coordinates and the clock.
  • Open-weight AI: Gemma (gemma3:1b) runs locally through Ollama and writes the tip.
  • App: Node.js with Express, EJS templates and Axios to call Ollama.

The flow is: suncalc produces the facts, my code turns them into one clear sentence (for example "The moon is 60% full and rises at 20:15", or "It is a new moon"), and Gemma writes the tip from that.

Two things I learned along the way:

  • A small model needs an example, not rules. My first prompts said things like "never say I" and "don't invent details", and Gemma ignored them. One example tip in the prompt fixed the tone and made it include the sunset time.
  • Check the facts before asking the AI. Early on, it told me to go and see a moon that had set hours earlier. Now my code works out whether the moon is really visible tonight and only gives Gemma true facts.

Why Does Open Innovation Matter?

The whole thing runs on my own computer. With an open-weight model I don't need an API key, an account or a paid plan, and nothing about where I live or when I go outside is sent to a third party. Setup needs the internet once (installing packages, Ollama and the model), and after that the app doesn't call any online service. That suits a project about getting away from screens and connections.

Prize Categories

Best Use of Gemma: every tip on the page is written by Gemma (gemma3:1b), an open-weight model that runs locally on my own computer through Ollama. The app works out the real sunset and moon facts first, and Gemma turns them into a short plan for the reader.

Top comments (0)

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