Ludwig
v0.15 — GRPO, torchao, multi-adapter PEFT

Train anything.
One config file.

Ludwig is the open-source declarative deep learning framework for building, fine-tuning, and deploying custom models — across tabular data, text, images, and audio — without writing training loops.

$ pip install ludwig
10k+ GitHub Stars
30+ Modalities & Tasks
Zero Boilerplate
Apache 2 License
LF AI Hosted Project

ML without the
engineering overhead.

Most ML projects spend 80% of their time on infrastructure — data loaders, training loops, distributed setup, export pipelines. Ludwig inverts this. You describe your model in YAML. Ludwig builds and runs it.

You get the simplicity of AutoML with the flexibility of raw PyTorch. Expert-level control is always one config field away — but you never have to touch it if you don't need to.

🐧 Linux Foundation AI & Data 🔥 Built on PyTorch 🤗 HuggingFace Native ⚡ Ray Ready
model.yaml — sentiment classifier
# describe your model in YAML
input_features:
  - name: review_text
    type: text
    encoder:
      type: bert

output_features:
  - name: sentiment
    type: category

trainer:
  epochs: 5
  learning_rate: 2.0e-5
terminal
$ ludwig train --config model.yaml \
               --dataset reviews.csv

✓ Preprocessing ── 12,500 rows
✓ Training ──────── epoch 5/5
✓ Test accuracy ─── 94.2%
✓ Saved ─────────── results/

Everything you need.
Nothing you don't.

From prototype to production — Ludwig handles the full ML lifecycle without requiring you to write infrastructure code.

⚙️

Declarative Configuration

Define your entire ML pipeline — preprocessing, encoders, architecture, training, HPO — in a single validated YAML file. No boilerplate training loops.

YAMLPydantic v2Schema validation
🧬

Multi-Modal & Multi-Task

Mix tabular features, raw text, images, audio, and time series in a single model. Train multiple outputs simultaneously. No other framework makes this as seamless.

TextImageAudioTabular
🦙

LLM Fine-Tuning Suite

SFT, DPO, KTO, ORPO, and GRPO in one framework. LoRA, QLoRA, DoRA, VeRA with 4-bit quantization. Merge multi-adapter models with TIES, DARE, or SVD.

LoRAQLoRAGRPODPO
☁️

Scale Without Code Changes

Add a backend: ray line and your local job becomes a distributed Ray cluster job. Zero rewrites, zero surprises.

RayDeepSpeedFSDPKubeRay
🔍

Hyperparameter Optimization

Built-in HPO with Ray Tune and Optuna. Auto, TPE, GP, and CMA-ES samplers. SQLite or PostgreSQL persistence. No external orchestration needed.

OptunaRay TuneAutoML
🚀

Production-Ready Serving

One command to serve your model as a REST API. Export to SafeTensors, ONNX, or torch.export. Prebuilt Docker images for CPU, GPU, Ray. Upload to HuggingFace Hub.

FastAPIvLLMONNXDocker
📊

Rich Experiment Tracking

First-class integrations with W&B, MLflow, TensorBoard, Comet ML, and Aim. Auto-generated training reports and visualizations out of the box.

W&BMLflowTensorBoard
🧩

Fully Extensible

Plug in custom encoders, decoders, combiners, loss functions, and metrics. Use any HuggingFace model as a backbone. Ludwig is a framework, not a cage.

Custom encodersHuggingFacePyTorch
🤖

AutoML & Explainability

One-line auto_train() finds a strong baseline automatically. Built-in feature importance, model explainability, and rich visualizations help you understand what the model learned.

AutoMLSHAPVisualizations

Every modality. One framework.

Ludwig handles data preprocessing for every feature type automatically — no custom pipelines required.

📝

Text

BERT, GPT-2, LLaMA, any HuggingFace model as encoder

🔢

Tabular

Numeric, categorical, binary, set, bag — all handled

🖼️

