An open source framework for fine-tuning 100+ language and vision-language models from a CLI or a web UI
open sourceApache-2.0free
LlamaFactory (formerly LLaMA-Factory) fine-tunes more than 100 large language and vision-language models, among them Llama, Qwen, Mistral, DeepSeek, Gemma and GLM, without writing training code: you pick a model, dataset and method in its LlamaBoard web UI or a YAML file for its llamafactory-cli. It covers continued pre-training, supervised fine-tuning, reward modelling, PPO, DPO, KTO, ORPO and SimPO, with full, freeze, LoRA and 2- to 8-bit QLoRA tuning, and serves the result through an OpenAI-style API with vLLM or SGLang as the inference backend. It runs on NVIDIA and AMD GPUs and on Huawei Ascend NPUs.
Problems it solves
- fine-tune an open model like Qwen or Llama on my own data without writing a training loop
- try LoRA or QLoRA fine-tuning on a single GPU with limited memory
- run DPO or PPO preference tuning on an open LLM from a web UI
- fine-tune a model on Huawei Ascend NPUs
Features
- Fine-tune 100+ LLMs and vision-language models without writing training code
- LlamaBoard web UI and llamafactory-cli driven by YAML configs
- Pre-training, SFT, reward modelling, PPO, DPO, KTO, ORPO and SimPO
- Full, freeze, LoRA and 2/3/4/5/6/8-bit QLoRA tuning
- GaLore, BAdam, APOLLO, DoRA, LongLoRA, PiSSA and other memory-saving methods
- OpenAI-style API with vLLM or SGLang for inference
- NVIDIA CUDA, AMD ROCm and Ascend NPU support
- Experiment tracking with TensorBoard, Weights & Biases, MLflow and SwanLab
Limitations
- Needs Python 3.11 or later1
- Fine-tuning needs a GPU or NPU with enough memory: the README estimates 6 GB for 4-bit QLoRA of a 7B model and 120 GB for its full 32-bit fine-tuning1
- Model weights stay under their own licences, which the README asks you to follow1
Capabilities
| Has an API | plan not known |
|---|---|
| Has a command line tool | plan not known |
Alternatives
The same job
These do what LlamaFactory does.
- Axolotl A free and open source framework for fine-tuning and post-training large language models
- Unsloth Run and train AI models on your own local hardware via an open-source UI
- TRL A comprehensive library to post-train foundation models
- ms-swift Fine-tune, align, evaluate, quantize and deploy 600+ LLMs and 400+ multimodal models
- Oumi Fine-tune, evaluate and deploy open LLMs and agents
- Fireworks AI Run, ensemble and train open models on one platform