👻 Ghost in the Machine
What if the machine in your room could tell you a ghost story without sending your prompt to a hosted AI API?
This is my submission for the Hacktoberfest Open-Source AI Challenge — Week 4: Ghost in the Machine.
What I Built
Ghost in the Machine is a local AI-powered ghost story generator. Users enter a prompt and the application generates a spooky story using the Gemma 3 1B model through Ollama.
I built this project to explore how open-weight AI models can power creative applications on a local machine.
The project combines a React and TypeScript frontend with an Express backend and local AI inference.
Demo
GitHub repository:
https://github.com/abhishekkumarsahu1234567-rgb/ghost-in-the-machine
Live Demo:
https://frontend-puce-chi-10.vercel.app
The project is deployed with a React and TypeScript frontend on Vercel and an Express backend on Render. It uses the Groq API for hosted AI story generation, allowing users to generate spooky stories from their own prompts.
A publicly hosted demo is not available yet. The project is intended to run locally.
To try it:
ollama pull gemma3:1b
- Start Ollama and keep it running.
- Open a terminal in the
backenddirectory, install dependencies withnpm install, and start the server usingnode server.js. - Open another terminal in the
frontenddirectory, runnpm install, and then runnpm run dev. - Open the local URL printed by Vite and enter a spooky prompt.
The frontend and backend must both be running for story generation to work.
Code
Explore the complete project source code:
View Ghost in the Machine on GitHub
The repository contains the frontend, backend, and project configuration.
How I Built It
The project uses:
- React + TypeScript + Vite: For the interactive user interface.
- Node.js + Express: For the story-generation API.
- Ollama: To run the language model locally.
- Gemma 3 1B: The open-weight model used for generating stories.
When a user submits a prompt, the frontend sends a request to the backend. The backend communicates with the locally running Ollama model and returns the generated story to the frontend.
Why Does Open Innovation Matter?
Open-weight models make it possible for developers to experiment with AI without depending entirely on a hosted model API.
For a project like this, local inference offers several advantages:
- More control: Developers can choose and run a model on their own machine.
- Experimentation: It is easier to explore prompts, model behaviour, and creative use cases.
- Reduced API dependency: Story generation can work without a paid hosted-model API, provided the local model and required resources are available.
- Privacy potential: Prompts can remain on the local machine when the application is configured without external services.
Local inference still requires suitable hardware and consumes system resources. Privacy also depends on the complete application configuration.
The Spirit of It 👻
The theme Ghost in the Machine 👻 inspired me to build something that feels playful and slightly mysterious while experimenting with AI-powered storytelling.
I wanted to turn AI-powered storytelling into a small creative experience where users can enter their own ideas and generate atmospheric spooky stories.
This project is an exploration of local AI, full-stack development, and the possibilities of open technology.
What's Next?
Some improvements I would like to explore include:
- Story length and horror-intensity controls.
- Different storytelling styles.
- Better loading and error states.
- A gallery of generated stories.
- A recorded demo showing the complete experience.
Thanks for checking out my project!
Built by: Abhishek Kumar Sahu
Project: Ghost in the Machine 👻
Top comments (0)