Image

ResNet, EfficientNet, DINOv2, ViT — classification & segmentation

🔊

Audio

Wave2Vec, raw audio encoders, speech recognition

📈

Time Series

Forecasting with efficient O(window) preprocessing

🗺️

Geospatial

H3 hexagonal indexing, location features

🧮

Vectors

Dense embedding vectors and learned representations

📅

Date / Time

Automatic cyclic encoding of temporal features

🔗

Sequences

Token sequences, genomic data, protein chains, discrete symbols

🔬

Anomalies

Deep SVDD, Deep SAD, DROCC — unsupervised anomaly scoring

Fine-tune any LLM.
No GPU expertise needed.

Ludwig gives you the complete alignment stack — from supervised instruction tuning to reward-model-free RL — in a single YAML file. Run Llama, Mistral, Qwen, or any HuggingFace model with 4-bit QLoRA on a single consumer GPU.

New in v0.15: GRPO (Group Relative Policy Optimization) for reward-model-free RLHF. Train policy models directly from rule-based or custom reward signals.

Supervised Fine-Tuning DPO KTO ORPO GRPO (new) LoRA / DoRA / VeRA 4-bit QLoRA Multi-adapter merge Sequence packing Paged optimizers vLLM serving HF Hub export
llm_finetune.yaml — QLoRA instruction tuning
model_type: llm
base_model: meta-llama/Llama-3.1-8B

quantization:
  bits: 4

adapter:
  type: lora
  r: 16
  alpha: 32

input_features:
  - name: instruction
    type: text

output_features:
  - name: response
    type: text

trainer:
  type: finetune
  epochs: 3
  learning_rate: 1.0e-4
  batch_size: 1
  gradient_accumulation_steps: 16
terminal
$ ludwig train --config llm_finetune.yaml \
               --dataset "ludwig://alpaca"
$ ludwig serve --model_path results/
scale to Ray — 4 extra lines
input_features:
  - name: text
    type: text
output_features:
  - name: label
    type: category
trainer:
  epochs: 10

# ↓ add this to go distributed
backend:
  type: ray
  trainer:
    use_gpu: true
    num_workers: 8
    strategy: fsdp

Laptop to cluster.
Zero rewrites.

Ludwig's backend config key transparently handles data sharding, gradient sync, and checkpointing — without changing your model definition.

local

Develop on your machine

Train locally with CPU or GPU. Fast iteration, no setup.

ray

Scale to Ray cluster

One config change. DDP, FSDP, or DeepSpeed — your call.

k8s

Deploy on Kubernetes

Native KubeRay integration for production cluster scheduling.

Works with your stack.

🤗 HuggingFace Transformers ⚡ Ray 🔥 PyTorch 📊 Weights & Biases 📈 MLflow 📉 TensorBoard 🧪 Optuna 🎛 Ray Tune 🐳 Docker ☸️ Kubernetes 🚀 vLLM 🔗 DeepSpeed 📦 ONNX 🛡️ SafeTensors 🌊 Dask 🏹 PyArrow ☄️ Comet ML 🎯 Aim

Up and running in minutes.

Install Ludwig, pick a use case, run one command. That's it.

text_classifier.yaml — sentiment analysis with BERT
input_features:
  - name: review_content
    type: text
    encoder:
      type: bert   # or: embed, roberta, deberta, xlnet…

output_features:
  - name: recommended
    type: binary

trainer:
  epochs: 5
  learning_rate: 2.0e-5

─────────────────────────────────────────────
$ pip install ludwig[text]
$ ludwig train --config text_classifier.yaml --dataset rotten_tomatoes.csv
$ ludwig predict --model_path results/ --dataset new_reviews.csv
$ ludwig serve --model_path results/
llm_sft.yaml — QLoRA instruction tuning on Llama-3
model_type: llm
base_model: meta-llama/Llama-3.1-8B-Instruct

quantization:
  bits: 4   # 4-bit QLoRA — runs on a single consumer GPU

adapter:
  type: lora
  r: 16
  alpha: 32

prompt:
  template: |
    ### Instruction:
    {instruction}
    ### Response:

input_features:
  - name: instruction
    type: text

output_features:
  - name: response
    type: text

trainer:
  type: finetune
  epochs: 3
  learning_rate: 1.0e-4
  batch_size: 1
  gradient_accumulation_steps: 16

─────────────────────────────────────────────
$ pip install ludwig[llm]
$ ludwig train --config llm_sft.yaml --dataset "ludwig://alpaca"
$ ludwig upload_to_hf_hub --model_path results/ --repo my-org/my-model
grpo.yaml — reward-model-free RL alignment (new in v0.15)
model_type: llm
base_model: Qwen/Qwen2.5-7B-Instruct

adapter:
  type: lora

quantization:
  bits: 4

input_features:
  - name: prompt
    type: text

output_features:
  - name: response
    type: text

trainer:
  type: grpo            # Group Relative Policy Optimization
  reward_fn: accuracy   # custom or built-in reward signal
  num_generations: 8
  epochs: 1
  learning_rate: 5.0e-6

─────────────────────────────────────────────
$ pip install ludwig[llm]
$ ludwig train --config grpo.yaml --dataset math_problems.csv
multimodal.yaml — product classification (image + text + tabular)
# mix any modalities — Ludwig handles the rest
input_features:
  - name: product_image
    type: image
    encoder:
      type: dinov2

  - name: description
    type: text
    encoder:
      type: bert

  - name: price
    type: number

  - name: brand
    type: category

output_features:
  - name: category
    type: category
  - name: is_premium
    type: binary     # multi-task: two outputs at once

trainer:
  epochs: 10

─────────────────────────────────────────────
$ pip install "ludwig[text,vision]"
$ ludwig train --config multimodal.yaml --dataset products.csv
image_classifier.yaml — image classification with EfficientNet
input_features:
  - name: image_path
    type: image
    encoder:
      type: efficientnet  # or: resnet, vit, dinov2, stacked_cnn
      model_variant: b4
      use_pretrained: true
      trainable: true

output_features:
  - name: label
    type: category

trainer:
  epochs: 20
  learning_rate: 1.0e-4
  learning_rate_scheduler:
    decay: cosine

─────────────────────────────────────────────
$ pip install "ludwig[vision]"
$ ludwig train --config image_classifier.yaml --dataset images.csv
$ ludwig visualize --visualization confusion_matrix --ground_truth test.csv
fraud_detection.yaml — tabular classification
input_features:
  - name: transaction_amount
    type: number
  - name: merchant_category
    type: category
  - name: hour_of_day
    type: number
  - name: country
    type: category
  - name: is_new_device
    type: binary

output_features:
  - name: is_fraud
    type: binary

trainer:
  epochs: 30
  class_weights: balanced  # handles class imbalance

─────────────────────────────────────────────
$ pip install ludwig
$ ludwig train --config fraud_detection.yaml --dataset transactions.csv
forecasting.yaml — multi-step time series forecasting
input_features:
  - name: sales_history
    type: timeseries
    encoder:
      type: transformer
    preprocessing:
      window_size: 90   # 90 days lookback

  - name: store_id
    type: category

  - name: month
    type: number

output_features:
  - name: sales_forecast
    type: timeseries
    decoder:
      horizon: 30   # predict next 30 days

trainer:
  epochs: 50
  learning_rate: 1.0e-3

─────────────────────────────────────────────
$ pip install ludwig
$ ludwig train --config forecasting.yaml --dataset sales.csv
distributed.yaml — multi-GPU FSDP training on Ray
model_type: llm
base_model: mistralai/Mistral-7B-v0.3

adapter:
  type: lora

input_features:
  - name: prompt
    type: text

output_features:
  - name: response
    type: text

