LLaMA-Factory  by hiyouga

Unified fine-tuning tool for 100+ LLMs & VLMs (ACL 2024)

created 2 years ago
55,253 stars

Top 0.4% on sourcepulse

GitHubView on GitHub
Project Summary

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

Highlighted Details

  • Supports over 100 LLMs and VLMs, including Llama, Mistral, Qwen, Gemma, and LLaVA.
  • Integrates advanced PEFT methods and optimizers like LoRA, QLoRA, GaLore, and BAdam.
  • Offers multimodal fine-tuning capabilities for vision-language tasks.
  • Provides experiment monitoring via LlamaBoard, TensorBoard, Wandb, and SwanLab.
  • Includes an OpenAI-style API for deployment with vLLM or SGLang backends.

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.

Health Check
Last commit

3 days ago

Responsiveness

1 day

Pull Requests (30d)
37
Issues (30d)
165
Star History
7,550 stars in the last 90 days

Explore Similar Projects

Starred by Ross Taylor Ross Taylor(Cofounder of General Reasoning; Creator of Papers with Code), Daniel Han Daniel Han(Cofounder of Unsloth), and
4 more.

open-instruct by allenai

0.2%
3k
Training codebase for instruction-following language models
created 2 years ago
updated 10 hours ago
Feedback? Help us improve.