Skip to main content
Training & Fine-tuningStart here

LLaMA-Factory

hiyouga / LLaMA-Factory

One setup for fine-tuning: LoRA, QLoRA, full-parameter and DPO, with a WebUI and model export.

76.1k stars 9394 forks Python Language Apache-2.0 License Last push 2026-11-19

Why choose it

  • Data, training and export live in one configuration, so a first fine-tune does not require stitching several libraries together.
  • Supports many open model architectures; switching models does not mean rewriting the training loop.
  • Ships a WebUI and ready-made recipes, suitable for getting a run working before moving to scripts.

Not for

For very large pretraining or maximum multi-node throughput, look at Megatron-style stacks and TorchTitan.
Non-standard custom architectures still require changes to data templates and model adapters.

Minimum setup

  1. Pick an official example in the same model family and confirm the data format and chat template.
  2. Run LoRA on 100–500 samples while recording peak VRAM and loss; do not start with full-parameter training.
  3. Export merged weights or an adapter, compare against the base model on the same eval set, then decide whether to add data.

Dependencies and cost

Python + PyTorch/CUDA; VRAM depends on the model, sequence length and quantisation; needs weight download access.

License and usage boundaries

Code is Apache-2.0; model weights, datasets and generated content carry their own terms — check each before commercial use.

Open source is not automatically commercial-use friendly: GPL / AGPL are copyleft; code, model and output licenses are separate. Read the LICENSE and model card before launch, and involve legal when needed.

Alternatives and neighbors

  • Axolotl — Production,One YAML config for fine-tuning: LoRA, QLoRA, full-parameter, DPO, GRPO and multi-node training.
  • Unsloth — Start here,Accelerated QLoRA/LoRA fine-tuning: Triton kernels cut VRAM use and training time for 7B–70B models.

Next steps

  • Open GitHub and read the README, LICENSE, latest release and issues first.
  • Make an onboarding checklist for deployment dependencies, VRAM, data, network and permissions.
  • Run a small sample first, then decide on production; never start with production data.

GitHub repository ↗ Docs ↗ Add to compare

Snapshot: stars / forks / language / license / pushed_at come from the GitHub API snapshot on 2026-11-20; later changes are not written back. Tags and “fit / not fit” are editorial judgments, not GitHub metadata.
No endorsement: this site only indexes and flags risks; it does not audit code, guarantee security or make license decisions for you. Review repository scripts and model weights yourself.