book-sft-pipeline

Convert ePub books into SFT datasets with JSONL formatting and LoRA training.

1|Updated May 16, 2026
One-click install
npx skills add https://github.com/enigmaicon-eng/AI-Enterprise-OS --skill book-sft-pipeline-enigmaicon-eng
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: book-sft-pipeline
Source: https://github.com/enigmaicon-eng/AI-Enterprise-OS/tree/main/examples/agent-skills/examples/book-sft-pipeline
Command: npx skills add https://github.com/enigmaicon-eng/AI-Enterprise-OS --skill book-sft-pipeline-enigmaicon-eng

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill turns long-form books into high-quality supervised fine-tuning (SFT) datasets for style transfer, so models learn author voice instead of memorizing plot.

Core Features & Use Cases

  • Book → training text extraction: Extract clean paragraph-level text from ePub (favoring ePub over PDF to avoid OCR artifacts) and remove front/back matter.
  • Intelligent segmentation for training: Split into semantically coherent chunks (typically 150–400 words) with overlap and safeguards to avoid mid-sentence or poorly formed breaks.
  • Diverse instruction generation: Create many instruction/prompt variations (15+ templates and multiple system prompts) so the model learns style patterns rather than a single prompt mapping.
  • Dataset construction for Tinker-style training: Build chat-message JSONL pairs (system/user/assistant) suitable for supervised tuning.
  • LoRA SFT training + validation: Train a small base model with LoRA, then validate using modern scenario tests and originality checks.
  • Use case examples: Fine-tune on books to replicate an author’s voice, build LoRA adapters for style writing, and prepare Tinker-compatible datasets from long novels.

Quick Start

Activate this skill when the user asks to fine-tune a model on a specific book’s author voice, and then follow the pipeline from ePub text extraction through segmentation, instruction generation, JSONL dataset building, LoRA training, and modern-scenario originality validation.

Frequently Asked Questions about book-sft-pipeline

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create an SFT dataset from an ePub book for LoRA style transfer?▼

To create an SFT dataset from an ePub for LoRA style transfer, extract paragraph-level text, segment it into coherent chunks with overlap, and format them into chat-message JSONL pairs with diverse instruction prompts.

What is the best way to fine-tune a model to replicate an author's voice instead of memorizing the plot?▼

Replicating an author's voice requires generating diverse instruction variations and multiple system prompts during dataset construction, which trains the model on writing style patterns rather than specific narrative content.

Can I use PDF files instead of ePub for extracting training text for supervised fine-tuning?▼

PDF files are not recommended for text extraction; the SFT pipeline favors ePub over PDF to avoid OCR artifacts and cleanly extract paragraph-level text for training data.

How do I segment long-form text into training chunks without breaking sentences?▼

Long-form text segmentation splits books into 150–400 word chunks with overlap, applying safeguards to prevent mid-sentence breaks and ensure semantically coherent training data.

How do I validate a LoRA adapter trained on book writing style?▼

Validate LoRA style transfer using out-of-distribution scenario tests and originality checks to ensure the model generalizes the author voice correctly without copying text verbatim.