book-sft-pipeline

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

Updated Mar 26, 2026
One-click install
npx skills add https://github.com/LGJ-Jonathan/Jonathan_Global_Claude_Skills --skill book-sft-pipeline-lgj-jonathan
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: book-sft-pipeline
Source: https://github.com/LGJ-Jonathan/Jonathan_Global_Claude_Skills/tree/main/context-engineering/examples/book-sft-pipeline
Command: npx skills add https://github.com/LGJ-Jonathan/Jonathan_Global_Claude_Skills --skill book-sft-pipeline-lgj-jonathan

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Training a language model to replicate an author's writing style requires solving text segmentation, instruction diversity, dataset formatting, and fine-tuning configuration, and mistakes in any phase cause memorization instead of genuine style transfer. ## Core Features & Use Cases - End-to-End Pipeline: Extract text from ePub files, segment into 150-400 word chunks at natural boundaries, generate diverse synthetic instructions, and build Tinker-compatible JSONL training data. - 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: Train an 8B model on a public-domain novel for roughly $2 and 15 minutes, producing outputs that pass AI detectors as human-written while applying the author's style to scenarios that never existed in the source book. ## Quick Start Ask the agent to build an SFT dataset from your ePub file and train a style-transfer model on Tinker following this pipeline.

Frequently Asked Questions about book-sft-pipeline

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

FAQPage Schema
How do I fine-tune a model to write in an author's style?

Extract text from an ePub, segment it into 150-400 word chunks at paragraph boundaries, generate diverse synthetic instructions for each chunk, and train a base model with LoRA on Tinker. Use at least 15 prompt templates to prevent memorization of specific phrasings.

How to create an SFT dataset from a book?

Segment the book into coherent chunks, use a cheap LLM to generate scene descriptions without quoting the text, then pair each description with the original passage in messages format. Generate two variants per chunk with different system prompts and templates.

Should I use a base model or instruct model for style transfer?

Use base models like Qwen3-8B-Base rather than instruction-tuned versions. Base models are more malleable for learning new styles, while instruct models have existing patterns that resist being overwritten by style training.

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

Exact phrase repetition indicates too few prompt variations or too many training epochs. Use 15 or more prompt templates with 5 or more system prompts, and limit training to 3 epochs to force the model to learn style patterns instead of memorizing content.

What chunk size works best for book segmentation in fine-tuning?

Chunks of 150-400 words with paragraph overlap produce more training examples and better style transfer than larger 250-650 word chunks. Always break at paragraph boundaries, never mid-sentence, to avoid teaching fragmented output.

How much does it cost to train a style transfer model on one book?

Approximately $2 total: about $0.50 for LLM-based instruction generation and $1.50 for roughly 15 minutes of Tinker LoRA training. This yields 500-1000 training examples from a typical novel.