# Ludwig — Low-Code Framework for Building Custom AI Models > Ludwig is a declarative deep learning framework that lets you build, train, and deploy custom AI models without writing code. Define your model architecture in a YAML config, point it at your data, and Ludwig handles preprocessing, training, hyperparameter search, and serving. ## Install Save in your project root: # Ludwig — Low-Code Framework for Building Custom AI Models ## Quick Use ```bash pip install ludwig ludwig train --dataset your_data.csv --config config.yaml ``` ```yaml # config.yaml input_features: - name: text_column type: text encoder: type: bert output_features: - name: label_column type: category ``` ## Introduction Ludwig is a declarative machine learning framework originally developed at Uber and now maintained by the Linux Foundation AI & Data. Instead of writing training loops, you describe your model in a simple YAML configuration file. Ludwig handles data preprocessing, model construction, distributed training, hyperparameter optimization, and model serving automatically. ## What Ludwig Does - Trains models from YAML configs for tabular, text, image, audio, and multimodal data - Supports LLM fine-tuning with LoRA and QLoRA via simple configuration changes - Provides automatic feature preprocessing (tokenization, normalization, encoding) based on data types - Integrates hyperparameter search via Ray Tune with Bayesian or grid strategies - Exports trained models for serving via REST API, BentoML, or TorchScript ## Architecture Overview Ludwig uses an Encoder-Combiner-Decoder (ECD) architecture. Each input feature passes through a type-specific encoder (BERT for text, ResNet for images, numeric embeddings for tabular). A combiner merges encoded representations (concat, transformer, or TabNet). Each output feature uses a decoder head for its task type. The entire pipeline from raw data to predictions is configured declaratively, and Ludwig auto-selects sensible defaults when fields are omitted. ## Self-Hosting & Configuration - Install via pip: `pip install ludwig` or with LLM support: `pip install ludwig[llm]` - Define model configs in YAML specifying input features, output features, and optional trainer settings - Train from CLI: `ludwig train --config config.yaml --dataset data.csv` - Distributed training with Ray: `ludwig train --backend ray --config config.yaml` - Serve a trained model: `ludwig serve --model_path results/model` starts a REST API ## Key Features - Declarative YAML configuration eliminates boilerplate training code - Multi-modal support: combine text, image, tabular, audio, and time-series inputs in one model - LLM fine-tuning with LoRA via simple config: set `base_model: meta-llama/Llama-2-7b` and train - Automatic benchmarking compares multiple model configs and reports metrics - Built-in visualization for learning curves, confusion matrices, and feature importance ## Comparison with Similar Tools - **AutoGluon** — AutoML focused on tabular data; Ludwig handles multimodal and LLM fine-tuning with more config control - **Hugging Face Trainer** — requires Python code; Ludwig uses declarative YAML for the full pipeline - **Keras** — flexible but imperative; Ludwig is better for rapid prototyping without custom code - **FLAML** — AutoML library focused on hyperparameter tuning; Ludwig covers the full data-to-serving lifecycle - **PyCaret** — low-code ML for classical models; Ludwig extends to deep learning and LLM fine-tuning ## FAQ **Q: Can Ludwig fine-tune large language models?** A: Yes, Ludwig supports LLM fine-tuning (SFT, LoRA, QLoRA) for models like LLaMA, Mistral, and Falcon via YAML config with minimal setup. **Q: Do I need to preprocess my data before using Ludwig?** A: No, Ludwig auto-detects feature types and applies appropriate preprocessing (tokenization, normalization, image resizing) based on the declared type in the config. **Q: Can Ludwig handle multi-task learning?** A: Yes, specify multiple output features in the config. Ludwig trains a single model with shared representations and separate decoder heads for each task. **Q: How does Ludwig compare to writing custom PyTorch?** A: Ludwig removes boilerplate but is less flexible for novel architectures. It is best for standard tasks where rapid iteration and reproducibility matter more than architectural innovation. ## Sources - https://github.com/ludwig-ai/ludwig - https://ludwig.ai/latest --- Source: https://tokrepo.com/en/workflows/d6d1b374-3d9d-11f1-9bc6-00163e2b0d79 Author: AI Open Source