{"id":13400209,"url":"https://github.com/ludwig-ai/ludwig","last_synced_at":"2026-04-04T06:07:46.069Z","repository":{"id":37035010,"uuid":"163346054","full_name":"ludwig-ai/ludwig","owner":"ludwig-ai","description":"Low-code framework for building custom LLMs, neural networks, and other AI models","archived":false,"fork":false,"pushed_at":"2025-05-05T20:15:38.000Z","size":33287,"stargazers_count":11435,"open_issues_count":50,"forks_count":1206,"subscribers_count":192,"default_branch":"master","last_synced_at":"2025-05-05T22:14:29.537Z","etag":null,"topics":["computer-vision","data-centric","data-science","deep","deep-learning","deeplearning","fine-tuning","learning","llama","llama2","llm","llm-training","machine-learning","machinelearning","mistral","ml","natural-language","natural-language-processing","neural-network","pytorch"],"latest_commit_sha":null,"homepage":"http://ludwig.ai","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ludwig-ai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-12-27T23:58:12.000Z","updated_at":"2025-05-04T22:12:40.000Z","dependencies_parsed_at":"2023-09-23T04:23:08.853Z","dependency_job_id":"95204aff-b868-4431-8447-dfa4c7942188","html_url":"https://github.com/ludwig-ai/ludwig","commit_stats":{"total_commits":3634,"total_committers":177,"mean_commits":"20.531073446327685","dds":0.8602091359383599,"last_synced_commit":"00c51e0a286c3fa399a07a550e48d0f3deadc57d"},"previous_names":["uber/ludwig"],"tags_count":61,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ludwig-ai%2Fludwig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ludwig-ai%2Fludwig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ludwig-ai%2Fludwig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ludwig-ai%2Fludwig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ludwig-ai","download_url":"https://codeload.github.com/ludwig-ai/ludwig/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253505397,"owners_count":21918928,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["computer-vision","data-centric","data-science","deep","deep-learning","deeplearning","fine-tuning","learning","llama","llama2","llm","llm-training","machine-learning","machinelearning","mistral","ml","natural-language","natural-language-processing","neural-network","pytorch"],"created_at":"2024-07-30T19:00:49.572Z","updated_at":"2025-10-23T02:43:06.075Z","avatar_url":"https://github.com/ludwig-ai.png","language":"Python","funding_links":[],"categories":["Python","The Data Science Toolbox","Code Samples","微调 Fine-Tuning","Deep Learning Framework","Table of Contents","Model Training and Orchestration","Coding \u0026 Development","HarmonyOS","computer-vision","机器学习框架","pytorch","Coding","Training","LLMs Framework","🤖 AI \u0026 Machine Learning","2. Libraries \u0026 Frameworks","7. Training \u0026 Fine-tuning Ecosystem"],"sub_categories":["Deep Learning Packages","High-Level DL APIs","Windows Manager","Developer tools","Model Tools","Framework","Python"],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://ludwig.ai\"\u003e\n    \u003cimg src=\"https://github.com/ludwig-ai/ludwig-docs/raw/master/docs/images/ludwig_hero_smaller.jpg\" height=\"150\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n_Declarative deep learning framework built for scale and efficiency._\n\n[![PyPI version](https://badge.fury.io/py/ludwig.svg)](https://badge.fury.io/py/ludwig)\n[![Discord](https://dcbadge.vercel.app/api/server/CBgdrGnZjy?style=flat\u0026theme=discord-inverted)](https://discord.gg/CBgdrGnZjy)\n[![DockerHub](https://img.shields.io/docker/pulls/ludwigai/ludwig.svg)](https://hub.docker.com/r/ludwigai)\n[![Downloads](https://pepy.tech/badge/ludwig)](https://pepy.tech/project/ludwig)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/ludwig-ai/ludwig/blob/master/LICENSE)\n[![X](https://img.shields.io/twitter/follow/ludwig_ai.svg?style=social\u0026logo=twitter)](https://twitter.com/ludwig_ai)\n\n\u003c/div\u003e\n\n\u003e \\[!IMPORTANT\\]\n\u003e Our community has moved to [Discord](https://discord.gg/CBgdrGnZjy) -- please join us there!\n\n# 📖 What is Ludwig?\n\nLudwig is a **low-code** framework for building **custom** AI models like **LLMs** and other deep neural networks.\n\nKey features:\n\n- 🛠 **Build custom models with ease:** a declarative YAML configuration file is all you need to train a state-of-the-art LLM on your data. Support for multi-task and multi-modality learning. Comprehensive config validation detects invalid parameter combinations and prevents runtime failures.\n- ⚡ **Optimized for scale and efficiency:** automatic batch size selection, distributed training ([DDP](https://pytorch.org/tutorials/beginner/ddp_series_theory.html), [DeepSpeed](https://github.com/microsoft/DeepSpeed)), parameter efficient fine-tuning ([PEFT](https://github.com/huggingface/peft)), 4-bit quantization (QLoRA), paged and 8-bit optimizers, and larger-than-memory datasets.\n- 📐 **Expert level control:** retain full control of your models down to the activation functions. Support for hyperparameter optimization, explainability, and rich metric visualizations.\n- 🧱 **Modular and extensible:** experiment with different model architectures, tasks, features, and modalities with just a few parameter changes in the config. Think building blocks for deep learning.\n- 🚢 **Engineered for production:** prebuilt [Docker](https://hub.docker.com/u/ludwigai) containers, native support for running with [Ray](https://www.ray.io/) on [Kubernetes](https://github.com/ray-project/kuberay), export models to [Torchscript](https://pytorch.org/docs/stable/jit.html) and [Triton](https://developer.nvidia.com/triton-inference-server), upload to [HuggingFace](https://huggingface.co/models) with one command.\n\nLudwig is hosted by the\n[Linux Foundation AI \u0026 Data](https://lfaidata.foundation/).\n\n![img](https://raw.githubusercontent.com/ludwig-ai/ludwig-docs/master/docs/images/ludwig_legos_unanimated.gif)\n\n# 💾 Installation\n\nInstall from PyPi. Be aware that Ludwig requires Python 3.8+.\n\n```shell\npip install ludwig\n```\n\nOr install with all optional dependencies:\n\n```shell\npip install ludwig[full]\n```\n\nPlease see [contributing](https://github.com/ludwig-ai/ludwig/blob/master/CONTRIBUTING.md) for more detailed installation instructions.\n\n# 🚂 Getting Started\n\nWant to take a quick peek at some of the Ludwig 0.8 features? Check out this Colab Notebook 🚀 [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1lB4ALmEyvcMycE3Mlnsd7I3bc0zxvk39)\n\nLooking to fine-tune Llama-2 or Mistral? Check out these notebooks:\n\n1. Fine-Tune Llama-2-7b: [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1r4oSEwRJpYKBPM0M0RSh0pBEYK_gBKbe)\n1. Fine-Tune Llama-2-13b: [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1zmSEzqZ7v4twBrXagj1TE_C--RNyVAyu)\n1. Fine-Tune Mistral-7b: [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1i_8A1n__b7ljRWHzIsAdhO7u7r49vUm4)\n\nFor a full tutorial, check out the official [getting started guide](https://ludwig-ai.github.io/ludwig-docs/latest/getting_started/), or take a look at end-to-end [Examples](https://ludwig-ai.github.io/ludwig-docs/latest/examples).\n\n## Large Language Model Fine-Tuning\n\n[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1c3AO8l_H6V_x37RwQ8V7M6A-RmcBf2tG?usp=sharing)\n\nLet's fine-tune a pretrained LLaMA-2-7b large language model to follow instructions like a chatbot (\"instruction tuning\").\n\n### Prerequisites\n\n- [HuggingFace API Token](https://huggingface.co/docs/hub/security-tokens)\n- Access approval to [Llama2-7b-hf](https://huggingface.co/meta-llama/Llama-2-7b-hf)\n- GPU with at least 12 GiB of VRAM (in our tests, we used an Nvidia T4)\n\n### Running\n\nWe'll use the [Stanford Alpaca](https://crfm.stanford.edu/2023/03/13/alpaca.html) dataset, which will be formatted as a table-like file that looks like this:\n\n|                    instruction                    |      input       |                      output                       |\n| :-----------------------------------------------: | :--------------: | :-----------------------------------------------: |\n|       Give three tips for staying healthy.        |                  | 1.Eat a balanced diet and make sure to include... |\n| Arrange the items given below in the order to ... | cake, me, eating |                  I eating cake.                   |\n| Write an introductory paragraph about a famous... |  Michelle Obama  | Michelle Obama is an inspirational woman who r... |\n|                        ...                        |       ...        |                        ...                        |\n\nCreate a YAML config file named `model.yaml` with the following:\n\n```yaml\nmodel_type: llm\nbase_model: meta-llama/Llama-2-7b-hf\n\nquantization:\n  bits: 4\n\nadapter:\n  type: lora\n\nprompt:\n  template: |\n    Below is an instruction that describes a task, paired with an input that may provide further context.\n    Write a response that appropriately completes the request.\n\n    ### Instruction:\n    {instruction}\n\n    ### Input:\n    {input}\n\n    ### Response:\n\ninput_features:\n  - name: prompt\n    type: text\n\noutput_features:\n  - name: output\n    type: text\n\ntrainer:\n  type: finetune\n  learning_rate: 0.0001\n  batch_size: 1\n  gradient_accumulation_steps: 16\n  epochs: 3\n  learning_rate_scheduler:\n    decay: cosine\n    warmup_fraction: 0.01\n\npreprocessing:\n  sample_ratio: 0.1\n\nbackend:\n  type: local\n```\n\nAnd now let's train the model:\n\n```bash\nexport HUGGING_FACE_HUB_TOKEN = \"\u003capi_token\u003e\"\n\nludwig train --config model.yaml --dataset \"ludwig://alpaca\"\n```\n\n## Supervised ML\n\nLet's build a neural network that predicts whether a given movie critic's review on [Rotten Tomatoes](https://www.kaggle.com/stefanoleone992/rotten-tomatoes-movies-and-critic-reviews-dataset) was positive or negative.\n\nOur dataset will be a CSV file that looks like this:\n\n|     movie_title      | content_rating |              genres              | runtime | top_critic | review_content                                                                                                                                                                                                   | recommended |\n| :------------------: | :------------: | :------------------------------: | :-----: | ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- |\n| Deliver Us from Evil |       R        |    Action \u0026 Adventure, Horror    |  117.0  | TRUE       | Director Scott Derrickson and his co-writer, Paul Harris Boardman, deliver a routine procedural with unremarkable frights.                                                                                       | 0           |\n|       Barbara        |     PG-13      | Art House \u0026 International, Drama |  105.0  | FALSE      | Somehow, in this stirring narrative, Barbara manages to keep hold of her principles, and her humanity and courage, and battles to save a dissident teenage girl whose life the Communists are trying to destroy. | 1           |\n|   Horrible Bosses    |       R        |              Comedy              |  98.0   | FALSE      | These bosses cannot justify either murder or lasting comic memories, fatally compromising a farce that could have been great but ends up merely mediocre.                                                        | 0           |\n|         ...          |      ...       |               ...                |   ...   | ...        | ...                                                                                                                                                                                                              | ...         |\n\nDownload a sample of the dataset from [here](https://ludwig.ai/latest/data/rotten_tomatoes.csv).\n\n```bash\nwget https://ludwig.ai/latest/data/rotten_tomatoes.csv\n```\n\nNext create a YAML config file named `model.yaml` with the following:\n\n```yaml\ninput_features:\n  - name: genres\n    type: set\n    preprocessing:\n      tokenizer: comma\n  - name: content_rating\n    type: category\n  - name: top_critic\n    type: binary\n  - name: runtime\n    type: number\n  - name: review_content\n    type: text\n    encoder:\n      type: embed\noutput_features:\n  - name: recommended\n    type: binary\n```\n\nThat's it! Now let's train the model:\n\n```bash\nludwig train --config model.yaml --dataset rotten_tomatoes.csv\n```\n\n**Happy modeling**\n\nTry applying Ludwig to your data. [Reach out on Discord](https://discord.gg/CBgdrGnZjy)\nif you have any questions.\n\n# ❓ Why you should use Ludwig\n\n- **Minimal machine learning boilerplate**\n\n  Ludwig takes care of the engineering complexity of machine learning out of\n  the box, enabling research scientists to focus on building models at the\n  highest level of abstraction. Data preprocessing, hyperparameter\n  optimization, device management, and distributed training for\n  `torch.nn.Module` models come completely free.\n\n- **Easily build your benchmarks**\n\n  Creating a state-of-the-art baseline and comparing it with a new model is a\n  simple config change.\n\n- **Easily apply new architectures to multiple problems and datasets**\n\n  Apply new models across the extensive set of tasks and datasets that Ludwig\n  supports. Ludwig includes a\n  [full benchmarking toolkit](https://arxiv.org/abs/2111.04260) accessible to\n  any user, for running experiments with multiple models across multiple\n  datasets with just a simple configuration.\n\n- **Highly configurable data preprocessing, modeling, and metrics**\n\n  Any and all aspects of the model architecture, training loop, hyperparameter\n  search, and backend infrastructure can be modified as additional fields in\n  the declarative configuration to customize the pipeline to meet your\n  requirements. For details on what can be configured, check out\n  [Ludwig Configuration](https://ludwig-ai.github.io/ludwig-docs/latest/configuration/)\n  docs.\n\n- **Multi-modal, multi-task learning out-of-the-box**\n\n  Mix and match tabular data, text, images, and even audio into complex model\n  configurations without writing code.\n\n- **Rich model exporting and tracking**\n\n  Automatically track all trials and metrics with tools like Tensorboard,\n  Comet ML, Weights \u0026 Biases, MLFlow, and Aim Stack.\n\n- **Automatically scale training to multi-GPU, multi-node clusters**\n\n  Go from training on your local machine to the cloud without code changes.\n\n- **Low-code interface for state-of-the-art models, including pre-trained Huggingface Transformers**\n\n  Ludwig also natively integrates with pre-trained models, such as the ones\n  available in [Huggingface Transformers](https://huggingface.co/docs/transformers/index).\n  Users can choose from a vast collection of state-of-the-art pre-trained\n  PyTorch models to use without needing to write any code at all. For example,\n  training a BERT-based sentiment analysis model with Ludwig is as simple as:\n\n  ```shell\n  ludwig train --dataset sst5 --config_str \"{input_features: [{name: sentence, type: text, encoder: bert}], output_features: [{name: label, type: category}]}\"\n  ```\n\n- **Low-code interface for AutoML**\n\n  [Ludwig AutoML](https://ludwig-ai.github.io/ludwig-docs/latest/user_guide/automl/)\n  allows users to obtain trained models by providing just a dataset, the\n  target column, and a time budget.\n\n  ```python\n  auto_train_results = ludwig.automl.auto_train(dataset=my_dataset_df, target=target_column_name, time_limit_s=7200)\n  ```\n\n- **Easy productionisation**\n\n  Ludwig makes it easy to serve deep learning models, including on GPUs.\n  Launch a REST API for your trained Ludwig model.\n\n  ```shell\n  ludwig serve --model_path=/path/to/model\n  ```\n\n  Ludwig supports exporting models to efficient Torchscript bundles.\n\n  ```shell\n  ludwig export_torchscript -–model_path=/path/to/model\n  ```\n\n# 📚 Tutorials\n\n- [Text Classification](https://ludwig-ai.github.io/ludwig-docs/latest/examples/text_classification)\n- [Tabular Data Classification](https://ludwig-ai.github.io/ludwig-docs/latest/examples/adult_census_income)\n- [Image Classification](https://ludwig-ai.github.io/ludwig-docs/latest/examples/mnist)\n- [Multimodal Classification](https://ludwig-ai.github.io/ludwig-docs/latest/examples/multimodal_classification)\n\n# 🔬 Example Use Cases\n\n- [Named Entity Recognition Tagging](https://ludwig-ai.github.io/ludwig-docs/latest/examples/ner_tagging)\n- [Natural Language Understanding](https://ludwig-ai.github.io/ludwig-docs/latest/examples/nlu)\n- [Machine Translation](https://ludwig-ai.github.io/ludwig-docs/latest/examples/machine_translation)\n- [Chit-Chat Dialogue Modeling through seq2seq](https://ludwig-ai.github.io/ludwig-docs/latest/examples/seq2seq)\n- [Sentiment Analysis](https://ludwig-ai.github.io/ludwig-docs/latest/examples/sentiment_analysis)\n- [One-shot Learning with Siamese Networks](https://ludwig-ai.github.io/ludwig-docs/latest/examples/oneshot)\n- [Visual Question Answering](https://ludwig-ai.github.io/ludwig-docs/latest/examples/visual_qa)\n- [Spoken Digit Speech Recognition](https://ludwig-ai.github.io/ludwig-docs/latest/examples/speech_recognition)\n- [Speaker Verification](https://ludwig-ai.github.io/ludwig-docs/latest/examples/speaker_verification)\n- [Binary Classification (Titanic)](https://ludwig-ai.github.io/ludwig-docs/latest/examples/titanic)\n- [Timeseries forecasting](https://ludwig-ai.github.io/ludwig-docs/latest/examples/forecasting)\n- [Timeseries forecasting (Weather)](https://ludwig-ai.github.io/ludwig-docs/latest/examples/weather)\n- [Movie rating prediction](https://ludwig-ai.github.io/ludwig-docs/latest/examples/movie_ratings)\n- [Multi-label classification](https://ludwig-ai.github.io/ludwig-docs/latest/examples/multi_label)\n- [Multi-Task Learning](https://ludwig-ai.github.io/ludwig-docs/latest/examples/multi_task)\n- [Simple Regression: Fuel Efficiency Prediction](https://ludwig-ai.github.io/ludwig-docs/latest/examples/fuel_efficiency)\n- [Fraud Detection](https://ludwig-ai.github.io/ludwig-docs/latest/examples/fraud)\n\n# 💡 More Information\n\nRead our publications on [Ludwig](https://arxiv.org/pdf/1909.07930.pdf), [declarative ML](https://arxiv.org/pdf/2107.08148.pdf), and [Ludwig’s SoTA benchmarks](https://openreview.net/pdf?id=hwjnu6qW7E4).\n\nLearn more about [how Ludwig works](https://ludwig-ai.github.io/ludwig-docs/latest/user_guide/how_ludwig_works/), [how to get started](https://ludwig-ai.github.io/ludwig-docs/latest/getting_started/), and work through more [examples](https://ludwig-ai.github.io/ludwig-docs/latest/examples).\n\nIf you are interested in [contributing](https://github.com/ludwig-ai/ludwig/blob/master/CONTRIBUTING.md), have questions, comments, or thoughts to share, or if you just want to be in the\nknow, please consider [joining our Community Discord](https://discord.gg/CBgdrGnZjy) and follow us on [X](https://twitter.com/ludwig_ai)!\n\n# 🤝 Join the community to build Ludwig with us\n\nLudwig is an actively managed open-source project that relies on contributions from folks just like\nyou. Consider joining the active group of Ludwig contributors to make Ludwig an even\nmore accessible and feature rich framework for everyone to use!\n\n\u003ca href=\"https://github.com/ludwig-ai/ludwig/graphs/contributors\"\u003e\n  \u003cimg src=\"https://contrib.rocks/image?repo=ludwig-ai/ludwig\" /\u003e\n\u003c/a\u003e\u003cbr/\u003e\n\n## Star History\n\n[![Star History Chart](https://api.star-history.com/svg?repos=ludwig-ai/ludwig\u0026type=Date)](https://star-history.com/#ludwig-ai/ludwig\u0026Date)\n\n# 👋 Getting Involved\n\n- [Discord](https://discord.gg/CBgdrGnZjy)\n- [X](https://twitter.com/ludwig_ai)\n- [Medium](https://medium.com/ludwig-ai)\n- [GitHub Issues](https://github.com/ludwig-ai/ludwig/issues)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fludwig-ai%2Fludwig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fludwig-ai%2Fludwig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fludwig-ai%2Fludwig/lists"}