Skip to content

Installation

Ludwig is a declarative deep learning framework that allows users to train, evaluate, and deploy models without the need to write code.

Being declarative means you only need to tell Ludwig what columns in your data are input and output features, and Ludwig will figure out how to train the best model.

For users familiar with Python, we recommend installing with pip within an isolated virtual environment. If not, you can use our pre-built docker images. Advanced users can also install Ludwig from git.

For large or long-running workloads, Ludwig can be run remotely in the cloud or on a private compute cluster using Ray.

Python (with Pip) recommended

pip install ludwig

This will install Ludwig's basic requirements for modeling with binary, category, number, text, image, and audio features. The requirements for additional functionality are separated out so that users are able to install only the ones they actually need:

  • ludwig[serve] for serving dependencies.
  • ludwig[viz] for visualization dependencies.
  • ludwig[hyperopt] for hyperparameter optimization dependencies.
  • ludwig[distributed] for distributed training on Ray using Dask and Horovod.

The full set of dependencies can be installed with:

pip install 'ludwig[full]'

GPU support

If your machine has a GPU to accelerate the training process, make sure you install a GPU-enabled version of PyTorch before installing Ludwig:

pip install torch -f https://download.pytorch.org/whl/cu113/torch_stable.html

The example above will install the latest version of PyTorch with CUDA 11.3. See the official PyTorch docs for more details on installing the right version of PyTorch for your environment.

Docker

The Ludwig team publishes official Docker images that come with the full set of dependencies pre-installed. You can pull the latest images (for the most recent official Ludwig release) by running:

docker pull ludwigai/ludwig:latest

The ludwig command line tool is provided as the entrypoint for all commands.

GPU support

If your machine has a GPU to accelerate the training process, pull the official Ludwig image with GPU support:

docker pull ludwigai/ludwig-gpu:latest

Git

For developers who wish to build the source code from the GitHub repository, first clone the repo locally:

git clone git@github.com:ludwig-ai/ludwig.git

Install the required dependencies:

pip install -e '.[test]'

The test extra will pull in all Ludwig dependencies in addition to test dependencies.