Vibeleaderboard
Index / tool
Visit github.com
Category
Developer Tools
Rank
No. 1072Tools index
Pricing
Open Source
Type
TOOL
Use case
Models: Train & Run
GitHub
777 stars
Latest release
v0.2.0
Date

About

LoongForge is an open-source training framework from Baidu AI Cloud's Baige team for training LLMs, VLMs, diffusion, and embodied models on NVIDIA GPUs and Kunlun XPUs. It targets faster training throughput to reduce compute costs for large-model development.

What it does

A Python framework for pre-training and fine-tuning large models across a cluster of accelerators, built around two separate engines. Language, vision-language and image or video generation models run on Baidu's own patched fork of Megatron-LM, the NVIDIA library that splits one model across many GPUs. Robot-control models, which turn camera input and instructions into actions, get a standalone PyTorch trainer instead. Each supported model ships with a ready config and launch script, a bundled converter moves checkpoints between Hugging Face and Megatron formats, and Baidu's Kunlun chips get their own install path and quick-start guides.

Why it's ranked here

Baidu's cloud training team open-sourced this from an internal suite it says has trained customer models on runs of over 5,000 accelerators, and the model list is unusually current: DeepSeek-V4, Kimi-K3, GLM-5.2, Qwen3.8 and nine robot-control model families. It is Apache 2.0 licensed, with test suites for both engines in the tree. The headline speed numbers, 4.38x throughput on one robot model and up to 74% lower overhead from its expert load balancer, are the project's own measurements, backed by its own paper but not independently reproduced. Packaging is rougher than the training code: the package declares itself beta and its command-line entry does not resolve.

What's good

The two-engine split is the design call worth noticing. Large language and multimodal models want Megatron's tensor and pipeline splitting, while robot models are served by plain PyTorch data-parallel and fully sharded training, and neither is forced onto the other. Vision-language models can be assembled in config from a separate vision encoder and language model, with each half given its own parallelism and freezing settings. Dependencies are pinned to exact versions per hardware target. Checkpoint conversion to and from Hugging Face is a first-class tool with per-model weight mappings, which matters when you need the trained weights somewhere else afterward.

Tradeoffs

Nothing installs by default: the base package declares no dependencies, so you pick the GPU, Kunlun or robot install set, and those sets disagree. They pin three different Hugging Face Transformers versions, so one environment cannot serve both the language and robot stacks. The robot set also pins tooling that reads like a frozen developer machine, including a Chinese JupyterLab language pack and pre-commit. The Megatron engine depends on a Baidu fork, so upstream Megatron changes reach you only through that fork. The packaged command points at a function the training module does not define, and that module's export list has a missing comma that breaks a wildcard import.

How to use it well

Fits a team already running multi-node training on NVIDIA or Kunlun hardware that wants tuned recipes for current open-weight models, especially mixture-of-experts models, where its expert balancing and communication overlap apply. Start from the shipped config and launch script for your model rather than the declared command, and use the project's Docker image, which carries every model family in one image, instead of resolving the pins by hand. Benchmark the speed claims on your own cluster before budgeting around them. It is aimed at clusters rather than one-card adapter fine-tunes, and it does not serve models for inference.

Technical notes+

pyproject.toml builds with hatchling, requires Python 3.10 or later, carries the Development Status 4 - Beta classifier and sets dependencies = [], so everything lives in the gpu, xpu and vla extras; those pin transformers at 5.12.1, 4.57.1 and 5.3.0 respectively (accelerate 1.12.0 vs 0.25.0 across gpu and xpu), and vla also pins jupyterlab-language-pack-zh-CN, pre-commit, virtualenv and pynput. [project.scripts] maps LoongForge to loongforge.train:main, but loongforge/train/__init__.py only imports parse_train_args, parse_args_from_config, build_model_trainer, the pretrain_llm/pretrain_vlm, sft_llm/sft_vlm/sft_internvl/sft_ernie and pretrain_wan/pretrain_qwen_image entry modules, and defines no main; its __all__ reads "build_model_trainer" "parse_args_from_config" with no comma, fusing into one nonexistent name, and repeats parse_args_from_config. loongforge/models/__init__.py imports the registry factory (get_model_provider, get_model_config and friends) first, then star-imports the foundation, encoder and diffusion subpackages so model configs register providers as an import side effect. loongforge/__init__.py, loongforge/embodied/__init__.py, loongforge/train/sft/__init__.py and tools/mcore_checkpoint_convert/__init__.py are docstring-only, so the trainer and converter bodies were not read; the tree shows huggingface, mcore and key_mappings subpackages under the converter. docs/source/index.rst carries Kunlun P800 install and quick-start pages and LLM/VLM checkpoint-conversion tutorials. Ruff ignores F841 and E501 repo-wide. The project.urls Changelog entry is a bare relative filename, not a URL. No injection-shaped text in the read files beyond the README's request to star the repository; the tree includes an agent-instructions file at the root that was not fetched.

Observed

License
Apache-2.0 (LICENSE file and package metadata)
Language
Python, requires 3.10 or later
Packaging
hatchling build; base package declares no dependencies, installs via gpu, xpu or vla extras
Hardware targets
NVIDIA GPUs and Baidu Kunlun XPUs, with separate pinned dependency sets
Training backends
Patched Megatron-LM fork for LLM, VLM and diffusion; torch-native DDP/FSDP trainer for embodied models
Declared maturity
Development Status 4 - Beta classifier
Command-line entry
Declared as loongforge.train:main; the train package read defines no main
Checkpoint tooling
Hugging Face to Megatron checkpoint converter shipped under tools
Tests
Test directories for the embodied and LLM/VLM stacks in the tree; pytest in the test dependency group
Distribution
Prebuilt Docker images on Docker Hub, one image across model families

Read from README.md, pyproject.toml, LICENSE, loongforge/__init__.py, loongforge/train/__init__.py, loongforge/train/sft/__init__.py, loongforge/models/__init__.py, loongforge/embodied/__init__.py, docs/source/index.rst, tools/mcore_checkpoint_convert/__init__.py.

Tags

trainingllmvlmdiffusiongpuopen-source

Tech Stack

Python

Comments (0)

No comments yet

Editorially curated, with community endorsements as a secondary signal. Corrections welcome.