book-sft-pipeline

Convert books into SFT datasets and train LoRA style-transfer models on Tinker.

1|Updated Feb 18, 2026
One-click install
npx skills add https://github.com/Cramer-69/skills-repository-3af2d1c7 --skill book-sft-pipeline-cramer-69
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: book-sft-pipeline
Source: https://github.com/Cramer-69/skills-repository-3af2d1c7/tree/main/packages/Agent-Skills-for-Context-Engineering/examples/book-sft-pipeline
Command: npx skills add https://github.com/Cramer-69/skills-repository-3af2d1c7 --skill book-sft-pipeline-cramer-69

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires tinker, tinker-cookbook, epub2, beautifulsoup4, and includes scripts (resource) and references (resource) components.

What problem does it solve? Training a language model to write in a specific author's voice requires turning raw books into high-quality fine-tuning data, which involves tricky segmentation, prompt diversity, and validation steps that are easy to get wrong and lead to memorization instead of style transfer. ## Core Features & Use Cases - End-to-End Pipeline: Extract text from ePub, segment into 150-400 word chunks at natural boundaries, generate diverse synthetic instructions, and build Tinker-compatible JSONL datasets. - LoRA Training Guidance: Configure base models like Qwen3-8B-Base with rank-32 LoRA adapters, including learning rates, batch sizes, and epoch limits tuned for style learning. - Validation Framework: Test style transfer with modern scenarios, verify originality by grepping training data, and score outputs with AI detectors like Pangram. - Use Case: Fine-tune an 8B model on Gertrude Stein's "Three Lives" to produce prose that Pangram scores as 100% human-written, for roughly $2 and 15 minutes of training. ## Quick Start Ask the agent to build an SFT dataset from an ePub file and train a LoRA style model on Tinker following the book-sft-pipeline phases.

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 fine-tuning?▼

Extract paragraph-level text from an ePub, segment it into 150-400 word chunks at natural boundaries, then generate synthetic scene descriptions with a cheap LLM. Pair each chunk with diverse prompt templates and system prompts in messages-format JSONL.

How to train a model to write in an author's style with LoRA?▼

Use a base model like Qwen3-8B-Base rather than an instruct version, with LoRA rank 32, learning rate 5e-4, batch size 4, and 3 epochs on Tinker. Base models are more malleable for learning low-level style patterns.

Should I use ePub or PDF as the source for training data?▼

Always source ePub over PDF because OCR errors in PDFs become learned patterns in the model. Extract from paragraph tags to preserve natural breaks, and remove front and back matter like copyright pages and tables of contents.

Why does my fine-tuned model repeat exact phrases from training data?▼

Memorization happens when prompt diversity is too low or training runs too many epochs. Use at least 15 prompt templates with 5 system prompts, limit training to 3 epochs, and verify originality by grepping the dataset for output phrases.

How do I verify a model learned style instead of memorizing content?▼

Test with modern scenarios that could not exist in the source book, such as text messages or climate anxiety. If style markers appear in these out-of-distribution contexts, the model learned style; also check AI detectors like Pangram or GPTZero.

What are the limitations of training on a single book?▼

Single-book training causes character name leakage in roughly 30% of outputs because names appear hundreds of times in the data. Mitigate this by training on multiple books by the same author or adding synthetic examples with different names.