llamafactory-docs

Guide LLaMA Factory fine-tuning, preference training, and deployment via CLI and YAML configs.

7|2|Updated Feb 25, 2026
One-click install
npx skills add https://github.com/wenerme/ai --skill llamafactory-docs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: llamafactory-docs
Source: https://github.com/wenerme/ai/tree/main/skills/llamafactory-docs
Command: npx skills add https://github.com/wenerme/ai --skill llamafactory-docs

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

LLaMA Factory documentation helps you configure and run fine-tuning, reinforcement learning, and deployment workflows without getting stuck on framework details and dataset formatting requirements.

Core Features & Use Cases

  • Training & RLHF/Preference Learning Guidance: Supports SFT, DPO/KTO/PPO/ORPO/SimPO/CPO family, reward modeling, and GRPO-style reinforcement learning workflows.
  • Dataset Preparation & Formats: Explains dataset requirements for alpaca/sharegpt-style data, including multimodal fields needed for images/videos/audios.
  • End-to-End Deployment Paths: Covers deployment and serving options such as OpenAI-style API and inference backends like vLLM and SGLang, plus the LLaMA Board Web UI.
  • Quick CLI Workflows: Provides command patterns for training, web UI, chat, and API serving using llamafactory-cli.

Quick Start

Ask for a complete setup and training plan by running: llamafactory-cli train examples/train_lora/llama3_lora_sft.yaml.

Frequently Asked Questions about llamafactory-docs

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

FAQPage Schema
How do I format datasets for LLM fine-tuning with LLaMA Factory?

LLM fine-tuning dataset formatting requires structuring data into alpaca or sharegpt formats. LLaMA Factory specifies exact field mappings, including dedicated multimodal fields for images, videos, and audios alongside standard text inputs.

Can I use DeepSpeed and FSDP for distributed training in LLaMA Factory?

Yes, LLaMA Factory supports distributed training using both DeepSpeed and FSDP. You can configure these frameworks within YAML configs to scale large language model training across multiple GPUs efficiently.

What's the best way to deploy a fine-tuned LLM using vLLM or SGLang?

The best way to deploy a fine-tuned LLM is using LLaMA Factory's inference backends like vLLM and SGLang. You can serve models via an OpenAI-style API or use the LLaMA Board Web UI for chat interfaces.

Does LLaMA Factory support multimodal training for images and videos?

Yes, LLaMA Factory supports multimodal training for images, videos, and audios. You need to configure the specific multimodal fields within your sharegpt or alpaca-style datasets to train models on these inputs.

How do I run LoRA and QLoRA fine-tuning using the CLI?

You can run LoRA and QLoRA fine-tuning by executing `llamafactory-cli train` with a YAML config file. This command processes the training pipeline using documented CLI entry points and specified architecture settings.

What preference learning algorithms are supported for LLM training?

LLaMA Factory supports multiple preference learning algorithms for LLM training, including DPO, KTO, PPO, ORPO, SimPO, CPO, and GRPO-style reinforcement learning workflows to align model behaviors.