sft
Supervised Fine-Tuning with SFTTrainer and Unsloth. Covers dataset preparation, chat template formatting, training configuration, and Unsloth optimizations for 2x faster instruction tuning. Includes thinking model patterns.
npx skills add majiayu000/claude-skill-registry --skill sft --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Supervised Fine-Tuning (SFT) ## Overview SFT adapts a pre-trained LLM to follow instructions by training on instruction-response pairs. Unsloth provides an optimized SFTTrainer for 2x faster training with reduced memory usage. This skill includes patterns for training thinking/reasoning models. ## Quick Reference | Component | Purpose | |-----------|---------| | `FastLanguageModel` | Load model with Unsloth optimizations | | `SFTTrainer` | Trainer for instruction tuning | | `SFTConfig` | Training hyperparameters | | `dataset_text_field` | Column containing formatted text | | Token ID 151668 | `</think>` boundary for Qwen3-Thinking models | ## Critical Environment Setup ```python import os from dotenv import load_dotenv load_dotenv() # Force text-based progress in Jupyter os.environ["TQDM_NOTEBOOK"] = "false" ``` ## Critical Import Order ```python # CRITICAL: Import unsloth FIRST for proper TRL patching import unsloth from unsloth import FastLanguageModel, is_bf16_supported # Then other imports from trl import SFTTrainer, SFTConfig from datasets import Dataset import torch ``` **Warning**: Importing TRL before Unsloth will disable optimizations and may cause errors. ## Dataset For
- Overview
- Quick Reference
- Critical Environment Setup
- Critical Import Order
- Dataset Formats
- Instruction-Response Format
- Chat/Conversation Format
- Using Chat Templates
- Thinking Model Format
- Unsloth SFT Setup
- Load Model
- Apply LoRA
- Training Configuration
- SFTTrainer Usage
ollama create mymodel -f Modelfile ollama run mymodel
What does the sft skill do?
Supervised Fine-Tuning with SFTTrainer and Unsloth. Covers dataset preparation, chat template formatting, training configuration, and Unsloth optimizations for 2x faster instruction tuning. Includes thinking model patterns.
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill sft --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
