DEV Community

Cover image for Last Light : a printed walk card written by a model on my own computer
Oitrika Bhattacharjee
Oitrika Bhattacharjee

Posted on

Last Light : a printed walk card written by a model on my own computer

What I built

Last Light prints a one page card for a walk. I type in where I am and how long I want to walk. Ordinary code works out when the sun sets, when I should turn around and when I should be home. A Gemma model running on my own computer writes the small part: three things to notice and one small task. I print the card and leave my phone at home.

The screen is the shortest part. Making the card takes a minute or two and then I put the computer away.

The puzzle

I wanted a reason to come back tomorrow. Every card has a quest, which is its small task. When I get home I run one command and collect a puzzle piece. There are twelve pieces and together they make a small picture of a cabin on a hill with a tree and a low sun. You get one piece a day and it runs on the honor system. A progress picture shows which squares are still covered. When the last piece is in the finished picture is saved and appears on every card after that. Then a new puzzle starts. Progress lives in a small file on my computer. I collected my first piece after this walk.

I can also type rough notes after a walk and the model turns them into a short journal entry that stays in a file on my computer.

How the walk went

I took the card to the lake. It asked me to look for sunlight through the leaves, birdsong in the branches and reflections on the water.

It was calm and soothing. Birds were chirping. People were walking by and there was a breeze in the trees. The wind was cold on my warm cheeks. I saw a kingfisher on the lake and some swans. The card did not mention either of them. It got me outside and slowed me down and I found those myself. That is what I wanted from it.

Why open weights mattered

Where I walk and when tells you when my house is empty. I did not want to send that to someone else's server. Gemma runs through Ollama on my own computer so my location and my notes stay here. After the first download, which is around 3 GB, it needs no internet. The code only talks to my own machine and refuses anything else unless I add a flag. I can switch to another model with one flag and every card costs nothing.

I did not compare it with a closed model so I cannot say which writes better. The small model I used is a little bland.

How it works

Sunset comes from a standard formula in plain Python and unit tests check it against two known sunsets. The model is asked for structured output. The code checks its shape and length and everything is escaped before it goes into the page, so a strange answer cannot break the card. If the model is not running I get a plain built in card and the footer says no model was used.

I can use my own photo as the card background. It is embedded in the file and hidden data such as location is removed first. There are 20 tests and no packages beyond Python itself.

What does not work well

The suggestions are general. The sunset time is an estimate and does not know about hills or buildings. The puzzle trusts me to do the task. I only ran it with a real model on Windows.

Demo and code

demo

puzzle

Code: https://github.com/OitrikaBhattacharjee/last-light

Photo credit: @oitreeka

Prize Categories

Best Use of Gemma. I used gemma3:4b locally through Ollama.

How I made it

I used Claude as my coding assistent to check if my code is working correctly. The puzzle idea, the look of the card and my lake photos are mine and I ran and tested everything on my own computer.

Top comments (0)

Some comments may only be visible to logged-in visitors. Sign in to view all comments. Some comments have been hidden by the post's author - find out more