DEV Community

Tatvagna Tandel
Tatvagna Tandel

Posted on

Ofrenda Local: An Air-Gapped Memory Altar Powered by Open-Source AI published: true tags: devchallenge, hf26challenge, opensource, ai

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 (https://dev.to/challenges/hacktoberfest-week4-2026-10-26
)

What I Built

NecroShell is a haunted command-line companion that breathes an eerie, Victorian spirit into your terminal session. It runs silently in the background, listening to standard input/output hooks in your shell (bash/zsh).

Whenever a command fails, a build breaks, a git merge conflicts, or a midnight debugging session drags on, NecroShell intercepts the event and whispers back chilling, gothic commentary, cryptic riddles, and spectral post-mortem diagnostics directly into your terminal.

I interpreted the theme literally: modern computers have millions of forgotten lines of legacy code, zombie processes, and dead threads. NecroShell embodies that digital afterlife as an actual ghost in the machine, giving a voice to the silicon graveyard.
How I Built It

NecroShell was architected from the ground up around open-source AI and air-gapped local inference:

Local Model: Powered by Llama 3.2 (3B) or SmolLM2 (1.7B) quantized to 4-bit (Q4_K_M), small enough to live in laptop RAM without impacting system performance.
Inference Runtime: Powered by Ollama / llama.cpp, ensuring sub-500ms response latencies with zero external network requests.
Shell Hooks: A lightweight POSIX pre-exec and post-exec trap that captures exit codes, terminal errors, and command duration, feeding them as contextual telemetry to the local agent harness.
The Necromancer Prompt Engine: A deterministic system prompt that forces the LLM into character (a sorrowful spirit trapped in silicon) while strictly preserving technical utility (the error diagnosis must be accurate).
Why Does Open Innovation Matter?

This project simply could not exist using closed, proprietary APIs:

True Lights-Out Offline Execution: In the spirit of Halloween, you can take your laptop into an abandoned cabin in the woods, disconnect Wi-Fi completely, and the ghost still whispers back. No internet ping, no server status page, and no cloud outages.
Zero Moderation False Positives: Gothic horror, macabre humor, and eerie descriptions (graveyard, zombie processes, reaping threads) routinely trip the sanitization filters and guardrails of commercial cloud APIs. Open-weight models let developers set authentic, nuanced creative boundaries.
No Terminal Snooping: Your terminal history often contains secret paths, environmental variables, database names, and internal IP addresses. Piping that data to an external API is a security risk. Local inference guarantees your private shell sessions never leave localhost.
Zero Cost per Token: Having an AI process every command exit status would rack up cloud API bills rapidly. With open weights, it costs nothing to run forever.

Top comments (0)