llm-fine-tuning-anton-abyzov-specweave
LLM Fine-Tuning expert. Covers LoRA, QLoRA, PEFT, dataset preparation, Hugging Face Trainer/TRL, RLHF, DPO, quantization (GPTQ/AWQ/GGUF), model merging, distributed training with DeepSpeed/FSDP, hardware selection, and production deployment of fine-tuned models. Activates for: fine-tune, fine-tuning, LoRA, QLoRA, PEFT, RLHF, DPO, GPTQ, AWQ, GGUF, LLM training, model training, quantization, DeepSpeed.
npx skills add majiayu000/claude-skill-registry --skill llm-fine-tuning-anton-abyzov-specweave --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.
What it does
Provides expert guidance for fine-tuning large language models, focusing on parameter-efficient methods (LoRA/QLoRA/PEFT), dataset preparation, training pipelines (Hugging Face TRL), alignment techniques (RLHF, DPO), quantization (GPTQ/AWQ/GGUF), model merging, distributed training (DeepSpeed/FSDP), hardware considerations, and production deployment of fine-tuned models. Activates for: fine-tune, fine-tuning, LoRA, QLoRA, PEFT, RLHF, DPO, GPTQ, AWQ, GGUF, LLM training, model training, quantization, DeepSpeed.
How it works
- Describes LoRA implementation: freezing pretrained weights, injecting trainable A and B matrices, and selecting target modules (e.g., q_proj, k_proj, v_proj, o_proj, etc.).
- Provides configuration patterns for LoRA (lora_config) and shows how to apply it with get_peft_model, then prints trainable parameter counts.
- Illustrates QLoRA setup with 4-bit quantization, prepares model for k-bit training, and applies LoRA to enable training on consumer hardware.
- Details dataset preparation formats (instruction and chat templates) and a data quality checklist.
- Covers Hugging Face TRL training: SFTTrainer usage, SFTConfig parameters, and saving the adapter after training.
- Includes hyperparameter guidance for training (learning rate, epochs, batch size, warmup, weight decay, max seq length, LoRA rank).
- Describes RLHF and DPO workflows: DPO training with prompt/chosen/rejected data, and PPO-based RLHF with reward modeling and policy optimization steps.
- Explains quantization formats (BF16, GPTQ, AWQ, GGUF) and provides concrete code snippets for quantization and conversion.
- Outlines model merging with mergekit, including a sample mergekit-config.yaml and command to run merge.
- Details distributed training options: DeepSpeed ZeRO configuration and usage, and FSDP with transformer-wrapped layer considerations.
When to use it
Use when you need to fine-tune a model to acquire new behavior or domain knowledge, especially when aiming to minimize training costs with LoRA/QLoRA, quantize for deployment, or deploy in distributed environments. It activates for fine-tune, fine-tuning, LoRA, QLoRA, PEFT, RLHF, DPO, GPTQ, AWQ, GGUF, LLM training, model training, quantization, DeepSpeed.
What it can touch
- Tools and code patterns: mentions using peft, transformers, datasets, trl, mergekit, and specific model/tokenizer APIs. References to file-level actions such as saving adapters and quantized models.
- Commands and files: shows how to run mergekit, how to quantize with GPTQ/AWQ/GGUF, and how to launch DeepSpeed with a deepspeed_config.json.
- No filesystem operations beyond saving models/adapters are explicitly shown beyond the provided code blocks.
Caveats
- License: MIT.
- The skill provides instructional code and configurations but does not guarantee model outcomes or deployment success; it presents steps, configurations, and heuristics.
# LLM Fine-Tuning Expert guidance for fine-tuning large language models efficiently. Covers parameter-efficient methods, dataset preparation, training pipelines, alignment techniques, quantization, and production deployment. ## When to Fine-Tune: Decision Framework ### Fine-Tune vs RAG vs Prompt Engineering | Approach | Best When | Cost | Time | Maintenance | |----------|-----------|------|------|-------------| | Prompt Engineering | Behavior is achievable with instructions | Lowest | Minutes | Low | | RAG | Model needs access to specific knowledge | Medium | Hours | Medium (index updates) | | Fine-Tuning | Model needs new behavior/style/format | High | Hours-Days | High (retraining) | | Fine-Tune + RAG | Need both new behavior AND specific knowledge | Highest | Days | Highest | ### Fine-Tuning Decision Checklist Choose fine-tuning when: - [ ] Prompt engineering cannot achieve the desired output format or style - [ ] RAG retrieval adds too much latency or cost for production - [ ] You need consistent behavior that prompt instructions cannot guarantee - [ ] You have 500+ high-quality training examples - [ ] The task is repetitive and well-defined (classification, extraction, formatt
- When to Fine-Tune: Decision Framework
- Fine-Tune vs RAG vs Prompt Engineering
- Fine-Tuning Decision Checklist
- LoRA (Low-Rank Adaptation)
- How LoRA Works
- Basic LoRA Configuration
- LoRA Rank Selection Guide
- Target Module Selection
- QLoRA: Fine-Tuning on Consumer Hardware
- Hardware Requirements for QLoRA
- Dataset Preparation
- Instruction Format
- Chat Template Format
- Data Quality Checklist
Convert HF model to GGUF python llama.cpp/convert_hf_to_gguf.py \ Quantization levels: q2_k - 2-bit (smallest, lowest quality) q4_0 - 4-bit (fast, decent quality) q4_k_m - 4-bit k-quant medium (best balance) q5_k_m - 5-bit k-quant medium (good quality) q6_k - 6-bit (high quality) q8_0 - 8-bit (near lossless) Run merge
What does the llm-fine-tuning-anton-abyzov-specweave skill do?
LLM Fine-Tuning expert. Covers LoRA, QLoRA, PEFT, dataset preparation, Hugging Face Trainer/TRL, RLHF, DPO, quantization (GPTQ/AWQ/GGUF), model merging, distributed training with DeepSpeed/FSDP, hardware selection, and production deployment of fine-tuned models. Activates for: fine-tune, fine-tuning, LoRA, QLoRA, PEFT, RLHF, DPO, GPTQ, AWQ, GGUF, LLM training, model training, quantization, DeepSpeed.
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill llm-fine-tuning-anton-abyzov-specweave --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.
