llamafactory
Unified Efficient Fine-Tuning of 100+ LLMs
What it is and what it does
LLaMA Factory is a unified framework for fine-tuning large language models, designed to reduce the friction of adapting pre-trained models to specific tasks or domains. It abstracts away boilerplate training code and provides both command-line and web UI entry points, letting users configure training runs through YAML or the Gradio interface without writing custom training loops. The package bundles support for multiple training paradigms—supervised fine-tuning, reward modeling, reinforcement learning methods like DPO and PPO, and quantization-aware training—across a broad range of model families.
The package depends on a substantial ecosystem: PyTorch, Hugging Face Transformers, PEFT for parameter-efficient tuning, and supporting libraries for data handling, optimization, and inference. It integrates with experiment tracking tools (Weights & Biases, MLflow, SwanLab), model hubs (Hugging Face, ModelScope), and inference servers (vLLM, SGLang). The framework targets researchers and practitioners who want to customize LLMs without managing low-level training infrastructure, and it is actively maintained with support for newly released model architectures.
Use it for:
- Fine-tune a Qwen or Llama model on domain-specific instruction data using LoRA to reduce memory footprint
- Adapt a vision-language model like LLaVA for custom image understanding tasks via the web UI
- Run reward modeling and DPO training on a base model to align outputs with human preferences
- Quantize and fine-tune a large model with QLoRA to fit on consumer GPUs
- Deploy a fine-tuned model with OpenAI-compatible API endpoints using vLLM integration
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
LLaMA Factory provides a unified framework for fine-tuning 100+ large language models through CLI and web UI, supporting multiple training methods and model architectures with minimal setup.
Yes, if you need to fine-tune LLMs without writing training code. The framework is actively maintained, has no known vulnerabilities, and is used by major organizations (Amazon, NVIDIA, Aliyun). The Apache-2.0 license is permissive. Install friction is low, but you must have Python 3.11+, GPU resources (or significant CPU), and be comfortable with the 31-dependency stack. Start with the free Colab notebook or PAI-DSW trial to evaluate before committing to local setup.
Install
llamafactory on PyPI
pip
pip install llamafactoryuv
uv add llamafactorypoetry
poetry add llamafactoryInstalling llamafactory
Before you install
Low friction installation with a pure Python wheel. Active maintenance with recent releases; 74099 repository stars and last commit on 2026-08-13 signal sustained development. Requires Python 3.11+ and 31 runtime dependencies including torch, transformers, and peft—a substantial but typical stack for deep learning work.
License in practice
Apache-2.0 permissive license allows commercial and private use with minimal restrictions, making it suitable for both research and production deployments.
Quickstart
pip install llamafactory
from llamafactory.cli import main
main()
Requires Python 3.11 or later; torch and transformers must be installed; GPU or substantial CPU resources needed for actual model training.
Verify before relying
- Exact model count and which specific models are supported beyond the 100+ claim in the summary
- Performance benchmarks or training speed comparisons across different quantization methods
- Memory requirements for fine-tuning models of different sizes
- Whether the web UI (LLaMA Board) can run on CPU-only systems
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.11.0) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 31 — accelerate, av, datasets, einops, fastapi, fire, gradio, hf-transfer, matplotlib, modelscope, numpy, omegaconf, packaging, pandas, peft, protobuf, pydantic, pyyaml, safetensors, scipy, sentencepiece, sse-starlette, tiktoken, torch, torchaudio, torchdata, torchvision, transformers, trl, tyro |
| Maintenance | actively maintained — 76 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 101,638/month — #12,922 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: llamafactory-0.9.5-py3-none-any.whl
Keywords: AI, ChatGPT, DeepSeek, GPT, LLM, Llama, Pytorch, Transformer
Tags
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to…
permissive · top 100 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
hf-xethf-xet provides chunk-based deduplication and…
permissive · top 1,000 on PyPI
tokenizersTokenizers converts raw text into token…
permissive · top 1,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
unsloth-zooUnsloth Zoo provides utilities for fine-tuning…
copyleft · top 5,000 on PyPI
ms-swiftms-swift is a framework for training,…
permissive · top 15,000 on PyPI
llama-modelsProvides a CLI and Python interface to…
unclear · top 15,000 on PyPI
google-tunixTunix is a JAX-based library for post-training…
permissive · top 15,000 on PyPI
peftPEFT implements parameter-efficient fine-tuning…
permissive · top 5,000 on PyPI
modelscopeModelScope provides unified Python interfaces…
permissive · top 5,000 on PyPI
liger-kernelLiger Kernel provides optimized Triton kernels…
permissive · top 15,000 on PyPI
ipex-llmAccelerates large language model inference on…
permissive · top 15,000 on PyPI
xgrammarConstrains LLM text generation to follow…
permissive · top 5,000 on PyPI