ludwig-ai/ludwig
YAML-first framework for fine-tuning, training, and serving LLMs and multimodal models
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & 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.
trainer.type.ludwig predict runs batch scoring, while ludwig serve exposes POST /predict over HTTP.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.
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.
Quick Start & Installation
pip install ludwig # core pip install ludwig[full] # all optional dependencies pip install ludwig[llm] # LLM fine-tuning only
Comparison vs. Top LLMs & Inference Alternatives
Full comparison →| Repository | Stars | 7d Trend | Stack | License | Core Positioning |
|---|---|---|---|---|---|
| ludwig ★ | 11.8k | +6 | Python | Apache-2.0 | YAML-first framework for fine-tuning, training, and serving LLMs and multimodal |
| DeepSpeed | 43.4k | +33 | Python | Apache-2.0 | PyTorch runtime for distributed training and inference under GPU memory constrai |
| agent-lightning | 19k | +30 | Python | MIT | Proxy-based reinforcement learning for agents in their existing harnesses |
| keras | 64.5k | +24 | Python | Apache-2.0 | Multi-backend Python SDK for building, training, and running deep learning model |
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/ludwig-ai/ludwig.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about ludwig
How do we integrate Ludwig without writing a custom training loop?
ludwig train. Use the resulting model directory with ludwig predict for batch jobs or ludwig serve for HTTP integration. Keep the resolved config with the artifact so downstream teams can trace which feature definitions and training settings produced it.How much GPU memory should we budget for fine-tuning and serving?
Can we self-host Ludwig commercially or run it in a restricted environment?
When should we choose Ludwig over a direct Transformers/PEFT stack or a dedicated inference engine?
Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy