AI/TLDR

Ludwig

Declarative deep learning: train and fine-tune AI models from a YAML config

Overview

Ludwig is a declarative deep learning framework that lets you train, fine-tune, and deploy AI models with a YAML config file instead of hand-written training code. You describe your input and output features and the kind of model you want, and Ludwig handles the rest.

It covers a wide range of tasks in one tool, from LLM instruction tuning to multimodal classifiers that mix text, numbers, and images, all the way to tabular prediction. Because the model is defined as configuration, you can swap encoders, adapters, and trainers by editing a few lines rather than rewriting code.

Ludwig is hosted by the Linux Foundation AI & Data and builds on PyTorch, Transformers, and Ray, so the same config can run locally or scale out to distributed training and deployment.

What it does

  • Define an entire model, its features, encoders, and trainer, in a single declarative YAML config
  • Fine-tune LLMs with LoRA, DoRA, QLoRA, and other PEFT adapters, plus 4-bit and 8-bit quantization
  • Alignment training without a separate reward model via DPO, KTO, ORPO, and GRPO
  • Build multimodal and tabular models that mix text, numbers, categories, images, audio, and timeseries inputs
  • Generate a starting config from a plain-English description with the generate_config command
  • Run predictions in batch or serve a model behind a REST API with a single command

Getting started

Ludwig requires Python 3.12+. Install it with pip, write a YAML config for your task, then train and serve with the command-line tool.

Install Ludwig

Install the core package, or add an extra for all dependencies or for LLM fine-tuning only.

bashbash
pip install ludwig           # core
pip install ludwig[full]     # all optional dependencies
pip install ludwig[llm]      # LLM fine-tuning only

Write a config

Describe the model in a YAML file. This example fine-tunes Llama-3.1 with a LoRA adapter on instruction and response text.

yamlyaml
model_type: llm
base_model: meta-llama/Llama-3.1-8B
adapter:
  type: lora
trainer:
  type: finetune
  epochs: 3
input_features:
  - name: instruction
    type: text
output_features:
  - name: response
    type: text

Train your model

Point the train command at your config and dataset to start training.

bashbash
ludwig train --config model.yaml --dataset my_data.csv

Predict or serve

Run batch predictions against a trained model, or launch a REST API to serve it.

bashbash
ludwig predict --model_path results/experiment_run/model --dataset new_data.csv
ludwig serve --model_path results/experiment_run/model

Commands and code are distilled from the project's own documentation — always check the official repo for the latest.

When to use it

  • Fine-tuning open LLMs like Llama-3.1 with LoRA or QLoRA on your own instruction data
  • Aligning a model with DPO, KTO, ORPO, or GRPO without standing up a separate reward model
  • Building multimodal classifiers that combine text reviews, numeric ratings, and product images
  • Training tabular prediction models, such as loan default scoring, from a CSV without writing training code
  • Serving a trained model behind a REST API for downstream applications

How Ludwig compares

Ludwig alongside other open-source fine-tuning frameworks tools AI/TLDR tracks, ranked by GitHub stars.

ToolStarsWhat it does
LLaMA-Factory★ 72.3kAn end-to-end training suite with a web UI that covers pre-training, supervised fine-tuning, and RLHF for hundreds of LLMs and multimodal models.
Unsloth★ 66.9kA library that speeds up LoRA and QLoRA fine-tuning while cutting memory use, aimed at training models on a single GPU.
PEFT★ 21.3kHugging Face's library of parameter-efficient fine-tuning methods such as LoRA, DoRA, and prompt tuning that train small adapters instead of full models.
FinGPT★ 20.5kFinGPT is an open-source project of financial LLMs, fine-tuned with LoRA on news and tweet data for tasks like sentiment analysis, relation extraction, and stock-move forecasting.
ms-swift★ 14.6kModelScope's framework for fine-tuning and deploying 600+ LLMs and 300+ multimodal models, supporting PEFT and full-parameter SFT, DPO, and GRPO.
LitGPT★ 13.4kAn open-source toolkit from Lightning AI to pretrain, finetune, and serve 20+ large language models, each written from scratch for speed and full control.
Axolotl★ 12.1kA config-driven tool for fine-tuning and post-training open LLMs that supports SFT, LoRA/QLoRA, DPO, GRPO, and multi-GPU training across many model families.
Ludwig★ 11.7kDeclarative deep learning: train and fine-tune AI models from a YAML config