bridge.models.glm.glm47_flash_bridge#

Megatron Bridge for GLM-4.7-Flash (Glm4MoeLiteForCausalLM).

This module registers only the glm4_moe_lite / Flash variant. The full GLM-4.7 model uses the existing GLM45Bridge registration for Glm4MoeForCausalLM / glm4_moe.

GLM-4.7-Flash combines Multi-Latent Attention (MLA, inherited from DeepSeek V3) with GLM-style MoE routing. The safetensors checkpoint uses per-expert weight naming (experts.{i}.gate_proj), not the fused gate_up_proj tensor used by the runtime model, so the DeepSeek common mapping list works directly.

Module Contents#

Classes#

GLM47FlashBridge

Megatron Bridge for GLM-4.7-Flash.

API#

class bridge.models.glm.glm47_flash_bridge.GLM47FlashBridge#

Bases: megatron.bridge.models.conversion.model_bridge.MegatronModelBridge

Megatron Bridge for GLM-4.7-Flash.

GLM-4.7-Flash uses Multi-Latent Attention (MLA) with MoE routing, combining DeepSeek V3-style compressed attention with GLM MoE architecture.

.. rubric:: Example

from megatron.bridge import AutoBridge bridge = AutoBridge.from_hf_pretrained(“zai-org/GLM-4.7-Flash”) provider = bridge.to_megatron_provider()

provider_bridge(
hf_pretrained: megatron.bridge.models.hf_pretrained.causal_lm.PreTrainedCausalLM,
) megatron.bridge.models.mla_provider.MLAModelProvider#

Convert HuggingFace config to MLAModelProvider.

mapping_registry() megatron.bridge.models.conversion.mapping_registry.MegatronMappingRegistry#