DEV Community

Kavya Saraswat
Kavya Saraswat

Posted on

Spiritus πŸ•―οΈπŸŒΌ: An Air-Gapped Virtual Ofrenda & Remembrance Sanctuary Powered by Local Gemma 3

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

In Mexican tradition, DΓ­a de los Muertos (November 1 & 2) reminds us that β€œthe dead are never truly gone as long as they are remembered.” Families assemble ofrendas (altars) adorned with marigolds (cempasΓΊchil), flickering candles (veladoras), sweet pan de muerto, copal incense, and personal keepsakes to welcome spirits back to the earthly plane.

For the Ghost in the Machine theme, I built Spiritus: an open-source, air-gapped, privacy-first virtual ofrenda builder and remembrance writer powered by open-weight AI (Gemma 3 via Ollama).

                      πŸ•―οΈ   🌼   πŸ•―οΈ
               β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
               β”‚    S P I R I T U S        β”‚
               β”‚   Virtual Ofrenda Altar   β”‚
               β”‚      & Memory Vault       β”‚
               β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                             β”‚
     Local Open-Weights      β–Ό      Real-Time SSE
      (Gemma 3 / Ollama) ─────────► Token Streaming
                             β–²      + Web Speech TTS
                             β”‚
               β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
               β”‚  Zero Telemetry Β· 100%    β”‚
               β”‚  Air-Gapped & Offline     β”‚
               β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
Enter fullscreen mode Exit fullscreen mode

Key Highlights:

  • πŸ•―οΈ Interactive Living Altar: Dynamically arrange traditional offerings (candles, marigold petals, pan de muerto, mezcal, family photos, and handwritten mementos) with a live canvas particle simulation that scatters golden petals across the screen.
  • πŸͺΆ Tuned Remembrance Generator: Feeds offering details, beloved nicknames, milestones, and quirks into Google Gemma 3 to compose authentic eulogies and poems across 4 distinct cultural tones (Poetic, Celebratory / Β‘Que viva el recuerdo!, Solemn, and Storyteller).
  • ⚑ Real-Time Token Streaming: Server-Sent Events (SSE) stream the AI's words character-by-character, capturing the solemnity of a handwritten letter unfolding before your eyes.
  • πŸ”Š Recite Aloud (Speech Synthesis): Built-in atmospheric narration reads the remembrance aloud with reverent pacing.
  • πŸ’¬ Multi-Turn Spirit Chat: Converse with the remembrance model afterwardsβ€”ask it to translate the tribute into Spanish, add a verse about their favorite vinyl record, or reminisce about a shared recipe.
  • πŸ’Ύ Local File Persistence & Export: Saves full altar records to data/ofrendas.json and exports mementos as .txt files with zero cloud dependencies.
  • πŸ›‘οΈ Zero-Config Demo Mode: For visitors without a local Ollama instance running, a built-in fallback mode generates complete poetic tributes so anyone can test the interface instantly.

Demo

Spiritus Hero Banner

Quick 30-Second Local Run:

# 1. Clone the repository
git clone https://github.com/KavyaSaraswat23/Hactober_week4.git
cd Hactober_week4

# 2. Install lightweight dependencies (Express, CORS, Node-Fetch)
npm install

# 3. Start the application
npm start
# -> Visit http://localhost:3000
Enter fullscreen mode Exit fullscreen mode

(If Ollama is running with gemma3:4b or gemma3:1b, it connects automatically. If not, toggle Demo Mode with one click to test the entire interactive flow!)


Code

πŸ’€ Spiritus β€” Virtual Ofrenda Builder & Remembrance Generator

License: MIT Node.js Ollama Gemma 3 Hacktoberfest 2026

β€œThe dead are never truly gone as long as they are remembered.”


Spiritus Hero Image


πŸ“– About Spiritus

Spiritus is an open-source, privacy-first virtual ofrenda (altar) builder and remembrance writer inspired by the rich cultural tradition of DΓ­a de los Muertos (Day of the Dead) and built for the Hacktoberfest 2026: Ghost in the Machine challenge.

In a digital age where memories are routinely scraped, monetized, and trapped behind paid cloud subscriptions, Spiritus takes the opposite stance: your most sacred memories belong to you alone. Powered by open-weights local AI (Gemma, Mistral, LLaMA) via Ollama, all token generation happens directly on your machine. Zero telemetry. Zero external API keys. Zero cloud fees.


