Favicon of Ludwig

Ludwig

Open-source AI training framework built on PyTorch. Train on local CPUs or GPUs, fine-tune HuggingFace models, and serve models on your own server.

Screenshot of Ludwig website

Ludwig is an open-source Python framework for developers and researchers who want to train custom AI models on their own hardware. A YAML file describes the model and training pipeline, while Ludwig handles preprocessing, training and evaluation. It uses the Apache 2.0 license. Install the Python package with the optional LLM dependencies for fine-tuning; current source requires Python 3.12 or later.

Built on PyTorch, it supports local CPU or GPU training and distributed jobs through Ray, DeepSpeed and FSDP. Docker images cover CPU, GPU and Ray deployments, and KubeRay supports Kubernetes clusters. The same model definition can carry across local and distributed training.

For LLM fine-tuning, Ludwig works with HuggingFace models including Llama, Mistral and Qwen. It supports instruction tuning and preference alignment methods such as DPO and GRPO. LoRA and 4-bit QLoRA reduce training memory needs, with single-GPU QLoRA workflows when the model fits the available memory. Vision-language models such as LLaVA and Qwen2-VL are also supported.

Its scope extends beyond LLMs. Models can combine text with images, audio, tabular data or time series and learn multiple outputs together. Applications include classification, image segmentation, speech recognition and forecasting. Custom encoders, losses and metrics give developers room to extend the framework.

AutoML can find an initial baseline, while Optuna and Ray Tune search training settings. Feature importance and explainability tools help inspect results. Experiment tracking connects to MLflow, TensorBoard and Weights & Biases. Trained models can run behind a self-hosted REST API or export to SafeTensors, ONNX and torch.export.

Similar to Ludwig