Registry / ai-ml / mbridge

mbridge

JSON →
library0.15.1pypypiunverified

A bridge library to convert and connect Megatron-Core checkpoints to Hugging Face format and support Reinforcement Learning workflows. Current version 0.15.1, with frequent releases matching Megatron-Core versions. Supports LLMs and VLMs including DeepSeek v3, GLM-4.5, Gemma 3, InternVL3.

ai-mlllm-agentsdata
Install & Compatibility
Where this runs
tested against v0.15.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 18.8MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.6s · import 0.000s · 19MB
17MB installed
● package 17MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

from mbridge import BridgeConverter

Basic usage of BridgeConverter to convert between Hugging Face and Megatron-Core formats.

from mbridge import BridgeConverter converter = BridgeConverter( hf_model_path="path/to/hf/model", mc_model_path="/path/to/mcore/model", model_type="llama", num_layers=32, hidden_size=4096, num_attention_heads=32, tensor_parallel=1, pipeline_parallel=1 ) # Convert Hugging Face to Megatron-Core converter.hf_to_mc() # Convert Megatron-Core to Hugging Face converter.mc_to_hf()
mbridge --version
Debug
Known footguns
breakingFrom v0.15.0, `tie_embedding_weights` handling changed. Checkpoints converted with older versions may have mismatched embedding layers.
gotchaTensor and pipeline parallelism settings must match the Megatron-Core training configuration. Mismatched settings can cause silent shape errors.
deprecatedThe `--model-parallel-size` argument has been deprecated in favor of `--tensor-model-parallel-size` and `--pipeline-model-parallel-size`.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
20 hits · last 30 days
gptbot
4
ahrefsbot
3
amazonbot
3
bytedance
2
claudebot
2
script
1
Resources