δΈζζζ‘£ | English | ζ₯ζ¬θͺ | FranΓ§ais
β¨ Core Features β¨
| Module | Key Capabilities |
|---|---|
| π¨ Novel Setting Workshop | Worldbuilding / Character Design / Plot Blueprint |
| π Intelligent Chapter Generation | Multi-stage generation to ensure plot coherence |
| π§ State Tracking System | Character development trajectory / Foreshadowing management |
| π Semantic Search Engine | Vector-based long-term context consistency |
| π Knowledge Base Integration | Supports local document references |
| β Automatic Proofreading | Detects plot contradictions and logical conflicts |
| π Apple-style Web UI | FastAPI backend + responsive browser interface |
A multifunctional novel generator built on large language models. Helps you efficiently create long-form stories with consistent settings and rigorous logic.
| Layer | Technology |
|---|---|
| Backend | Python 3.11+, FastAPI, Uvicorn |
| Frontend | Vanilla HTML/CSS/JS (Apple-style design) |
| LLM Integration | LangChain + OpenAI SDK + Google Genai SDK + Azure SDK |
| Vector Database | ChromaDB (via langchain-chroma) |
| Package Manager | uv |
Supports 10+ LLM providers: OpenAI, DeepSeek, Gemini, Azure OpenAI, Azure AI, Ollama, ML Studio, ιΏιδΊηΎηΌ, η«ε±±εΌζ, η‘ εΊζ΅ε¨, Grok.
SuperNovel/
βββ web/ # Web application
β βββ app.py # FastAPI backend (REST API + WebSocket)
β βββ static/
β βββ index.html # Apple-style single-page UI
β βββ css/style.css # Stylesheet
β βββ js/app.js # Frontend logic
β
βββ novel_generator/ # Core generation engine
β βββ architecture.py # Step 1: Novel architecture (4-stage pipeline)
β βββ blueprint.py # Step 2: Chapter blueprint generation
β βββ chapter.py # Step 3: Chapter draft generation
β βββ finalization.py # Step 4: Finalization (summary/roles/vectors)
β βββ knowledge.py # Knowledge base file import
β βββ vectorstore_utils.py # ChromaDB operations
β βββ common.py # Retry logic, text cleaning, logging
β
βββ llm_adapters.py # LLM adapter factory (10+ providers)
βββ embedding_adapters.py # Embedding adapter factory (6+ providers)
βββ config_manager.py # Config load/save (JSON, atomic writes)
βββ consistency_checker.py # LLM-driven consistency proofreading
βββ prompt_definitions.py # Chinese prompt templates
βββ prompt_definitions_en.py # English prompt templates
βββ chapter_directory_parser.py # Blueprint text parser
βββ utils.py # File I/O, word count utilities
βββ config.example.json # Configuration template
βββ pyproject.toml # Project metadata & dependencies
βββ tests/ # Unit tests
- Python 3.11+
- uv package manager (recommended) or pip
# Clone the repository
git clone https://github.com/StanleyChanH/SuperNovel
cd SuperNovel
# Install dependencies with uv (recommended)
uv sync
# Or with pip
pip install -e .# With uv (recommended)
uv run novel-web
# Or directly with uvicorn
uv run python -m uvicorn web.app:app --host 0.0.0.0 --port 8000
# Or with pip environment
python -m uvicorn web.app:app --host 0.0.0.0 --port 8000Open your browser and navigate to http://localhost:8000
The CustomTkinter desktop UI is available as an optional extra:
uv sync --extra desktop
uv run python main.py- Open the web UI at
http://localhost:8000 - Navigate to the Config tab
- Add your LLM provider configuration (API key, base URL, model name, etc.)
- Optionally add an Embedding provider configuration
- Click Save Config
{
"llm_configs": {
"My GPT": {
"api_key": "sk-...",
"base_url": "https://api.openai.com/v1",
"interface_format": "OpenAI",
"model_name": "gpt-4o-mini",
"temperature": 0.7,
"max_tokens": 4096,
"timeout": 600
}
},
"embedding_configs": {
"My Embedding": {
"api_key": "sk-...",
"base_url": "https://api.openai.com/v1",
"interface_format": "OpenAI",
"model_name": "text-embedding-ada-002",
"retrieval_k": 4
}
},
"choose_configs": {
"architecture_llm": "My GPT",
"chapter_outline_llm": "My GPT",
"final_chapter_llm": "My GPT",
"consistency_review_llm": "My GPT"
}
}| Provider | Interface Format | Notes |
|---|---|---|
| OpenAI | "OpenAI" |
Official API |
| DeepSeek | "DeepSeek" |
DeepSeek API |
| Google Gemini | "Gemini" |
Google Genai SDK |
| Azure OpenAI | "Azure OpenAI" |
Azure-hosted OpenAI |
| Azure AI | "Azure AI" |
Azure AI Inference |
| Ollama | "Ollama" |
Local models |
| ML Studio | "ML Studio" |
Local OpenAI-compatible |
| ιΏιδΊηΎηΌ | "ιΏιδΊηΎηΌ" |
Alibaba Cloud |
| η«ε±±εΌζ | "η«ε±±εΌζ" |
ByteDance Volcano Engine |
| η‘ εΊζ΅ε¨ | "η‘
εΊζ΅ε¨" |
SiliconFlow |
| Grok | "Grok" |
xAI Grok |
Step 1: Generate Architecture β Novel_architecture.txt
Step 2: Generate Blueprint β Novel_directory.txt
Step 3: Generate Chapter β chapters/chapter_N.txt
Step 4: Finalize Chapter β Updates summary, characters, vectors
-
Set novel parameters β Enter topic, genre, chapter count, words per chapter, and output directory.
-
Step 1: Generate Architecture β Creates worldbuilding, character dynamics, initial character states, and plot architecture.
-
Step 2: Generate Blueprint β Produces chapter titles, positions, roles, cliffhangers, and plot hooks for all chapters.
-
Step 3: Generate Chapter β Select a chapter number and click generate. The system automatically retrieves context from the architecture, blueprint, summaries, character states, and previous chapters via semantic search.
-
Step 4: Finalize Chapter β Updates the global summary, character states, vector database, and optionally expands the chapter if word count is insufficient.
-
Consistency Check (Optional) β Compares settings against chapter content to detect contradictions.
-
Repeat Steps 3β4 until all chapters are generated and finalized.
- Explicitly set the embedding interface and model name in the config.
- For local Ollama embeddings, start the service first:
ollama serve ollama pull nomic-embed-text
- Clear the
vectorstoredirectory after switching embedding models.
The API returned non-JSON content (possibly an HTML error page). Check your API key, base URL, and network connectivity.
Check the stability of your API endpoint and network connection. Consider increasing the timeout value in your LLM config.
Add or edit an embedding configuration in the Config tab, then save.
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
This project is open source. Feel free to use and modify.