book-sft-pipeline

Convert books into JSONL datasets and fine-tune LoRA models with Tinker.

Updated Apr 25, 2026
One-click install
npx skills add https://github.com/nshaikhs/claude-code-for-operators --skill book-sft-pipeline-nshaikhs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: book-sft-pipeline
Source: https://github.com/nshaikhs/claude-code-for-operators/tree/main/skills/context-engineering/examples/book-sft-pipeline
Command: npx skills add https://github.com/nshaikhs/claude-code-for-operators --skill book-sft-pipeline-nshaikhs

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This pipeline turns long-form books into structured SFT datasets and author-voice models, enabling scalable style-transfer fine-tuning from literary text.

Core Features & Use Cases

  • Extraction & Segmentation: Converts books (ePub or text) to clean text and segments it into coherent chunks (150-400 words) with overlap to preserve narrative flow.
  • Instruction Diversification: Generates multiple prompt variants to teach the model authorial style rather than memorizing passages.
  • Dataset Construction: Builds Tinker-compatible JSONL datasets with system/user/assistant prompts suitable for LoRA training.
  • LoRA Training Orchestration: Provides an end-to-end flow to fine-tune base models via LoRA on a small dataset using Tinker.
  • Validation & Quality: Includes originality checks and modern-scenario tests to ensure style transfer without content leakage.
  • Standalone Plugin: Designed as a standalone skill that can be plugged into the Context Engineering ecosystem.

Quick Start

Feed a book file (epub or plain text) and run the full book-SFT pipeline to generate a dataset and fine-tune a style-transfer model.

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 a book for LoRA training?

To create an SFT dataset from a book for LoRA training, you extract text from ePub or plain text files, segment it into coherent 150-400 word chunks with overlap, and generate diverse instructions to build JSONL datasets.

What is the best way to fine-tune a model for author style transfer?

The best way to fine-tune a model for author style transfer is using a LoRA-based training flow on a structured SFT dataset, which teaches the model authorial style rather than memorizing passages.

Can I use ePub files to generate Tinker-compatible JSONL datasets?

Yes, you can use ePub files to generate Tinker-compatible JSONL datasets by extracting the text, segmenting it into narrative chunks, and constructing system, user, and assistant prompts suitable for training.

How does text segmentation preserve narrative boundaries in book datasets?

Text segmentation preserves narrative boundaries in book datasets by chunking extracted text into 150-400 word segments with overlap, ensuring the narrative flow is maintained for style-transfer instruction generation.

What validation checks prevent content leakage during style transfer training?

Validation checks prevent content leakage during style transfer training by running originality checks and modern-scenario tests, ensuring the fine-tuned model applies the authorial style without reproducing exact passages.

Do I need a large dataset to fine-tune a style-transfer model with LoRA?

No, you do not need a large dataset to fine-tune a style-transfer model with LoRA, as the pipeline orchestrates fine-tuning on a small dataset to effectively capture the desired authorial voice.