Firefly  by yangjianxin1

LLM training tool for Qwen2.5, Llama3, Gemma, and other models

Created 2 years ago
6,549 stars

Top 7.8% on SourcePulse

GitHubView on GitHub
Project Summary

Firefly is a comprehensive, one-stop training tool for large language models, designed for researchers and developers looking to pre-train, fine-tune, and apply Direct Preference Optimization (DPO) to a wide array of popular open-source LLMs. It offers efficient training methods like LoRA and QLoRA, significantly reducing resource requirements and accelerating the fine-tuning process, making advanced LLM customization accessible even with limited hardware.

How It Works

Firefly supports full parameter training, LoRA, and QLoRA, enabling users to choose the most suitable method based on their available resources. It integrates with Unsloth for accelerated training and reduced memory usage, boasting up to 47.32% speedup and 39.13% memory savings. The tool aligns fine-tuning templates with various official chat models, ensuring compatibility and consistent performance across a broad spectrum of LLMs.

Quick Start & Requirements

  • Installation: pip install requirements.txt
  • Unsloth Integration: pip install git+https://github.com/unslothai/unsloth.git and other specified dependencies.
  • Prerequisites: PyTorch (version compatibility noted for specific models like Qwen1.5 and Gemma), Transformers, bitsandbytes, peft, xformers. CUDA is implicitly required for GPU acceleration.
  • Resources: QLoRA training for Llama3-8B requires as little as 7.75GB VRAM.
  • Documentation: Firefly GitHub Repository

Highlighted Details

  • Supports pre-training, SFT, and DPO for numerous LLMs including Llama3, Qwen2, Yi-1.5, and Gemma.
  • Achieved strong performance on the Open LLM Leaderboard with QLoRA-trained models, e.g., firefly-mixtral-8x7b scoring 70.16.
  • Open-sourced several fine-tuned models and curated large-scale instruction datasets (e.g., firefly-train-1.1M).
  • Offers LongQLoRA for efficient context length extension.

Maintenance & Community

  • Active development with recent updates including Unsloth integration for Qwen2.
  • Community support via WeChat groups and a Zhihu account.
  • Huggingface Repo

Licensing & Compatibility

  • The repository itself is likely under a permissive license (e.g., MIT, Apache 2.0, based on common practice, though not explicitly stated in the provided text).
  • Users must adhere to the base model's commercial license.
  • Open-sourced models may have limitations regarding harmful content generation.

Limitations & Caveats

Open-sourced models may produce factual inaccuracies, biased, or unethical content due to a lack of specific safety fine-tuning. Capabilities in coding and reasoning are noted as areas for improvement. Use is restricted to non-harmful purposes.

Health Check
Last Commit

10 months ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
36 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 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.