DEV Community

Naushad Alam
Naushad Alam

Posted on

Candela: a local Gemma ofrenda that refuses to invent memories

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

Candela is a private digital ofrenda. You bring a name, foods, songs, and short true stories. Gemma 3 4B, running through Ollama on your machine, writes a remembrance and a list of offerings. A source invent-check rejects drafts that invent details that were never in your notes, then asks the model once more. If the second draft still invents, Candela refuses to light the altar.

The people it is for are the ones whose memories should not become training data.

Demo

Local only, on purpose. With Ollama running and gemma3:4b pulled:

npm start
Enter fullscreen mode Exit fullscreen mode

Open http://127.0.0.1:8790 and load the sample. The altar stays on loopback. History is a gitignored JSON file.

Code

https://github.com/nashdev97/candela

GitHub logo nashdev97 / candela

Local Gemma ofrenda that refuses to invent memories (HF26 Week 4)

Candela

A private digital ofrenda for Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine.

You bring a name, foods, songs, and short true stories. Gemma 3 4B runs through Ollama on localhost, writes a remembrance, and Candela rejects drafts that invent details that were never in your notes.

Why this exists

Family memory is not a chatbot prompt. A hosted model would take the most private text you have. Candela binds to loopback, keeps history in a local JSON file, and treats invention as a bug.

Requirements

  • Node 22+
  • Ollama running locally
  • Model: gemma3:4b (default)
ollama pull gemma3:4b
Enter fullscreen mode Exit fullscreen mode

Run

npm start
Enter fullscreen mode Exit fullscreen mode

Open http://127.0.0.1:8790

Optional env:

  • OLLAMA_HOST (default http://127.0.0.1:11434)
  • OLLAMA_MODEL (default gemma3:4b)
  • PORT (default 8790)

Verify

npm test
npm run smoke
Enter fullscreen mode Exit fullscreen mode

smoke calls the real local model with the sample abuela notes.

Architecture




flowchart LR
browser[Browser on localhost]
api[Node HTTP API]
guard[Source invent-check]
ollama[Ollama]
…





How I Built It

flowchart LR
  browser[Browser on localhost]
  api[Node HTTP API]
  guard[Source invent-check]
  ollama[Ollama]
  gemma[Gemma 3 4B]
  disk[data/history.json]
  browser -->|POST /api/remember| api
  api --> ollama
  ollama --> gemma
  gemma --> api
  api --> guard
  guard --> disk
  api --> browser

Node serves one page and talks to Ollama at 127.0.0.1:11434. The model must return JSON with the remembrance, the exact foods/songs/stories it used, offerings, and a spoken line. Candela checks that those lists are subsets of your notes, that the prose names the person, and that the remembrance touches a concrete fact from the notes. If a draft invents a food or song you never wrote, Candela retries once, then refuses.

Why Does Open Innovation Matter?

An ofrenda is private. A hosted chat API would mean sending the softest facts you have about someone you love to a log you do not control. Gemma's weights are open, Ollama runs them on the laptop, and the server binds to loopback. There is no per-token bill for lighting a candle twice. When the model invents, the invent-check is code you can read, not a privacy policy.

Prize Categories

  • Best Use of Gemma

Top comments (0)