This is a submission for the Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine
What I Built
I built Ghost in the Code, a small local AI tool that gives old, confusing, or problematic code a spooky explanation.
You paste a piece of code and summon the Ghost. It analyzes the code and responds with:
- 👻 Ghost's Whisper — what the code is doing
- 🔍 What Haunts This Code — the main problem or confusing part
- 🛠️ Exorcism — a suggested improvement
- ✨ Final Spirit — a short takeaway
I interpreted the Ghost in the Machine theme by imagining that old and confusing code can feel like a ghost that continues to haunt a project.
Demo
Here is a short video showing the application running locally and analyzing a piece of code:
Code
The complete source code is available on GitHub:
https://github.com/SachinNarayanasamy/ghost-in-the-code
How I Built It
The project is built with:
- Python
- Streamlit
- Ollama
- Gemma 3 1B
The application runs Gemma 3 1B locally through Ollama.
When code is submitted, the application sends it to the local Ollama instance with a prompt that asks Gemma to analyze the code using the four Ghost sections.
The AI processing happens locally on my machine instead of using a hosted AI API.
Why Does Open Innovation Matter?
For a tool that analyzes source code, keeping the data local can be important.
Using an open-weight model locally means I can experiment with AI without sending code to an external hosted API.
It also gives me the freedom to change the model, improve the prompt, and modify the application as the project evolves without being tightly locked to a single closed AI service.
The Spirit of It
Sometimes old code feels like a ghost.
You may not know who wrote it, why it exists, or why changing one line suddenly breaks something somewhere else.
So I decided to make that feeling part of the experience — instead of fighting the ghost, let the ghost explain itself. 👻
Prize Categories
- Best Use of Gemma
Top comments (0)