Practical overview
When it fits
Use it when you need a local, configurable pipeline for turning topics or outlines into long-form synthetic pretraining material and can provide the required database and model configuration.
Who it is for
- Developers preparing synthetic long-form corpora for LLM pretraining.
- Teams that want to generate training material from their own seed topics or outlines.
- Python users who need to configure model APIs, retrieval backends or custom adapters.
Documented uses
- Generate and deduplicate topic lists from a subject.
- Expand a supplied set of seed topics, optionally constraining topics to a domain.
- Generate one textbook per topic, or generate from an existing outline.
- Choose retrieval through Serply or SerpAPI, or disable retrieval.
- Run concurrent generation and adapt the worker count when rate limits occur.
Requirements & limits
The project is a public GitHub repository with an MIT license. Its documented setup is self-hosted and requires Python 3.9 or later and PostgreSQL.
- PostgreSQL is a setup prerequisite, alongside Python and Poetry.
- Retrieval can be configured with Serply or SerpAPI, or switched off with SEARCH_BACKEND=none.
- An OpenAI-compatible endpoint can be configured using a base URL and model settings; the README also describes OpenAI.
- The README recommends a model context length of up to 16k, noting that 12k may suffice.
- Generation supports parallel workers, and the README recommends lowering the count if rate limits occur.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Set up the local project
Install the project and prepare its PostgreSQL database before configuring a generation workflow.
Before you start
- Python 3.9 or later (Python 3.11 is recommended)
- PostgreSQL
- Poetry
- The project repository
Steps
Create a PostgreSQL database named textbook with psql.
Clone the repository and change into its directory.
Install dependencies with Poetry.
Run the development migration with invoke migrate-dev.
Expected outcome
The repository dependencies are installed and the development database migration has been run.
Guide limitations
- This covers setup only, not model configuration or data generation.
Generate textbooks from a topic file
Use an existing flat JSON list of topics as input for parallel textbook generation.
Before you start
- The project installed and configured
- A topic file containing a flat JSON list
- A configured model API
Steps
Prepare a topics JSON file.
Run python book_generator.py topics.json books.jsonl with a chosen --workers value.
Reduce the worker count if rate limits occur.
Expected outcome
The script writes generated books to the specified JSONL output file.
Guide limitations
- The README notes that courses are cached by model and topic by default; --revision can specify a revision number to skip the cache.
- The README does not promise that a particular API, model, worker count or output will work in every environment.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 11 November 2026
- Original website title
- VikParuchuri/textbook_quality · Official homepage title · retained in its source language

