Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
L

LMFlow

> 数据库
Open source

An Extensible Toolkit for Finetuning and Inference of Large Foundation Models. Large Models for All.

8.5K stars0 likes0 views
WebsiteGitHub

About

An Extensible Toolkit for Finetuning and Inference of Large Foundation Models. Large Models for All.

LMFlow

English | 简体中文 | Español | 日本語 | 한국어 | हिंदी

An extensible, convenient, and efficient toolbox for finetuning large machine learning models, designed to be user-friendly, speedy and reliable, and accessible to the entire community.

Latest News

[!IMPORTANT]

  • :exclamation: [2025-07-09] We have a major update to LMFlow with full Accelerate support and extensive streamlining. If you're looking for the previous version, please use git checkout v0.0.10, or check out the v0.0.10 branch. View all releases here.
  • [2024-12-02] Support Hymba, a new family of small language models featuring a hybrid-head parallel architecture. Check out Post-training Hymba for more details.
  • [2024-07-01] LMFlow receives the Best Demo Paper Award at NAACL 2024!
  • [2024-06-30] Expanding Optimization Options! We now support custom optimizer training with a variety of optimizers. Dive into the details and try out the new features with our updated script at custom_optimizers.
  • [2024-04-25] :rocket: Support conversation template! We've preset the latest Llama-3 and Phi-3 conversation templates as well as some frequently used templates such as chatml (see all templates here), and we are working on adding more preset templates. Adding corresponding --conversation_template in the shell script and you are all set! :rocket:
More news...
  • [2024-03-27] Support LISA, enabling 7B training in 24G memory without offloading!

  • [2023-09-11] Support speculative decoding. Check out speculative_decoding for the usage and acceleration details.

  • [2023-08-14] Support long context inference with position interpolation (Linear & NTK scaling ) for LLaMA models. Check out postion_interpolation for more details.

  • [2023-08-07] Support Flash Attention-2. Check out flash_attention for more details.

  • [2023-08-02] Support Llama2, ChatGLM2, and Baichuan models.

  • [2023-07-23] LMFlow multimodal chatbot is now available! Support multimodal inputs of images and texts. Online Demo is also provided (We hold the service on a single GPU, hence one may experience "queuing" or "application busy" sometimes when multiple users are accessing at the same time, please wait and attempt again later when such event happens)

  • [2023-06-22] LMFlow paper is out! Check out our implementation details at https://arxiv.org/abs/2306.12420

  • [2023-06-16] Our finetuned Robin-33B-V2 scored an impressive 64.1 on the Huggingface LLM leaderboard in our offline evaluation, outperforming major open-source LLMs! All checkpoints (7B, 13B, 33B, and 65B) are released! Checkout the performance here.

  • [2023-06-07] LMFlow is now officially available on PyPI! Install it with pip install lmflow-finetune!

  • [2023-05-30] Release Robin-13B-v2 and Robin-33B-v2!

  • [2023-05-15] Release LMFlow-data, the training dataset of Robin-7B-v2. A new test data is also released.

  • [2023-05-09] Release Robin-7B-v2, achieving competitive performance on chitchat, commonsense reasoning and instruction-following tasks. Refer to our comprehensive study.

  • [2023-05-08] Release LMFlow Benchmark, an automatic evaluation framework for open-source chat-style LLMs. Benchmark results on 31 popular models are reported. Participate in LMFlow Benchmark.

  • [2023-04-21] Release Robin-7B (based on LLaMA-7B), and two models for commercial use: Parakeets-2.7B (based on GPT-NEO-2.7B) and Cokatoo-7B (based on StableLM-7B) Download here

  • [2023-04-15] Inference: Support streaming output and ChatGLM.

  • [2023-04-10] We propose a new alignment algorithm: Reward rAnked FineTuning (RAFT), which is more efficient than conventional (PPO-based) RLHF. [Paper]

  • [2023-04-02] Web service is online!

  • [2023-04-01] Release three instruction-tuned checkpoints and three medical checkpoints in model zoo: LLaMA-7B-tuned, LLaMA-13B-tuned, LLaMA-33B-tuned, LLaMA-7B-medical, LLaMA-13B-medical, and LLaMA-33B-medical.

  • [2023-03-27] Support full tuning and lora tuning for all decoder models.

  • [2023-03-27] Tasked tuned model beats ChatGPT on medical domain.

  • [2023-03-27] Release code and checkpoints - version 0.0.1! Our tasked-tuned model beats ChatGPT on medical domain.

