# Repository Briefing: ludwig-ai/ludwig
> Source: https://repoforai.com/repo/ludwig-ai/ludwig (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/ludwig-ai/ludwig
- **Official Docs / Website**: http://ludwig.ai
- **Category**: LLMs & Inference (大模型与推理微调)
- **Primary Language**: Python
- **License**: Apache-2.0
- **Engineering Health**: A+ (96/100 · Maintenance 35/35 · Adoption 21/25 · Releases 20/20 · License 20/20)
- **Latest Release**: v0.17.10 (2026-10-27) — https://github.com/ludwig-ai/ludwig/releases
- **Review Snapshot**: 2026-12-02
- **Deployment / Stack Signals**: CLI, GPU, API
- **Momentum**: 11,796 ★ total (+0 24h / +6 7d) · 1,215 forks
- **Topics**: `deep-learning`, `deeplearning`, `deep`, `learning`, `machine-learning`, `machinelearning`, `natural-language-processing`, `natural-language`, `computer-vision`, `data-centric`, `data-science`, `pytorch`
- **When to Use**: Best for: Teams that want a versionable workflow for LLM adapter experiments or mixed text, image, and tabular models, with a direct path from training to batch scoring or a self-hosted API. Skip if: You primarily need a high-throughput inference runtime with strict latency targets, or your training loop and feature processing require extensive custom behavior outside the configuration schema.

## Overview
```text
### Architecture & Core Mechanics
Ludwig is a Python/PyTorch framework SDK that uses YAML as the interface between dataset schema and model execution. Typed `input_features` and `output_features` describe the fields the pipeline consumes and predicts. For multimodal models, modality-specific encoders turn fields into representations, a configurable combiner fuses them, and one or more output heads train against the declared targets. The LLM path instead starts from a `base_model` and layers on trainer, adapter, prompting, and quantization settings.

Its main extension surface is configuration: choose encoders, combiners, optimizers, schedulers, and execution backends without owning the training loop. Hugging Face Transformers supplies text encoders, Accelerate integrates DDP, FSDP, and DeepSpeed, and Ray provides a cluster backend for training and larger-than-memory datasets. The CLI connects the lifecycle: `ludwig train` produces a model directory that can be handed to `ludwig predict` or `ludwig serve`.

### Key Capabilities & Differentiators
The LLM path covers supervised instruction tuning and alignment via DPO, KTO, ORPO, or GRPO. It supports PEFT methods such as LoRA, DoRA, and VeRA; named adapters can share a base model, switch at runtime, and be merged using methods such as TIES, DARE, or SVD. Bitsandbytes provides 4-bit and 8-bit QLoRA, while torchao offers int4, int8, and float8 options with quantization-aware training support. Sequence packing and paged optimizers address different sources of training overhead. LLaVA, Qwen2-VL, and InternVL are supported on the vision-language path via `is_multimodal: true`.

The typed-feature path covers structured columns, text, images, audio, and time series, among other inputs. A single model can combine text encoded by BERT, images encoded by DINOv2, and numeric fields, or train against multiple outputs with loss balancing such as GradNorm. Forecasting has a separate `model.forecast()` API, with PatchTST and N-BEATS among the encoder choices and MASE and sMAPE available for evaluation.

### Trade-offs & Limitations
Compared with assembling a pipeline directly in Transformers and PEFT, Ludwig reduces the integration work for preprocessing, training, evaluation, and prediction, and makes supported experiments easy to diff as configs. The trade-off is that the schema defines what can be changed without custom code. Teams adopting an unusual training objective or feature transform should prototype that extension early. Likewise, selecting a distributed backend does not remove the work of provisioning workers, coordinating data access, and managing checkpoints.

Ludwig is a training lifecycle framework with a prediction API, not a demonstrated replacement for a dedicated high-throughput inference engine. The `/predict` endpoint is a practical integration path, but its existence does not establish streaming behavior, batching strategy, or latency under load. Benchmark serving against your actual request mix before choosing it for a strict SLA. Size GPU training around the selected base model, precision, sequence length, and microbatch size; LoRA and quantization reduce specific memory costs but do not remove the need to measure peak usage.

### Hardware & Deployment Guide
Python 3.12 or newer is required. Install `ludwig` for the core package, `ludwig[llm]` for LLM fine-tuning, or `ludwig[full]` for the full optional dependency set. Start locally with `ludwig train --config model.yaml --dataset my_data.csv`. For offline batch scoring once the assets are in place, run `ludwig predict --model_path results/experiment_run/model --dataset new_data.csv`; for self-hosted HTTP serving, run `ludwig serve --model_path results/experiment_run/model` and send requests to `POST /predict`. Confirm access to any gated Hub weights and validate the selected PyTorch, GPU, and quantization stack before scaling out.

Use a release containing the recent security fixes for new deployments or upgrades. v0.17.8 addressed path traversal in dataset archive extraction; v0.17.9 fixed insecure deserialization when loading resume checkpoints; and v0.17.10 fixed insecure deserialization when the Ray driver loaded worker checkpoint results. Keep datasets, model artifacts, and checkpoints on trusted storage with controlled write access, especially where cluster workers and drivers exchange results.
```

## Key Capabilities
```text
- Feature schema: YAML declares typed inputs and outputs and selects modality-specific encoders and feature combiners.
- LLM training: Supervised fine-tuning and DPO, KTO, ORPO, or GRPO can be selected through `trainer.type`.
- Adapters: Named PEFT adapters can share a base model, switch at runtime, and merge using methods such as TIES or DARE.
- Quantization: bitsandbytes supports 4-bit and 8-bit QLoRA; torchao provides int4, int8, and float8 options with quantization-aware training support.
- Distributed execution: Accelerate supports DDP, FSDP, and DeepSpeed; the Ray backend supports cluster training and larger-than-memory datasets.
- Inference interfaces: `ludwig predict` runs batch scoring, while `ludwig serve` exposes `POST /predict` over HTTP.
```

## Quick Start / Clone
```bash
pip install ludwig           # core
pip install ludwig[full]     # all optional dependencies
pip install ludwig[llm]      # LLM fine-tuning only
```
