跳到正文
DEV Community· Akshat Maheshwari·· 3 小時前AI 評分34

GhostWrite:本地 AI 鬼故事生成器

👻 GhostWrite: A Local AI Ghost Story Generator

AI 導讀

GhostWrite 是一款以 TinyLlama 1.1B Chat 為基礎的本地 AI 鬼故事生成器,用戶可自訂故事背景、主角和神秘物件,再生成並下載鬼故事。應用程式使用 Python、Streamlit 和 Hugging Face Transformers,模型在本地運行,無需外部 AI API 金鑰。

正文

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine

What I Built

👻 GhostWrite — A Local AI Ghost Story Generator

GhostWrite is a small creative AI application that turns simple ideas into atmospheric ghost stories.

Users can customize three elements:

  • Setting: Where the story takes place
  • Main character: Who the story follows
  • Mysterious object: An object that drives the mystery

Based on these inputs, GhostWrite generates a unique ghost story that users can read and download.

I wanted to explore how open-source AI could be used to create something fun and interactive without depending on paid AI APIs.

Demo

Generating a Story

GhostWrite allows users to customize their story before generation.

GhostWrite generating a story using custom user inputs.

Generated Story

The application generates an atmospheric story based on the selected inputs, with an option to download the result.

A completed AI-generated ghost story, ready to download.

Code

GitHub Repository: GhostWrite

The repository contains the application source code, dependencies, and instructions for running the project locally.

How I Built It

I built GhostWrite using Python and Streamlit, integrating the TinyLlama 1.1B Chat model through Hugging Face Transformers.

The application follows a simple workflow:

  1. Collect the user's story inputs.
  2. Combine them into a structured prompt.
  3. Generate a story using the locally running language model.
  4. Display the generated story in the interface.
  5. Allow users to download their story as a text file.

The main technologies used were:

  • Python
  • Streamlit
  • Hugging Face Transformers
  • TinyLlama 1.1B Chat

The model runs locally, so the application does not require an external AI API key.

Why Does Open Innovation Matter?

Open innovation makes AI experimentation more accessible.

Building GhostWrite with an open-weight model allowed me to explore AI-powered text generation without relying on proprietary APIs or paid inference services.

It also gave me the opportunity to experiment with prompts, generation parameters, and local inference while keeping the application simple enough for others to run and modify.

For me, this project was a small but meaningful step toward understanding how open-source AI can make creative technology more accessible to developers.

The Spirit of It

GhostWrite started with a simple idea: what if a few ordinary details could become the beginning of an unsettling story?

A broken radio, an abandoned railway station, and a night-shift engineer are enough to get the imagination going.

The goal was to make storytelling feel interactive, letting users create the ingredients of their own little nightmare.

Thanks

Built for the Hacktoberfest 2026 Open-Source AI Challenge — Week 4: Ghost in the Machine.

來源:DEV Community · dev.to