Table of Contents

  • LMFlow
    • Latest News
    • Table of Contents
    • Quick Start
      • Setup
      • Prepare Dataset
      • Finetuning
        • Estimated Hardware Requirement
        • Full Finetuning
        • LISA
        • LoRA
      • Inference
      • Deployment
      • Evaluation
    • Supported Features
    • Support
    • License
    • Citation

Quick Start

Setup

Our package has been tested on Linux OS (Ubuntu 20.04). Other OS platforms (MacOS, Windows) are not fully tested, where you may encounter unexpected errors. If you are using LMFlow for the first time, we recommend you to try on a Linux machine or Google Colab.

bash
git clone -b v1.0.0 https://github.com/OptimalScale/LMFlow.git
cd LMFlow
conda create -n lmflow python=3.9 -y
conda activate lmflow
conda install mpi4py
pip install -e .

Optional dependencies

The base install above is enough for full / LoRA / LISA finetuning and HF-backend inference. Features below are gated behind extras — install only what you need:

Extra Enables Install
vllm vLLM-backed inference and iterative DPO pip install -e ".[vllm]"
sglang SGLang-backed inference and iterative DPO pip install -e ".[sglang]"
trl DPO / iterative DPO training pip install -e ".[trl]"
deepspeed DeepSpeed integration pip install -e ".[deepspeed]"
flash_attn Flash Attention 2 pip install -e ".[flash_attn]"
ray Distributed reward-model inference pip install -e ".[ray]"
multimodal Multimodal models pip install -e ".[multimodal]"
gradio Gradio chatbot UI pip install -e ".[gradio]"
flask Flask deployment pip install -e ".[flask]"

Multiple extras can be combined: pip install -e ".[vllm,trl]" for iterative DPO with vLLM, or ".[sglang,trl]" for the SGLang variant.

[!IMPORTANT] vLLM and SGLang depend on incompatible CUDA / PyTorch versions and should not be installed into the same environment. If you need both, create separate conda envs (e.g. lmflow-vllm and lmflow-sglang).

Looking for a previous version?
bash
git clone -b v0.0.10 https://github.com/OptimalScale/LMFlow.git
cd LMFlow
conda create -n lmflow python=3.9 -y
conda activate lmflow
conda install mpi4py
pip install -e .
For CUDA versions 10.3-11.7
bash
git clone -b v0.0.5 https://github.com/OptimalScale/LMFlow.git
cd LMFlow
conda create -n lmflow python=3.9 -y
conda activate lmflow
conda install mpi4py
pip install -e .

[!TIP] We use WandB to track and visualize the training process by default. Before running the training scripts, users may need to log in to WandB using the command:

bash
wandb login

For detailed instructions, refer to the WandB Quickstart Guide. Step 1 (registration) and Step 2 (login using your WandB API key) should be sufficient to set up your environment.

Disabling wandb

One can disable wandb by either:

  1. Adding environment variable before running the training command.
bash
export WANDB_MODE=disabled
  1. OR, specifying the integrations to report the results and logs to. In the training script, add:
bash
--report_to none \

Prepare Dataset

Please refer to our doc.

Finetuning

Estimated Hardware Requirement

Method 0.5B 3B 7B 14B 30B 70B xB
Full bf16/fp16 9GB 55GB 120GB 240GB 600GB 1200GB 18xGB
LoRA 1GB 6GB 16GB 32GB 64GB 160GB 2xGB
QLo

Issues· 88 open

View all issuesOpen on GitHub
  • #977

    Use `dtype` instead of deprecated `torch_dtype` for transformers >= 4.56

    Updated Aug 28, 2026
  • #862

    [Roadmap] LMFlow Roadmap

    Updated Aug 7, 2026
  • #973

    Security: request for a private disclosure contact

    Updated Jul 12, 2026
  • #969

    Documentation Enhancement Suggestion

    Updated May 11, 2026
  • #962

    [BUG] Incompatible Package Versions

    Updated Jan 15, 2026
  • #954

    [BUG]Connecting to lmflow.org (lmflow.org)|107.23.182.175|:5000... failed: Connection timed out.

    Updated Dec 7, 2025
  • #940

    Connection time out

    Updated Dec 7, 2025
  • #953

    Don't understand LISA

    Updated Nov 28, 2025
  • #897

    Some question on code of LISA

    Updated Jul 29, 2025
  • #942

    [BUG]

    pendingUpdated Apr 7, 2025

> Tags

Pythonchatgptdeep-learninginstruction-followinglanguage-model

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 30, 2026
Category数据库
PricingOpen source

> Related tools

P
PostgreSQL
功能强大的开源关系型数据库
R
Redis
内存数据结构存储,常用作缓存与队列
M
MySQL
广泛使用的开源关系型数据库