llama-factory

Guides fine-tuning of large language models using LLaMA-Factory with LoRA, QLoRA, and WebUI workflows.

2|Updated Jan 26, 2026
One-click install
npx skills add https://github.com/Nzettodess/Awesome-Agent-Skills --skill llama-factory-nzettodess
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: llama-factory
Source: https://github.com/Nzettodess/Awesome-Agent-Skills/tree/main/Skills/Agentic%20AI%20Development/AI-research-SKILLs-1.1.0/03-fine-tuning/llama-factory
Command: npx skills add https://github.com/Nzettodess/Awesome-Agent-Skills --skill llama-factory-nzettodess

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Fine-tuning large language models requires navigating complex training configurations, quantization methods, and distributed setups. This Skill provides expert guidance from official LLaMA-Factory documentation to configure, train, evaluate, and deploy fine-tuned models without deep framework expertise. ## Core Features & Use Cases - Training Configuration Guidance: Covers supervised fine-tuning, pre-training, reward modeling, PPO, DPO, and KTO with LoRA, QLoRA (2-8 bit), GaLore, and BAdam methods. - WebUI No-Code Workflows: Explains zero-code fine-tuning, evaluation, chat, and model export through the Gradio-based WebUI. - Infrastructure Support: Details distributed training with DeepSpeed and FSDP, NPU (Ascend) setup, quantization (GPTQ, AWQ, bitsandbytes), and monitoring via TensorBoard, Wandb, and SwanLab. - Use Case: A developer wants to fine-tune Qwen on a custom Alpaca-format dataset using 4-bit QLoRA on a single GPU, then merge the adapter and export a quantized model for deployment. ## Quick Start Ask how to fine-tune a Llama model with LoRA on a custom dataset using LLaMA-Factory and receive the exact YAML configuration and CLI commands.

Frequently Asked Questions about llama-factory

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

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

Create a YAML config specifying model_name_or_path, stage sft, finetuning_type lora, your dataset, and template, then run llamafactory-cli train with that config. Example configs like llama3_lora_sft.yaml are provided in the examples directory.

How to fine-tune LLMs without writing code?▼

LLaMA-Factory provides a WebUI launched with llamafactory-cli webui that supports zero-code fine-tuning. It includes four interfaces for training, evaluation and prediction, chat, and model export.

Does LLaMA-Factory support 4-bit QLoRA training?▼

Yes, LLaMA-Factory supports 2/3/4/5/6/8-bit QLoRA fine-tuning using quantization methods including bitsandbytes, HQQ, and EETQ. Set quantization_method and quantization_bit in your training configuration.

What dataset formats does LLaMA-Factory support?▼

LLaMA-Factory supports Alpaca and ShareGPT formats for supervised fine-tuning, preference datasets for DPO and reward modeling, KTO datasets, and multimodal datasets with images, video, or audio. Custom datasets must be registered in dataset_info.json.

Can LLaMA-Factory run on Ascend NPU instead of GPU?▼

Yes, LLaMA-Factory supports Huawei Ascend 910b NPUs via torch-npu, installable by Docker or pip. Replace CUDA_VISIBLE_DEVICES with ASCEND_RT_VISIBLE_DEVICES to select NPU cards for training and inference.

Why should I not merge LoRA adapters from a quantized model?▼

Merging LoRA adapters requires an unquantized base model because quantization alters weight precision, causing merge errors or degraded output. Use the original pre-trained model path and omit quantization settings when merging.