✨ Features

  • πŸ•―οΈ Interactive Digital Ofrenda: Place marigold petals (cempasΓΊchil), light candles, offer pan de muerto, copal incense, and favorite foods while seeing the live altar update…

The core stack is purposely lean and inspectable:

  • Frontend: Vanilla HTML5, CSS3 with gothic-warm glassmorphism, floating canvas particle emitters, and native Web APIs (Fetch, SSE EventSource, Web Speech API).
  • Backend: Node.js & Express proxying requests to Ollama's native endpoint (http://localhost:11434/api/generate).
  • Storage: Local filesystem JSON storage (data/ofrendas.json).

How I Built It

1. The Open-Weight Core: Google Gemma 3 via Ollama

The brain of Spiritus runs on Google Gemma 3 (gemma3:4b or gemma3:1b). Gemma's literary nuance and multilingual understanding make it particularly suited for the lyrical, respectful register required for DΓ­a de los Muertos tributes.

The Node.js backend streams output from Ollama straight to the client via Server-Sent Events (SSE):

// server.js - Real-time streaming from local Ollama
app.post('/api/generate', async (req, res) => {
  const { model = 'gemma3:4b', prompt, context = [] } = req.body;

  res.setHeader('Content-Type', 'text/event-stream');
  res.setHeader('Cache-Control', 'no-cache');
  res.setHeader('Connection', 'keep-alive');

  const ollamaRes = await fetch(`${OLLAMA_BASE}/api/generate`, {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({ model, prompt, context, stream: true }),
  });

  ollamaRes.body.on('data', chunk => {
    const lines = chunk.toString().split('\n').filter(Boolean);
    for (const line of lines) {
      try {
        const parsed = JSON.parse(line);
        res.write(`data: ${JSON.stringify({ token: parsed.response, done: parsed.done })}\n\n`);
      } catch {}
    }
  });

  ollamaRes.body.on('end', () => res.end());
});
Enter fullscreen mode Exit fullscreen mode

2. Tone Architecture

Rather than generic praise, Spiritus injects cultural context into the system prompt based on user-selected tone:

  • Poetic: Focuses on natural metaphors, cempasΓΊchil petals, evening breezes, and eternal light.
  • Celebratory: Focuses on laughter, music, festive memories, and the joy of a life fully lived ("No llores por mΓ­...").
  • Solemn: Traditional, reverent prayers and dignified gratitude.
  • Storyteller: Weaves specific remembered anecdotes (favorite meals, funny quirks, treasured advice) into a cohesive biographical narrative.

Why Does Open Innovation Matter?

When we build AI applications around grief, heritage, and family remembrance, the question of who owns the infrastructure is not an academic debateβ€”it is an ethical boundary.

1. Sacred Memories Must Never Be Scraped

Commercial cloud LLM APIs train on user inputs or log transcripts on remote servers. Grief is not training data. By running Gemma 3 locally on your laptop, what you write about your grandmother, your departed mentor, or your childhood friend never leaves your device. Not a single packet crosses the open internet.

2. Permanence Beyond Corporate Lifecycles

Closed APIs deprecate endpoints, change terms of service, raise token prices, or shut down entirely. A local open-weight model (.gguf) will run on your hardware 5, 10, or 20 years from now. As long as your machine powers on, your ofrenda remains accessible.

3. Air-Gapped & Accessible Everywhere

Whether you are sitting in a rural cemetery with no cellular signal, an off-grid cabin, or an area with expensive bandwidth, open-source AI runs entirely offline.


The Spirit of It

During testing, I set up an ofrenda for my grandfather, listing his signature wool cardigan, black cardamom chai, and the old brass transistor radio he listened to every morning.

When local Gemma streamed the closing lines:

β€œLet the scent of roasted cardamom lead you back through the mist tonight. Your chair by the radio is not empty; it is simply waiting for your song to finish.”

The room went completely still. It wasn't a sterile corporate autocomplete; it was a deeply personal, comforting echo. That moment captured the entire essence of the Ghost in the Machine: using open silicon and weights to rekindle the human warmth that technology so often forgets.


Prize Categories

  • Featured Category: Best Use of Gemma ($200)
    • Spiritus is built specifically around Google Gemma 3 (gemma3:4b / gemma3:1b) running through Ollama. Gemma's tone control, cultural empathy, and lightweight footprint enable zero-telemetry, on-device remembrance generation with low latency on everyday consumer hardware.

Author: Kavya Saraswat (@KavyaSaraswat23)

Top comments (0)