DEV Community

Cover image for GhostWriter AI: A Local AI-Powered Spooky Story Generator ๐Ÿ‘ป
PERARASU  S
PERARASU S

Posted on

GhostWriter AI: A Local AI-Powered Spooky Story Generator ๐Ÿ‘ป

Hacktoberfest Open-Source AI Challenge: Ghost in the Machine Submission ๐Ÿ‘ป๐ŸŒผ

๐Ÿ‘ป GhostWriter AI: A Local AI-Powered Spooky Story Generator

Have you ever wanted to create spooky stories using AI while running the model on your own computer?

That's the idea behind GhostWriter AI, a Python-based project that combines Streamlit and Ollama to generate horror-themed fictional stories using a locally running AI model.

I built this project to learn how local AI models can be integrated into a simple, interactive web application.

๐Ÿ’ก The Problem

Writing stories can be fun, but coming up with new ideas, characters, and mysterious situations can sometimes be challenging.

I wanted to experiment with an AI-powered application that could help generate spooky stories through a simple interface.

๐Ÿš€ My Solution

GhostWriter AI lets users choose an available story theme and length, generate a fictional story, and save it to a Story Library.

The application uses Python for its logic, Streamlit for its interface, and Ollama to connect to a locally running AI model.

โœจ Features

  • ๐Ÿ‘ป Generate spooky and horror-themed stories.
  • ๐ŸŽญ Choose from the available story themes.
  • ๐Ÿ“ Select an available story length.
  • ๐Ÿ“š Save generated stories to a Story Library.
  • ๐Ÿ’พ Store saved stories locally in JSON format.
  • ๐Ÿ–ฅ๏ธ Run the application locally using Streamlit and Ollama.

๐Ÿ› ๏ธ Technology Stack

  • Python โ€” application logic
  • Streamlit โ€” interactive web interface
  • Ollama โ€” local AI model runtime
  • Qwen2.5 0.5B โ€” the model I tested during development
  • JSON โ€” local story storage
  • Git and GitHub โ€” version control and project hosting

โš™๏ธ How It Works

  1. Open the GhostWriter AI application.
  2. Select an available story theme and length.
  3. Click the Generate Story button.
  4. The application sends a prompt to the configured AI model through Ollama.
  5. The generated story appears in the application.
  6. Save the story to the Story Library.
  7. Revisit the library to view saved stories.

๐Ÿงช What I Tested

During development, I verified that the Streamlit application launches locally and that the Story Library can display saved stories.

I also tested the local Ollama installation and confirmed that the qwen2.5:0.5b model was available and could return a text response.

I tested saving stories and checking whether they appeared in the Story Library.

These tests helped me understand how the different parts of the application work together.

๐Ÿ”“ Why Local and Open-Weight AI?

One interesting part of this project is experimenting with an open-weight model running locally.

This approach lets developers explore AI integration without depending entirely on a cloud-based AI API for every interaction.

It also gave me practical experience with local model installation, model availability, and connecting Python applications to Ollama.

๐Ÿ“š What I Learned

While building GhostWriter AI, I gained experience with:

  • Creating a web interface using Streamlit.
  • Working with Python functions and application logic.
  • Connecting to a local AI model through Ollama.
  • Generating text using prompts.
  • Saving and loading data with JSON.
  • Using Git and GitHub to manage project code.
  • Testing application features and troubleshooting errors.

๐Ÿ”ฎ Future Improvements

There are several features I would like to explore next:

  • More story genres and themes.
  • Better controls for writing style and story length.
  • Search and filtering in the Story Library.
  • Story editing and deletion.
  • Exporting stories to text or PDF.
  • Improved error handling and model status messages.
  • Automated tests for important application features.

These are future ideas and are not all implemented in the current version.

๐Ÿ’ป Try the Project

GitHub Repository:

[https://github.com/perarasusperarasu0-dev/GhostWriterAI.git
 ]

The repository contains the project source code and setup instructions.

๐ŸŽฏ Final Thoughts

GhostWriter AI was a valuable learning experience that helped me explore Python, Streamlit, and local AI integration in one project.

I'm looking forward to improving the application and learning more about open-weight AI models.

Building small projects is a great way to understand how different technologies work together!


Built with Python, Streamlit, and Ollama. ๐Ÿ‘ป

devchallenge #hf26challenge

Top comments (0)