AI Story Generator - use Ollama LLM to Generate Fascinating Stories
AI Story Generator 📚✨ is a powerful app that uses large language models (LLMs) such as Ollama to craft full-length novels and immersive long-form stories from user prompts.
It is a game-changer for writers, aspiring novelists, and content creators looking to transform their ideas into complete stories without the hassle of writing initial drafts.
Simply, the app takes your story ideas and turns them into complete novels using advanced AI. We love how it keeps track of all the characters perfectly - their personalities, backstories, everything stays consistent from start to finish.
The best part? It gives you a solid story outline right from the start, so you're never staring at a blank page. Whether you're an experienced writer or just starting out, this tool makes the whole process so much smoother.
We've seen it in action, and it really does deliver on creating engaging, full-length stories from simple prompts.
Features
- Generate medium to full-length novels: Produce substantial stories with coherent narratives, suitable for novella or novel-length works.
- Easy setup and use: Get started quickly with minimal configuration required.
- Customizable prompts and models: Choose from existing prompts or create your own, and select from various language models.
- Automatic model downloading: The system can automatically download required models via Ollama if they aren't already available.
- Support for local models via Ollama: Run language models locally for full control and privacy.
- Cloud provider support (currently Google): Access high-performance computing resources for those without powerful GPUs.
- Flexible configuration options: Fine-tune the generation process through easily modifiable settings.
- Works across all operating systems
- Supports translation of the generated stories in all languages
Install and Run
Getting started with AI Story Generator is easy:
- Clone the repository
- Install Ollama for local model support
- Run the generator:
./Write.py -Prompt Prompts/YourChosenPrompt.txt
That's it! The system will automatically download any required models and start generating your story.
Optional steps:
- Modify prompts in
Writer/Prompts.py
or create your own - Configure the model selection in
Writer/Config.py
Using Command-Line Arguments (Recommended)
You can override the default models by specifying them as command-line arguments:
./Write.py -Prompt Prompts/YourChosenPrompt.txt -InitialOutlineModel "ollama://llama3:70b" ...
Available command-line arguments are stated in the Write.py
file.
The model format is: {ModelProvider}://{ModelName}@{ModelHost}?parameter=value
- Default host is
127.0.0.1:11434
(currently only affects ollama) - Default ModelProvider is
ollama
- Supported providers:
ollama
,google
,openrouter
- For
ollama
we support the passing of parameters (e.g.temperature
) on a per model basis
Example Usage:
./Write.py -Prompt Prompts/YourChosenPrompt.txt -InitialOutlineModel "google://gemini-1.5-pro" -ChapterOutlineModel "ollama://llama3:[email protected]:11434" ...
This flexibility allows you to experiment with different models for various parts of the story generation process, helping you find the optimal combination for your needs.
NOTE: If you're using a provider that needs an API key, please copy .env.example
to .env
and paste in your API keys there.
2. Using Writer/Config.py
Edit the Writer/Config.py
file to change the default models:
INITIAL_OUTLINE_WRITER_MODEL = "ollama://llama3:70b"
CHAPTER_OUTLINE_WRITER_MODEL = "ollama://gemma2:27b"
CHAPTER_WRITER_MODEL = "google://gemini-1.5-flash"
License
AGPL-3.0 License