Unified fine-tuning tool for 100+ LLMs & VLMs (ACL 2024)
Top 0.4% on sourcepulse
LLaMA-Factory provides a unified and efficient framework for fine-tuning over 100 large language and vision-language models. It caters to researchers and developers looking to adapt LLMs for various tasks, offering both a zero-code CLI and a Gradio-based Web UI for ease of use. The project aims to simplify the complex process of LLM fine-tuning, supporting a wide array of models and training methodologies.
How It Works
The framework supports a broad spectrum of fine-tuning techniques, including continuous pre-training, supervised fine-tuning (SFT), reward modeling, and preference optimization methods like DPO, KTO, and ORPO. It integrates advanced optimization algorithms such as GaLore, BAdam, and APOLLO, alongside practical tricks like FlashAttention-2 and Unsloth for enhanced performance and reduced memory usage. This comprehensive approach allows for efficient adaptation of models using methods ranging from full parameter tuning to various forms of parameter-efficient fine-tuning (PEFT) like LoRA and QLoRA, supporting quantization down to 2-bit.
Quick Start & Requirements
git clone --depth 1 https://github.com/hiyouga/LLaMA-Factory.git && cd LLaMA-Factory && pip install -e ".[torch,metrics]"
Highlighted Details
Maintenance & Community
The project is actively maintained with frequent updates, including support for new models and training techniques. It has a growing community, with links to user groups and active development.
Licensing & Compatibility
The repository is licensed under Apache-2.0. Model weights are subject to their respective licenses. This permissive license allows for commercial use and integration into closed-source projects.
Limitations & Caveats
While extensive, the sheer number of supported models and configurations may lead to complex dependency management. Users might need to carefully manage specific versions of libraries like transformers
for certain models, as noted in the documentation. Installation on Windows for specific features like FlashAttention-2 requires manual compilation.
3 days ago
1 day