fine-tuning-expert

Fine-tune LLMs with LoRA, QLoRA, and PEFT using Hugging Face training workflows.

Updated Mar 9, 2026
One-click install
npx skills add https://github.com/ArMaTeC/Redball --skill fine-tuning-expert-armatec
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: fine-tuning-expert
Source: https://github.com/ArMaTeC/Redball/tree/main/.devin/skills/fine-tuning-expert
Command: npx skills add https://github.com/ArMaTeC/Redball --skill fine-tuning-expert-armatec

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires transformers, peft, trl, datasets, bitsandbytes, torch, accelerate, and includes references (resource) components.

What problem does it solve? Adapting large language models to specific tasks requires navigating dataset formatting, PEFT method selection, hyperparameter tuning, evaluation, and deployment optimization, which is error-prone without structured guidance. ## Core Features & Use Cases - LoRA/QLoRA Training: Configure parameter-efficient adapters with rank, alpha, and target module selection for models from 7B to 70B parameters. - Dataset Preparation: Validate, deduplicate, filter, and split JSONL training data in Alpaca or ShareGPT formats with quality checks. - Evaluation & Deployment: Benchmark with perplexity, BLEU, ROUGE, and LLM-as-judge, then merge adapters, quantize with GPTQ/AWQ/GGUF, and serve via vLLM or TGI. - Use Case: Fine-tune Llama 3.1 8B on a custom instruction dataset using QLoRA on a single 24GB GPU, evaluate against the base model, and deploy a merged 4-bit quantized model behind an OpenAI-compatible API. ## Quick Start Ask the assistant to fine-tune a Llama model on your JSONL instruction dataset using QLoRA and produce the training, evaluation, and deployment scripts.

Frequently Asked Questions about fine-tuning-expert

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

FAQPage Schema
How do I fine-tune a Llama model with LoRA?▼

Load the base model with transformers, apply a LoraConfig with rank 16 and alpha 32 targeting attention projections, then train with SFTTrainer from TRL. Save only the adapter weights with save_pretrained after training completes.

What is the difference between LoRA and QLoRA?▼

QLoRA loads the base model in 4-bit quantization via BitsAndBytesConfig while training LoRA adapters, cutting memory from roughly 18GB to 6GB for an 8B model. Use QLoRA when GPU memory is constrained; use LoRA when memory allows full-precision base weights.

How much training data do I need for fine-tuning?▼

Instruction following tasks need at least 1,000 examples with 5,000-10,000 recommended, while classification can work with 100 per class. Domain adaptation benefits from 5,000 or more high-quality examples.

Why is my fine-tuning loss not decreasing?▼

A stagnant loss usually means the learning rate is too low or too high, or the LoRA rank is insufficient for the task. Verify adapter parameters require gradients, try adjusting the learning rate by 10x, or increase rank from 16 to 32.

How do I deploy a fine-tuned LoRA model?▼

Merge the adapter into the base model with merge_and_unload, then optionally quantize with GPTQ, AWQ, or export to GGUF. Serve the merged model with vLLM for high-throughput inference or an OpenAI-compatible API endpoint.

Can I combine multiple LoRA adapters into one model?▼

Yes, load multiple adapters with PeftModel and combine them using add_weighted_adapter with custom weights for each adapter. The combined adapter can then be merged into the base model for deployment.