Interact with a hosted version of this app live at https://robotf.ai/Halloween_Stories
- Description
- About the Project
- Features
- Getting Started
- Running the App
- Development Setup
- Text to Speech
- Contact
- Contributing
- License
- Acknowledgements
Welcome to the eerie realm of the Spooky Streamlit Storyteller! This is no ordinary codebase; it's a haunted mansion of horror stories, where AI and LLMs (Large Language Models) come together to weave chilling tales that will send shivers down your spine. If you're brave enough to conjure up a streaming app with Streamlit that generates spooky Halloween stories, you've just unlocked the creaky front door.
In reality this is just an example of how to integrate LLM's with Streamlit using python, langchain, requests, and even LocalAI (if you don't want to waste money on OpenAI credits.). This is just a demo to show people what is possible.
This project is a digital ouija board, channeling the supernatural power of AI to craft horror stories that are as dynamic as they are dreadful. With Streamlit's enchanting capabilities, we've bewitched an app that streams terror with the grace of a ghost gliding through the night.
AI-Powered Storytelling: Summon the spirits of AI to generate tales of terror on the fly.
Bring your own AI/LLM with LocalAI (or other custom OpenAI compatible API) or use OpenAI
Interactive UI: Choose your own adventure by selecting story elements that shape your frightening fable.
Real-time Streaming: Experience the horror unfold in real-time as the story mutates before your terrified eyes.
Text to Speech: Don't just read it the story, hear it told to you using TTS on OpenAI or LocalAI
Halloween Humor: Because even in the darkest depths, a chuckle can be the most terrifying sound.
Choose your path to horror story glory with one of these three enchanting options:
For the brave souls who wish to run the app with LocalAI backend using Docker Compose instead of wasting money on OpenAI credits:
Clone the Repo:
git clone https://github.com/kkacsh321/robotf_halloween_stories.git
cd robotf_halloween_stories
Set Up Docker Compose: Ensure you have Docker and Docker Compose installed, then run:
docker-compose up -d --build
Run the App:
After Docker Compose has successfully built and started the containers, navigate to http://localhost:8505 in your web browser to experience the horror.
Set your API KEY or to 1234 for LocalAI (doesn't matter as long as not null)
OR
Set your key for OpenAI, or a custom address for your OpenAI compatiable API LLM endpoint.
**Warning LocalAI with download several models on it's first startup to handle Chat, Image Generation, etc, etc as this calls the AIO image. See more info at
For those who wish to pull the pre-built container from Docker Hub:
Pull the Docker Image using latest tag (example v0.0.5):
docker pull robotf/robotf-halloween-stories:latest
Run the Container:
docker run -d -p 8505:8505 robotf/robotf-halloween-stories
Experience the Terror: Open your web browser to http://localhost:8505 and let the horror unfold.
Set your API KEY or to 1234 for LocalAI (doesn't matter as long as not null)
OR
Set your key for OpenAI, or a custom address for your OpenAI compatiable API LLM endpoint.
For the storytellers who wish to tinker with the source code:
Clone the Repo:
git clone <git clone https://github.com/kkacsh321/robotf_halloween_stories.git>
cd robotf_halloween_stories
# Install Dependencies:
pip install -r requirements.txt
Run the App:
streamlit run RoboTF_Halloween_Stories.py
or using gotask
task run
Prepare for Chills: Follow the Streamlit link to your web browser, or navigate to the provided local URL and prepare to craft your own horror story.
Set your API KEY or to 1234 for LocalAI (doesn't matter as long as not null)
OR
Set your key for OpenAI, or a custom address for your OpenAI compatiable API LLM endpoint.
This is dependant on which API provider you are going to use:
Set your specific settings (see below for basic guides)
Hit the Generate Story
button
If you want to hear the story spoken to you, hit the Speak it to Me
button
Set your OpenAI API Key at the top left
Select your LLM model (gpt-4)
Select your TTS model (tts-1)
Select your voice (you can change this later to try multiple voices)
Hit the Generatate Story
button and watch it go.
Once the story is done generating if you want you can hit the Speak it to me button
to generate and play the Text to Speech.
Leave the OpenAI API Key at the top left blank
Select the http://localai:8080/v1
endpoint (internal docker networking)
Select your LLM model (example: gpt-4)
Select your TTS model (example: tts-1)
Select your voice (you can change this later to try multiple voices)
Hit the Generatate Story
button and watch it go.
Once the story is done generating if you want you can hit the Speak it to me button
to generate and play the Text to Speech.
Leave the OpenAI API Key at the top left blank
Select the http://localai:8080/v1
endpoint (internal docker networking)
Select your LLM model (example: gpt-4)
Select your TTS model (example: tts-1)
Select your voice (you can change this later to try multiple voices)
Hit the Generatate Story
button and watch it go.
Once the story is done generating if you want you can hit the Speak it to me button
to generate and play the Text to Speech.
Leave the OpenAI API Key at the top left blank
Select the http://localai:8080/v1
endpoint (internal docker networking)
Select your LLM model (example: gpt-4)
Select your TTS model (example: tts-1)
Select your voice (you can change this later to try multiple voices)
Hit the Generatate Story
button and watch it go.
Once the story is done generating if you want you can hit the Speak it to me button
to generate and play the Text to Speech.
This repo uses things such as precommit, task, and brew (for Mac)
Mac: Run the setup script (if on mac with brew already installed):
./scripts/setup.sh
Otherwise install the required Python packages:
pip install -r requirements.txt
This command installs all the necessary packages, including Streamlit, langchain components, etc.
Running the App To run the app, navigate to the app's directory in your terminal and execute the following command:
with task:
task run
with docker:
task docker-load && task docker-run
with just plain streamlit
streamlit run RoboTF_Halloween_Stories.py
For OpenAI select the TTS-1 model
For using LocalAI if you want extra voices, just copy the voice_models_localai/tts-1.yaml
to the models/
directory and startup (or restart LocalAI container).
This uses Piper under the hood with LocalAI.
Then you should be able to use the full selection of voices in the menu.
Want to add your own brand of terror to the mix? Contributions are welcome on this ghostly journey:
Fork the repository. Create a new branch
git checkout -b feature/your-frightful-feature
# Make your changes.
# Commit your changes
git commit -m 'Summon the spirits of storytelling'
# Push to the branch
git push origin feature/your-frightful-feature
# Open a pull request and prepare to share your nightmare with the world.
This project is licensed under the MIT License - see the LICENSE file for details, but be warned: using this software may result in unintended otherworldly entanglements.
A ghoulish nod to Streamlit for enabling us to build this haunted house of horrors.
Shoutout to LocalAI for powering my Local LLM's localai
Kudos to the AI developers whose spectral code forms the backbone of our storytelling sΓ©ance.
A special shoutout to Edgar Allan Poe and H.P. Lovecraft, whose literary shadows loom large over this project. Final Thoughts ποΈ
As you tinker with this codebase and generate your own spine-chilling stories, remember: every tale has a grain of truth, and every shadow could be hiding something truly terrifying. Happy Haunting! π½