Skip to content

vllm.model_executor.models.laguna

Inference-only Laguna model compatible with HuggingFace weights.

Classes:

  • LagunaAttention –

    Laguna attention with optional softplus output gating.

  • LagunaMLP –

    Dense MLP for Laguna.

  • LagunaMoE –

    Sparse MoE block for Laguna with optional shared expert and sigmoid routing.

Functions:

  • get_mlp_layer_types –

    Return which layers are MoE, rejecting configs predating Transformers support.

LagunaAttention

Bases: Module

Laguna attention with optional softplus output gating.

Supports per-layer sliding window attention when config.layer_types is present. Layers whose type is "sliding_attention" use config.sliding_window; all other layers (typically labelled "full_attention") use full attention. When layer_types is absent every layer defaults to full attention for backwards compatibility.

LagunaMLP

Bases: Module

Dense MLP for Laguna.

LagunaMoE

Bases: Module

Sparse MoE block for Laguna with optional shared expert and sigmoid routing.

Key differences from other MoE implementations: - Uses SIGMOID routing activation (not softmax) - Shared expert runs in parallel with routed experts (when enabled) - Matches HF reference: modular_laguna.py LagunaSparseMoeBlock

get_mlp_layer_types(config)

Return which layers are MoE, rejecting configs predating Transformers support.