👻 GhostWriter: An Offline AI Horror Story Generator
This is a submission for the Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine
What I Built
Meet GhostWriter — a spooky AI-powered horror story generator that brings terrifying ideas to life without sending your prompts to a cloud AI service.
What happens when you combine Halloween, imagination, and open-weight AI running on your own computer?
You get a storyteller that lives inside your machine. 👻
With GhostWriter, users can choose a setting, a main character, a horror style, and a story length. The AI then generates an original story filled with suspense, mystery, and unexpected twists.
I interpreted the Ghost in the Machine theme as a literal ghost living inside a computer: an AI storyteller that can work locally, even when the internet disappears.
The goal was simple: make AI-powered creativity more private, accessible, and independent of cloud services.
✨ Key Features
- 👻 Generate original horror stories from custom prompts.
- 🏚️ Explore haunted mansions, abandoned hospitals, mysterious forests, and other eerie settings.
- 🕯️ Choose between psychological horror, supernatural stories, gothic horror, and suspense.
- 💻 Run inference locally using Ollama and a compatible open-weight model.
- 🔒 Keep prompts and saved stories on your own machine.
- 📖 Save, revisit, and download generated stories.
- 🌐 Generate stories offline after the initial setup and model download.
Demo
Video demo: https://drive.google.com/file/d/1HzSWYnSfsjJUEKCKJupVVdiNffK179iL/view?usp=sharing
The best way to experience GhostWriter is to give it a simple prompt:
A night guard working alone in an abandoned hospital discovers that one patient is still checking in every night, despite the hospital having been closed for twenty years.
Then watch the machine write the story.
Code
GitHub repository: https://github.com/piyushkr1155/GhostWriterAI
The project is built with Python and Streamlit, with Ollama handling local AI inference.
Check out the repository for the source code, installation instructions, project architecture, and contribution guidelines.
How I Built It
I wanted to build something practical that demonstrated the value of running AI locally rather than simply wrapping a hosted AI API.
Tech Stack
- Python — application logic and story generation.
- Streamlit — interactive user interface.
- Ollama — local model runtime and inference API.
- Open-weight language model — generates original horror stories.
- JSON or SQLite — local storage for saved stories.
- pytest — testing application logic and error handling.
How It Works
- The user enters a story idea and selects their preferred horror style.
- GhostWriter constructs a prompt from the user's choices.
- The application sends that prompt to the local Ollama service.
- The locally installed model generates the story.
- The application displays the result and lets the user save or download it.
The important part is that story generation happens on the user's machine. After the required software and model have been installed, the application does not need a cloud AI API to generate stories.
Why Does Open Innovation Matter?
Open innovation is central to GhostWriter, not just an extra feature.
- Privacy by design
Personal prompts and creative ideas can stay on the user's computer instead of being sent to a third-party AI provider.
- Offline creativity
Once the dependencies and model are installed, GhostWriter can generate stories without an active internet connection. This makes the experience useful even when connectivity is unreliable.
- Freedom to experiment
A local model can be replaced with another compatible model. Developers can compare outputs, adjust prompts, experiment with model settings, and customize the experience without being tied to one hosted API.
- Lower barriers to entry
There is no per-request cloud inference charge in the local setup. Users can experiment without worrying about API usage bills, although hardware, electricity, and storage still have costs.
- A more accessible AI ecosystem
Open-weight models and local tooling make it easier for developers to learn how AI applications work, inspect their architecture, and build alternatives that suit their needs.
For GhostWriter, the biggest advantage is independence. The story generator does not have to depend on a remote AI provider being available every time someone wants to create something.
My Agent Session
I used an AI coding agent to help build and refine the project. The development process involved structuring the application, integrating local inference, and testing the user experience.
The Spirit of It
Every Halloween, we tell stories about things we cannot explain.
GhostWriter gives those stories a new home: a computer that can create a new nightmare without needing to call the cloud.
The idea behind this project is that AI does not always need to be a distant service. Sometimes, the most interesting thing is what you can build right on your own machine.
The internet can go dark. The lights can go out.
But the ghost is still there. 👻
Prize Categories
Built with curiosity, local AI, and a little Halloween spirit. 🎃
Top comments (0)