LLamaTuner  by jianzhnie

LLM fine-tuning toolkit for diverse models

Created 2 years ago
613 stars

Top 53.6% on SourcePulse

GitHubView on GitHub
Project Summary

LLamaTuner is an open-source toolkit designed for efficient fine-tuning and deployment of Large Language Models (LLMs) and Vision-Language Models (VLMs). It supports a wide array of popular LLM architectures and offers various training methodologies, making it suitable for researchers and developers looking to customize models on diverse hardware, including single consumer GPUs.

How It Works

LLamaTuner leverages advanced techniques like QLoRA for memory-efficient fine-tuning, enabling training of large models on limited hardware. It integrates high-performance operators such as FlashAttention and Triton kernels to boost training throughput. The toolkit also supports DeepSpeed for distributed training and ZeRO optimizations, allowing for scalable fine-tuning of models exceeding 70B parameters across multiple nodes. Its flexible data pipeline accommodates various dataset formats for continuous pre-training, instruction fine-tuning, and agent fine-tuning.

Quick Start & Requirements

  • Install: pip install -e . (after cloning the repository)
  • Prerequisites: Python >= 3.10, PyTorch >= 2.2.0, Transformers >= 4.41.0, Datasets >= 2.19.1, Accelerate >= 0.30.1, PEFT >= 0.11.1, TRL >= 0.8.6. Optional: CUDA >= 12.2, DeepSpeed >= 0.14.0, bitsandbytes >= 0.43.1, vLLM >= 0.4.2, flash-attn >= 2.5.8.
  • Hardware: QLoRA fine-tuning of a 7B model requires as little as 6GB VRAM (4-bit quantization). Full fine-tuning of a 70B model requires ~1200GB VRAM.
  • Links: Getting Started, Supported Models, Data Preprocessing

Highlighted Details

  • Supports fine-tuning over 30 LLM architectures including Llama 3, Mistral, Qwen, and Phi-3.
  • Offers a comprehensive suite of training approaches: Pre-training, Supervised Fine-Tuning (SFT), Reward Modeling, PPO, DPO, KTO, and ORPO.
  • Includes support for Vision-Language Models (VLMs) like LLaVA.
  • Provides a model zoo with pre-trained adapters and inference capabilities.

Maintenance & Community

The project is actively maintained by jianzhnie and acknowledges contributions from the Hugging Face team and various open-source projects. Community engagement is encouraged via WeChat.

Licensing & Compatibility

LLamaTuner is released under the Apache 2.0 license, which permits commercial use and modification.

Limitations & Caveats

While the toolkit is highly efficient, achieving optimal performance may require specific hardware configurations and careful dependency management. Some datasets may require Hugging Face Hub login for access.

Health Check
Last Commit

7 months ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
4 stars in the last 30 days

Explore Similar Projects

Starred by Casper Hansen Casper Hansen(Author of AutoAWQ), Yineng Zhang Yineng Zhang(Inference Lead at SGLang; Research Scientist at Together AI), and
5 more.

xtuner by InternLM

0.5%
5k
LLM fine-tuning toolkit for research
Created 2 years ago
Updated 1 day ago
Starred by Andrej Karpathy Andrej Karpathy(Founder of Eureka Labs; Formerly at Tesla, OpenAI; Author of CS 231n), Stefan van der Walt Stefan van der Walt(Core Contributor to scientific Python ecosystem), and
12 more.

litgpt by Lightning-AI

0.1%
13k
LLM SDK for pretraining, finetuning, and deploying 20+ high-performance LLMs
Created 2 years ago
Updated 5 days ago
Starred by Tobi Lutke Tobi Lutke(Cofounder of Shopify), Andrej Karpathy Andrej Karpathy(Founder of Eureka Labs; Formerly at Tesla, OpenAI; Author of CS 231n), and
36 more.

unsloth by unslothai

0.6%
46k
Finetuning tool for LLMs, targeting speed and memory efficiency
Created 1 year ago
Updated 13 hours ago
Starred by Tony Lee Tony Lee(Author of HELM; Research Engineer at Meta), Lysandre Debut Lysandre Debut(Chief Open-Source Officer at Hugging Face), and
24 more.

LLaMA-Factory by hiyouga

1.1%
58k
Unified fine-tuning tool for 100+ LLMs & VLMs (ACL 2024)
Created 2 years ago
Updated 2 days ago
Feedback? Help us improve.