跳到正文
DEV Community· Laiba Ashfaq·· 21 天前AI 評分47

Ofrenda:私隱離線追思撰寫工具

Ofrenda: A Private, Offline Remembrance Writer for Día de los Muertos

AI 導讀

Ofrenda 是一款為亡者撰寫追思文字的本機離線應用程式,會透過逐一提問協助用戶整理回憶,再根據用戶提供的資料撰寫追思文字及祭壇物品清單。它使用透過 Ollama 本機執行的開放權重模型,資料以 Markdown 和 JSON 儲存在裝置上,毋須雲端、帳戶或遙測。

正文

Laiba Ashfaq

Hacktoberfest Open-Source AI Challenge: Ghost in the Machine Submission 👻🌼

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine

What I Built

Ofrenda is a local app for writing a remembrance of someone who has died, built for Día de los Muertos.

You enter their name, favorite foods and songs, and then share memories. If you get stuck, the model acts as a gentle oral-history interviewer and asks one question at a time, like "What did their kitchen smell like on a Sunday?" When you're ready, it writes a short remembrance addressed to them, plus a "For the ofrenda" list of items to place on the altar, drawn from the foods, songs and objects you mentioned.

For the theme, I read "ghost in the machine" as the memory of a person, kept alive by the stories we tell. I deliberately did not make the model speak as the dead. It only interviews and writes down, and it is instructed to use only the facts you give it and never invent details about a real person.

Demo

Code

A local, offline tool for writing a remembrance of someone you've lost, in the spirit of Día de los Muertos Open-weight model (via Ollama), Python standard library only, no cloud, no accounts, no telemetry.

Run

ollama pull llama3.2        # or any model: OFRENDA_MODEL=gemma3:4b python3 ofrenda.py
python3 ofrenda.py          # open http://127.0.0.1:8731

Pull the plug on your Wi-Fi afterwards. It still works.

Remembrances are saved as .md + .json in ./ofrenda_data/.


This is a submission for the Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine image

What I Built

Ofrenda is a local app for writing a remembrance of someone who has died. You enter their name, favorite foods and songs, then share memories. If you get stuck, the model acts as a gentle oral-history interviewer and asks one question at a time ("What did their kitchen smell like on a Sunday?"). It then writes a short remembrance addressed to…

To run it yourself:

ollama pull llama3.2
python3 ofrenda.py
# open http://127.0.0.1:8731

How I Built It

  • Model: any open-weight model served locally by Ollama. The default is llama3.2, and you can swap it with OFRENDA_MODEL=gemma3:4b python3 ofrenda.py.
  • App: a single Python file of about 150 lines. It has a built-in HTTP server and an inline web UI, with zero dependencies (standard library only).
  • Two small system prompts do the work:
    • Interviewer: ask exactly one short sensory question, don't repeat topics, don't invent facts.
    • Writer: use only the provided facts, write three short paragraphs, and keep it short rather than padding when details are thin.
  • Storage: each remembrance is saved as plain Markdown and JSON on disk, so it stays readable decades from now without my software.

Why Does Open Innovation Matter?

Stories about someone who has died are among the most private things a person owns. With a closed API, every one of those memories would travel to a server I don't control, under terms that can change.

Running an open-weight model locally gave me things a hosted API couldn't:

  • Privacy by default. Nothing leaves the machine. There are no accounts and no telemetry.
  • Works with the lights (and the internet) off. After the one-time model download, you can unplug the Wi-Fi.
  • Costs nothing per remembrance. There are no tokens to meter, which matters for something people may come back to year after year.
  • Can't be shut down or deprecated. A memorial shouldn't disappear because a service sunsets a model or a pricing tier.
  • Swappable and tunable. I can try a smaller model for older laptops, or a model that writes better in Spanish, and I can change the interviewer's tone by editing a prompt.

Prize Categories

  • Best Use of Tinker
  • Best Use of Gemma
  • Best Use of Backboard
  • Best Use of ElevenLabs
  • Best Use of GitHub Copilot
  • Best Use of MongoDB Atlas

來源:DEV Community · dev.to