OpenViSTAI · Agents · Blockchain · Crypto
Menu
AI Developer Tools & SDKs

Textbook Quality

Textbook Quality is a self-hosted Python tool that generates long-form synthetic textbook-style material for LLM pretraining. It can create or expand topic lists, generate books from topics or outlines, and use optional retrieval while making parallel calls to OpenAI or a compatible user-provided API.

Independent OpenViST project profile, based on linked sources.

Textbook Quality — Topic-to-textbook corpus generation
OpenViST project illustration. See the linked sources for product details.
Understand the project

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.
Before you choose

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.

Source-based practical guide

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

  1. Create a PostgreSQL database named textbook with psql.

  2. Clone the repository and change into its directory.

  3. Install dependencies with Poetry.

  4. 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.
Source-based practical guide

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

  1. Prepare a topics JSON file.

  2. Run python book_generator.py topics.json books.jsonl with a chosen --workers value.

  3. 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.
Evidence and transparency

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