Field Card:讓我放下螢幕的一頁列印卡
Field Card: a printed page that gets me off the screen
Field Card 是一款以本機模型生成可列印外出卡的網頁應用,讓用戶列印卡片後收起螢幕,按清單外出探索。它透過 Ollama 執行 gemma3:4b,卡片列出攜帶物品、待尋找事物、手機使用規則及回程思考問題;完成設定後毋須網絡、帳戶或 API key,作者在筆電上生成卡片約需 10 秒。
This is a submission for the Hacktoberfest Open-Source AI Challenge Week 1: Touch Grass
What I Built
Going for a walk sounds simple until you are standing outside with no plan and a phone in your hand.
Field Card is a small web app that does the planning part. I type where I am (a city or area), what kind of place it is, how much time I have, and who is coming. A model running on my laptop writes a one-page card: a few things to bring, a checklist of things to find, one rule for the phone, and a question to think about on the way home. Then I print it and close the laptop.
The checklist is the part I like. The items sound like "something that rustles when the wind moves it". They describe color, shape, sound or behavior, never a name, so you don't need to know any plants or birds.
Demo
Code
Field Card
Tell it where you are and how long you have. A local open-weight model writes a one-page, printable outing: what to bring, things to find, and a rule for the phone. Print it, put the screen away, go. Everything runs on your laptop through Ollama: no account, no API key, no internet needed after setup.
Run (Windows)
- Install Python 3.11+ (tick Add python.exe to PATH).
- Install Ollama, then in PowerShell:
ollama pull gemma3:4b - Double-click
run.bat. Your browser opens at http://localhost:5001.
Change it
-
MODELat the top ofapp.py: any model you have pulled with Ollama. -
build_prompt()inapp.py: how the card is written. -
CARD_SCHEMAinapp.py: the sections on the card.
To run it on Windows: install Python and Ollama, run ollama pull gemma3:4b, then double-click run.bat.
How I Built It
I wrote the first version with an AI coding assistant (Claude).
The app is a small Flask server with one page. The page collects the form and sends it to the server, which builds a prompt and calls Ollama's chat endpoint with gemma3:4b.
A few decisions mattered more than the rest.
The answer has a fixed shape. Ollama accepts a JSON schema, so I pass one with six fields: title, intro, bring, notice, phone_rule and on_the_way_back. The page draws the card from those fields, so I never have to parse free text. If the model ever returns something unusable, the page says so and you press the button again.
No species names. The prompt tells the model to describe things by color, sound or behavior. A small model will name a bird or a tree with total confidence and get it wrong. The cards are less impressive this way, and a lot more honest.
The time you pick sets the length. 15 minutes gets 5 things to find and 2 hours gets 10. I also cut the list in code, because the model does not always count correctly.
The date goes in the prompt. The browser sends today's date and the region you typed, so the model has to work out the season on its own.
Printing is just CSS. A print stylesheet hides the form and buttons, switches to black on white, and draws the checkboxes as empty squares. The button opens the normal Windows print window, so you can also save a PDF for your phone. On my laptop, writing a card took about 10 SECONDS.
Why Does Open Innovation Matter?
The point of this app is that you use it right before you leave the house. With a hosted API, that moment would depend on a connection. With a local model, I only need the internet once, to download the model. After that it works with no connection at all.
It is also free to run. Since there is no bill, you can press the button again until the card sounds right.
The location stays on the laptop too. The app only asks for a city, the day and the kind of place. That is not much, but it is where I go for walks, and I would rather not send it to a server for a checklist.
And I could change things a closed API would not have let me. The model is one line in app.py, and the card's sections are a schema I wrote myself.
A bigger hosted model would write better. The cards from a 4B model are fine, but plain.
How the Walk Went
I printed a card for a 30-minute walk, put the phone in my bag, and
went to the park near my house. The card had six things to find.
I ticked four. "Something that rustles when the wind moves it" was
easy, because there was a whole row of trees doing it. "A sound that
repeats" took me a while, and I ended up ticking it for a bird I never
saw. I skipped "something smaller than your thumbnail that is moving"
because I got tired of staring at the ground. The "on the way back"
question was "What did you walk past today without noticing?" and I
thought about it for most of the way home.
What was wrong: the card told me to bring a warm layer, and it was
warm out. It also had no idea the path was crowded, so one item was
basically "find a quiet spot". That is a limit of a card written
without seeing the place.
I did take my phone out once, to take a photo of the card with my
pen ticks on it. That is the photo at the top of this post.
The screen part took about 2 minutes. The walk took 40.
來源:DEV Community · dev.to