NovelGenerator V2.5 is an advanced Python tool that transforms a brief user input into a complete novel or fanfiction. By leveraging Ollama’s large language models, it builds coherent plots, develops rich characters, and adapts to various literary styles. You can also choose alternative API providers like ChatGPT or Claude Sonnet.
While commercial models may offer higher quality, the Ollama version remains free by using local LLMs—its innovative design bridges any quality gap, generating your book automatically in the background without requiring your attention.
Additionally, running story_idea_generation.py engages Creative LLM Agents—Architect, Visionary, and Critic—who collaboratively debate and refine ideas over several iterations. This process turns a simple theme into a well-structured narrative, providing the perfect foundation for the main book generator.
- 🔄 Full generation pipeline from premise to complete novel
- 👥 Rich character development with relationships, arcs, and consistent tracking
- 📝 Chapter generation with detailed scenes and natural transitions
- 📊 Progress tracking and logging throughout creation process
- 🌍 Consistent world-building with recurring motifs and locations
- 📈 Emotional arc tracking and narrative tension management
- ⏱️ Timeline consistency between chapters
- 🔍 Automatic consistency validation and correction
- 🔄 Smooth chapter-to-chapter transitions
- 📚 Final quality assurance for narrative flow
- Python 3.8+
- Ollama
- Dependencies: requests, dataclasses
git clone https://github.com/KazKozDev/NovelGenerator.git
cd NovelGenerator
pip install -r requirements.txt
- Start Ollama:
ollama serve
- Run generator:
python novel_generator.py
Alternative Options: Two additional scripts are available for different API providers:
-
ChatGPT Option: novel_generator_chat_gpt.py
-
Sonet Option: novel_generator_sonet.py


Quantitative analysis of a fan-fiction text depicting Melisandre's origin story from ASOIAF.
Metric | Value | Metric | Value | |
---|---|---|---|---|
Word Count | 6,723 | Flesch Reading Ease | 70.2 | |
Chapters | 8 | Flesch-Kincaid Grade | 9.4 | |
Avg Words/Chapter | 840 | Lexical Density | 58.3% | |
Dialogue Ratio | 22% | Description Density | 49.8% |
Metaphors: 4.0 | Similes: 2.1 | Imagery: 12.8 | Symbolism: 4.8
Fantasy: 8.2 | ASOIAF: 8.5 | Thematic: 8.4 | Character: 8.0
- Professional-quality writing with strong descriptive language
- Above-average imagery and symbolism metrics
- Heavy emphasis on narration over dialogue
- Strong world-building consistency with ASOIAF universe
Frequently Asked Questions
-
Q: How long does it take to generate a book? A: Generation time varies depending on chapter length, complexity, and system resources.
-
Q: Can I use the generated content commercially? A: Yes, but I recommend thorough review and editing before commercial use.
-
Q: What makes NovelGenerator different from other text generators? A: The tool focuses on complete novel generation with coherent plot structures, character development, and professional-grade writing quality.
-
Q: Any technical challenge? A: The main technical challenge, requiring multiple code revisions, was ensuring narrative consistency - both between scenes within chapters and between chapters throughout the manuscript, while maintaining an engaging plot. The system aims to generate chapters with lengths comparable to published books.
- Fork repository
- Create feature branch
- Submit pull request
MIT
Built with Ollama and gemma2:27b