trainer:
  type: finetune
  epochs: 3

backend:
  type: ray              # ← the only change from local training
  trainer:
    use_gpu: true
    num_workers: 4      # 4 × GPU workers
    strategy: fsdp     # or: ddp, deepspeed
    resources_per_worker:
      GPU: 1

─────────────────────────────────────────────
$ pip install "ludwig[llm,distributed]"
$ ludwig train --config distributed.yaml --dataset data.csv
train.py — full Python API
import pandas as pd
from ludwig.api import LudwigModel

config = {
    "input_features": [
        {"name": "text", "type": "text",
         "encoder": {"type": "bert"}}
    ],
    "output_features": [
        {"name": "label", "type": "category"}
    ],
    "trainer": {"epochs": 5},
}

model = LudwigModel(config, logging_level="INFO")
df = pd.read_csv("dataset.csv")

# train, evaluate, predict
results  = model.train(dataset=df)
preds, _ = model.predict(dataset=df)

# one-line AutoML baseline
from ludwig.automl import auto_train
automl = auto_train(
    dataset=df, target="label", time_limit_s=3600
)

# export model
model.save("./my_model")
model.export_savedmodel("./my_model_export")

30+ ready-to-run examples.

Every example ships with a config file, dataset, and expected results.

Common questions.

Both. Beginners can use YAML configs and auto_train() without knowing the internals. Experts can plug in custom PyTorch encoders, control activation functions, and tune every hyperparameter. The abstraction is a choice, not a ceiling.
Yes, comprehensively. Ludwig supports SFT, DPO, KTO, ORPO, and GRPO (v0.15). Parameter-efficient methods include LoRA, DoRA, VeRA, and LoRA+. 4-bit QLoRA via torchao means you can fine-tune a 7B model on a single consumer GPU. You can also merge multiple trained adapters using TIES, DARE, or SVD.
Axolotl and Unsloth focus on LLM fine-tuning. Ludwig covers the entire ML spectrum: tabular, image, audio, time series, and LLMs — all in the same framework. Ludwig also provides a complete production stack (HPO, distributed training, serving, export) that single-use-case tools don't. If you only ever fine-tune LLMs and need maximum throughput, Unsloth may be faster. If you need a unified framework across tasks and modalities, Ludwig is the right choice.
Yes. Ludwig's modular architecture lets you plug in custom PyTorch encoders, decoders, and combiners. Any HuggingFace model can be used as an encoder backbone. You can also subclass Ludwig's base modules for complete control while still benefiting from Ludwig's training infrastructure, HPO, and deployment tooling.
Ludwig integrates natively with Ray and Dask for distributed data processing. The backend: ray config key enables multi-GPU DDP, FSDP, and DeepSpeed training without any code changes. For datasets too large to fit in memory, Ludwig supports lazy Dask-based preprocessing and efficient Ray Data pipelines.
Yes. Ludwig ships prebuilt Docker images (CPU, GPU, Ray, Ray+GPU), exports to SafeTensors, ONNX, and torch.export, and includes a FastAPI REST server via ludwig serve. For LLM serving, Ludwig integrates with vLLM for high-throughput inference. You can also upload to HuggingFace Hub with auto-generated model cards.
CSV, TSV, JSON, Parquet, Feather, HDF5, Pandas DataFrames, and Dask DataFrames. Ludwig also has built-in dataset loading for popular benchmarks via the ludwig:// scheme (e.g. ludwig://alpaca, ludwig://mnist), and can pull datasets from HuggingFace Datasets and Kaggle.
Ludwig is an active open-source project hosted by the Linux Foundation AI & Data. It was created by Piero Molino while at Uber and continues to be actively developed and maintained by him alongside a growing open-source community. The latest release (v0.15) added GRPO alignment, torchao quantization, and native Optuna support.

From data to deployed.
Just YAML.

Stop writing boilerplate. Start building models that ship.