GhostWriter AI: A Local AI Horror Story Generator 👻
What if you could summon a horror story directly from your terminal, powered by an open-weight AI model running on your own machine?
That's the idea behind GhostWriter AI, a command-line horror story generator I built for the Hacktoberfest 2026 Week 4 challenge: Ghost in the Machine.
👻 What is GhostWriter AI?
GhostWriter AI is a Python-based terminal application that generates horror stories from user-provided prompts.
It uses DistilGPT-2, an open-weight language model, through PyTorch and the Hugging Face ecosystem.
Instead of sending every prompt to a hosted AI API, the application loads the model locally and generates text on the user's machine.
⚙️ Features
- Local AI inference using DistilGPT-2.
- Six horror genres:
- Supernatural
- Psychological Horror
- Paranormal
- Cosmic Horror
- Gothic Horror
- Sci-Fi Horror
- Three story lengths: short, medium, and long.
- Custom prompts to guide story generation.
- Save generated stories locally as text files.
- Terminal interface with a horror-inspired design.
🧠 How does it work?
The application follows a simple pipeline:
- The user enters a story prompt.
- The user selects a horror genre.
- The user chooses the desired story length.
- The local language model generates text.
- The generated story can be saved to the local
storiesdirectory.
The project uses Python, PyTorch, and DistilGPT-2.
🔓 Why open-source AI?
For me, the most interesting part of this project is being able to run an AI model locally.
Open-weight models make experimentation more accessible. They let developers explore inference, modify generation settings, and build applications without depending entirely on a paid hosted API.
Local inference can also help keep prompts on the user's own machine after the model has been downloaded.
This makes GhostWriter AI a small experiment in building AI-powered applications with open technology.
🖥️ Try it yourself
GitHub repository:
https://github.com/shauryamalhotra957-wq/ghostwriter-ai
Clone the repository:
git clone https://github.com/shauryamalhotra957-wq/ghostwriter-ai.git
cd ghostwriter-ai
Install dependencies:
pip install -r requirements.txt
Run the application:
python main.py
The model weights may need to be downloaded the first time you run the application.
🛠️ Built with
- Python
- PyTorch
- DistilGPT-2
- Hugging Face Transformers
🚧 What's next?
GhostWriter AI is an early prototype. Story coherence and prompt adherence are areas I want to improve.
Future plans include experimenting with better open-weight models, improving generation controls, and building a more polished interface.
Final thoughts
This project helped me explore how open-weight language models can be integrated into a practical application.
The goal was simple: build a little horror machine that lives in your terminal.
And perhaps, give it a few nightmares of its own.
Built for Hacktoberfest 2026 — Week 4: Ghost in the Machine.
devchallenge #hf26challenge #hacktoberfest #ai #python #opensource
This is a submission for the Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine.This is a submission for the Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine

Top comments (0)