DEV Community

Lakshya Mulchandani
Lakshya Mulchandani

Posted on AI-assisted

🎃 Ghost in the Machine: Offline Spirit Nexus & Virtual Ofrenda 🏵️

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

Between the eerie chill of Halloween (October 31) and the sacred remembrance of Día de los Muertos (November 1 & 2), the veil between past and present, human memory and computational legacy, grows whisper-thin.

I built Ghost in the Machine: The Offline Spirit Nexus & Virtual Ofrenda — a local, privacy-first AI application powered completely offline by open-weight models via Ollama. It fuses retro-gothic cyberpunk aesthetics with traditional Day of the Dead celebration across four interactive experiences:

  1. 📟 The Haunted Terminal ("Possessed Shell"):
    A retro CRT phosphor terminal where an open-weight model possesses the user's shell. Type terminal commands like whoami, ls /graveyard, cat /dev/soul, ps aux --paranormal, or whisper freeform inquiries into the dark. The local model responds in real-time streaming tokens with eerie, gothic wit and ASCII glitch runes.

  2. 🔮 The Digital Séance ("Echoes of Computing Past"):
    Channel the digital souls of computing pioneers across time:

  • Ada Lovelace (1815–1852): The Prophetess of the Analytical Engine

  • Alan Turing (1912–1954): Architect of Computation & Cryptanalysis
    The Ghost of COBOL (Born 1959): The Ancient Enterprise Wraith of Legacy Banking Mainframes

  • The Ancient UNIX Daemon (PID 1): Primordial Swapper of the Bell Labs Root Tree

  • Custom Ancestral Spirits: Invoke any departed mentor, coder, or family thinker. Includes interactive séance candles that adjust spiritual receptivity and an animated canvas EVP frequency oscilloscope synced to token generation.

  1. 🏵️ The Virtual Ofrenda ("Altar de Recuerdos" — Día de los Muertos):
    A glowing candlelit altar adorned with cempasúchil (marigolds), papel picado, pan de muerto, calaveras de azúcar (sugar skulls), and veladoras. Users dedicate an offering for departed loved ones, and local open AI crafts heartfelt poetic remembrances, traditional calaveritas literarias (festive Mexican verses in Spanish, English, or Bilingual), and oral history chronicles. Features local heirloom JSON export and printable memorial cards.

  2. 📜 The Nocturnal Anomaly Weaver:
    Feeds real machine hardware telemetry (CPU loads, uptime, witching-hour midnight clock, memory specters, and ghost anomaly codes like EVP-404) into the local model to weave bespoke nocturnal horror stories with dynamic, interactive choose-your-own-path story branching.

  3. 🎵 Procedural Halloween Web Audio Synthesizer:
    Built entirely with the native HTML5 Web Audio API (zero external audio files or downloads). Generates real-time binaural sub-bass drones, sweeping wind oscillations, EVP keystroke chirps, and resonant cathedral bell tolls.

Demo

Here is a glimpse of the application:

  • The Haunted Terminal & Sensor Diagnostics: Interactive green phosphor CRT screen with real-time streaming possessed commentary from gemma3:4b.

  • The Digital Séance: Channeled dialogue with Ada Lovelace discussing computational consciousness while the EVP spectrogram visualizes the inference frequencies.

  • The Sacred Ofrenda: Glowing altar with flickering candlelight and marigold petals, displaying an AI-woven bilingual calaverita literaria honoring beloved ancestors.

  • Air-Gapped Telemetry: Real-time hardware vital badges showing zero cloud leaks and offline resilience.

Demo Video:

Code

Github Repo: https://github.com/LakshyaMulchandani/Ghost-in-the-Machine.git

How I Built It

At the heart of the project is local inference with open-weight models executed via Ollama:

  • Model Flexibility: The application natively integrates and dynamically detects installed local models:
    • gemma3:4b: Lightning-fast, lightweight responses with high linguistic nuance for terminal banter and quick séance answers.
    • llama3.1:latest: Deep narrative depth and rich cultural empathy for crafting sacred Día de los Muertos ofrenda tributes and poetic verses.
    • qwen2.5-coder:7b: Perfect for terminal-style command processing, system scripting, and structural code reviews.
  • Real-Time Streaming: The backend taps into Ollama's /api/generate and /api/chat endpoints using chunked Server-Sent Events (SSE). Each generated token is immediately dispatched to the browser, updating the DOM and triggering micro-acoustic EVP clicks in the audio synthesizer for an eerie typewriter sensation.
  • Hardware Telemetry Injection: Node's os module samples system uptime, memory footprints, and CPU cores, calculating a "witching resonance index" based on the current local time relative to 3:00 AM. This seed data is dynamically supplied to the model to generate personalized nocturnal tales.

Why Does Open Innovation Matter?

Día de los Muertos is deeply sacred. When families honor their ancestors, privacy and permanence are paramount. Here is why an open-based approach worked fundamentally better than closed APIs for this project:

  1. Air-Gapped Privacy for Sacred Memories
    In the Virtual Ofrenda, people pour out private reflections, unvarnished grief, family stories, and names of their departed loved ones.

    • The Closed API Problem: Sending these vulnerable memories to a commercial cloud API means your family's personal reflections are sent over the wire, subject to corporate terms of service, potentially indexed, or retained on servers you do not control.
    • The Open Advantage: Running open weights locally through Ollama ensures 100% of the inference takes place in local RAM. Not a single packet crosses the internet. Private family memories remain strictly private and sacred.
  2. Works with the Lights (and the Internet) Off
    True digital independence means your creations do not become inert paperweights when the connection drops.

    • The Closed API Problem: A stormy Halloween night with power disruptions or a remote candlelit cemetery without Wi-Fi leaves cloud-dependent apps broken.
    • The Open Advantage: Ghost in the Machine operates completely air-gapped on a laptop. Disconnect the Wi-Fi, unplug Ethernet, and the spirit in the machine responds just as promptly.
  3. Model Sovereignty & Zero Censorship Drift

    • With open models, you have complete authority over system instructions, temperature, and cultural context. You don't have to worry about a closed vendor silently modifying guardrails, altering output tone, or deprecating a model endpoint overnight.
    • Users can hot-swap between models (gemma3:4b, llama3.1, qwen2.5-coder) or plug in their own specialized GGUFs with a single click.
  4. Zero API Fees & Infinite Longevity
    Preserving memories and creative storytelling shouldn't incur metered token charges or shut down when a developer runs out of cloud credits. Open weights belong to humanity. The models running on our machines today will still run decades from now, keeping the remembrance alive indefinitely.

The Spirit of It

During testing, I loaded a dedication in the Virtual Ofrenda for an abuela who passed away, listing her favorite things: orange groves, bolero songs, and sweet pan de muerto.

With the room lights switched off and the ambient drone softly humming through the speakers, watching the local model stream a traditional bilingual calaverita literaria — completely offline, on an air-gapped laptop, with candles flickering across the screen — was truly evocative.

It demonstrated that open-source AI isn't just about technical independence or benchmarks; it's about holding the tools to preserve our memories, our culture, and our stories without asking anyone for permission.

Prize Categories

  • Gemma: Built utilizing Google's open-weight Gemma 3 model for local, multimodal inference.

  • Hacktoberfest Open-Source AI Challenge Week 4 (Ghost in the machine): Overall Challenge Category.

Top comments (0)