DEV Community

Sakeena Patel
Sakeena Patel

Posted on Edited on

DeadLock: The Ghost in the Local Machine ๐ŸŽƒ๐Ÿ‘ป

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

Imagine youโ€™re locked in a server room after hours. The lights are dead. The terminals are humming. But the monster haunting the dark isn't a zombie or a vampire it's a silent, insidious AI engineering bug.

DeadLock is a local, browser based puzzle game where your weapons are debugging skills and your enemies are real-world AI failures.

  • Across 5 eerie levels and 10 distinct challenges, you inspect a AI engineering challenges edit it right in your browser, and hit Compile and attack.
  • Treat ๐Ÿซ: Your code passes the assertions. You survive.
  • Trick: Your code fails. No points, no escape, try again.
  • A flawless run nets you 50 points. Need help? You can summon the ghost in the machine for a hintโ€”powered entirely by a local open-weight modelโ€”at the steep cost of 5 points per clue. Two hints max for the whole game. Choose wisely.

Demo

Code

DeadLock

DeadLock is a local, browser-based game for practicing AI-engineering tasks. Players repair short Python functions covering prompts, sampling settings, context limits, retrieval, and evaluation. The puzzles run entirely on the machine. Hints, when used, are generated by a local model through Ollama.

How to play

The game has five levels, and each level has two challenges. A challenge is a broken function. Edit the code and choose Compile and attack.

  • A correct fix is a Treat. Clearing both challenges in a level awards 10 points.
  • An incorrect fix is a Trick. The score does not change, and the challenge stays open.
  • A perfect run with no hints, is 50 points.

The player has two hints for the whole game. Each hint costs 5 points and requests a short clue from the local model. The game remains playable if Ollama is not running; the hint then reportsโ€ฆ

How I Built It

  • The core gameplay loop is completely offline-first. To ensure the game stays snappy and playable even if your local LLM server is offline, the puzzle verification doesn't use an AI model at all. Every player fix is instantly validated via deterministic Python assertions running locally on the machine.
  • The open-source AI piece is reserved for the atmosphere. When you burn a hint, dungeon/dm.py sends a minimalist prompt directly to a local Ollama
  • It explicitly ignores proxy settings to ensure local routing stays local.
  • It optimizes for gemma2:2b if installed, handling cold starts gracefully.
  • It asks the model strictly for a clue, never the raw solution.
  • The frontend uses Streamlit to create a seamless, retro-arcade coding experience right in your browser.

Why Does Open Innovation Matter?

  • When you play DeadLock, you are writing snippets of real AI systems: prompt architecture, sampling parameters, retrieval strategies.
  • If this were built on a commercial chat API, every keystroke and hint request would siphon your code off to someone else's servers, running up a token bill while leaking code architecture.
  • A local, open-weight model flips the script:
  • Absolute Privacy: Your code never leaves your hardware.
  • Zero Marginal Cost: Hints cost game points, not API dollars.
  • Unfiltered Tone: The Halloween flavor and system prompt live locally, untouched by corporate safety filters or external policy classifiers.
  • Resilience: If Ollama drops connection, the puzzles still work. The ghost is optional. The engineering is absolute.

The Spirit of It

  • The magic of DeadLock lives in the space right beneath the code editor. When you click attack, the machine responds instantly with either a Treat ๐Ÿซ or a Trick.
  • There are no long-winded paragraphs explaining the bug above the code. You read the syntax, you spot the flaw, you fix the logic, and the machine either opens the door or locks you out. Pure logic meets midnight atmosphere.

Prize Categories

  1. Best Use of Gemma
  • Used Gemma as hint powered entirely by a local open weight model.

2.Best Use of ElevenLabs

  • It was used for recording voiceover for demo.

Top comments (0)