DJLougen / LFM2-24B-A2B-REAP

huggingface.co
Total runs: 0
24-hour runs: 0
7-day runs: 0
30-day runs: 0
Model's Last Updated: March 10 2026
text-generation

Introduction of LFM2-24B-A2B-REAP

Model Details of LFM2-24B-A2B-REAP

LFM2-24B-A2B-REAP — Expert-Pruned LiquidAI LFM2

Router-weighted Expert Activation Pruning (REAP) applied to LiquidAI/LFM2-24B-A2B , reducing experts from 64 → 32 per MoE layer (50% expert reduction).

What is REAP?

REAP (Router-weighted Expert Activation Pruning) analyzes the router gate weights in Mixture-of-Experts models to identify which experts contribute least to model outputs. Experts with the lowest router weight magnitudes — indicating they are rarely or weakly selected during inference — are pruned. The remaining experts retain their original weights, preserving model quality while significantly reducing size.

Model Details
Property Original REAP'd
Total Parameters 24B ~14B
Active Parameters 2.3B 2.3B
Experts per MoE layer 64 32
Experts per token 4 4
MoE layers 38 (layers 2-39) 38 (layers 2-39)
Dense layers 2 (layers 0-1) 2 (layers 0-1)
Total layers 40 40
Hidden size 2048 2048
MoE intermediate size 1536 1536
Context length 128K 128K
Vocabulary 65,536 65,536
Architecture

LFM2-24B-A2B is a hybrid architecture combining:

  • 30 convolutional layers (short convolution with gated projections)
  • 10 full attention layers (GQA with 32 heads, 8 KV heads)
  • 38 MoE FFN layers (layers 2-39, with top-4 routing from 64 experts)
  • 2 dense FFN layers (layers 0-1, dense feed-forward with intermediate_size=11776)

The MoE routing uses:

  • Softmax-normalized top-4 selection
  • Expert bias terms (learnable per-expert additive bias)
  • Routing scaling factor of 1.0
Available Quantizations
GGUF (llama.cpp)
Quantization Size Description
BF16 24 GB Full precision pruned model
Q8_0 13 GB 8-bit quantization
Q6_K 9.5 GB 6-bit k-quant
Q5_K_M 8.2 GB 5-bit k-quant (medium)
Q4_K_M 7.0 GB 4-bit k-quant (medium) — recommended
MLX (Apple Silicon)
Quantization Size Description
4-bit (4.5 bpw) 6.5 GB 4-bit MLX quantization
8-bit (8.5 bpw) 13 GB 8-bit MLX quantization
Usage
llama.cpp
# Q4_K_M (recommended for most use cases)
llama-cli -m LFM2-24B-A2B-REAP-Q4_K_M.gguf \
  --jinja -ngl 99 -fa \
  --temp 0.7 --top-k 40 --top-p 0.95 \
  -c 32768 -n 8192

# BF16 (full precision, needs ~32GB RAM)
llama-cli -m LFM2-24B-A2B-REAP-BF16.gguf \
  --jinja -ngl 99 -fa \
  -c 32768 -n 8192
MLX (Apple Silicon)
from mlx_lm import load, generate

model, tokenizer = load("DJLougen/LFM2-24B-A2B-REAP-MLX-4bit")
response = generate(model, tokenizer, prompt="Hello!", max_tokens=512)
Transformers
from transformers import AutoModelForCausalLM, AutoTokenizer

model = AutoModelForCausalLM.from_pretrained(
    "DJLougen/LFM2-24B-A2B-REAP",
    torch_dtype="bfloat16",
    device_map="auto",
    trust_remote_code=True,
)
tokenizer = AutoTokenizer.from_pretrained("DJLougen/LFM2-24B-A2B-REAP")
REAP Methodology
Expert Importance Scoring

For each MoE layer, expert importance is computed from the router gate weight matrix W_gate ∈ R^{num_experts × hidden_size} :

importance(expert_i) = ||W_gate[i, :]||_2

Experts with the lowest L2 norm of their router weight vectors are pruned. This metric captures how strongly the router can direct tokens to each expert — experts with small weight norms are rarely or weakly selected.

Pruning Process
  1. Extract router weights from all 38 MoE layers
  2. Compute L2 importance for each of 64 experts per layer
  3. Select bottom 32 experts (per layer, independently) for removal
  4. Slice expert tensors to remove pruned experts' parameters
  5. Update router gate to match reduced expert count
  6. Update expert bias vector to match reduced expert count
  7. Update model config ( num_experts: 64 → 32 )
Tensors Modified

Per MoE layer (38 layers × 5 tensor types = 190 tensors pruned):

Tensor Original Shape Pruned Shape
ffn_gate_inp (router) [64, 2048] [32, 2048]
ffn_gate_exps (w1) [64, 1536, 2048] [32, 1536, 2048]
ffn_up_exps (w3) [64, 1536, 2048] [32, 1536, 2048]
ffn_down_exps (w2) [64, 2048, 1536] [32, 2048, 1536]
exp_probs_b (bias) [64] [32]
What's Preserved
  • All dense layer weights (layers 0-1)
  • All attention/conv layer weights
  • All normalization parameters
  • Token embeddings
  • Tokenizer and chat template
  • Active parameter count (2.3B) remains the same since top-4 routing is preserved
Evaluation
Inference Performance (DGX Spark, Q4_K_M)
Metric Value
Prompt processing 89.9 tok/s
Generation speed 117.4 tok/s
Model load time ~3s
Quality

The REAP'd model produces coherent, correct outputs. Perplexity benchmarks to be added.

Hardware Requirements
Format VRAM/RAM Needed Recommended Hardware
Q4_K_M ~10 GB Any modern GPU / M-series Mac
Q8_0 ~17 GB RTX 3090/4090 / M-series Mac
BF16 ~30 GB DGX Spark / A100 / M-series Max
Reproduction
# 1. Run REAP pruning
python reap_lfm2.py \
    --input LFM2-24B-A2B-BF16.gguf \
    --output_dir ./lfm2-reap \
    --target_experts 32

# 2. Quantize GGUF variants
llama-quantize LFM2-24B-A2B-REAP-BF16.gguf LFM2-24B-A2B-REAP-Q4_K_M.gguf Q4_K_M
llama-quantize LFM2-24B-A2B-REAP-BF16.gguf LFM2-24B-A2B-REAP-Q5_K_M.gguf Q5_K_M
llama-quantize LFM2-24B-A2B-REAP-BF16.gguf LFM2-24B-A2B-REAP-Q6_K.gguf Q6_K
llama-quantize LFM2-24B-A2B-REAP-BF16.gguf LFM2-24B-A2B-REAP-Q8_0.gguf Q8_0

# 3. Create MLX versions
python prune_safetensors_for_mlx.py --expert_mapping expert_mapping.json --output_dir mlx-reap-hf
mlx_lm.convert --hf-path mlx-reap-hf --mlx-path mlx-reap-4bit -q --q-bits 4
mlx_lm.convert --hf-path mlx-reap-hf --mlx-path mlx-reap-8bit -q --q-bits 8
Citation

If you use this model, please cite the original LFM2 work:

@article{liquidai2025lfm2,
    title={LFM2: Liquid Foundation Models 2},
    author={Liquid AI},
    journal={arXiv preprint arXiv:2511.23404},
    year={2025}
}
License

This model inherits the LFM 1.0 License from the base model.


Created by DJLougen using REAP (Router-weighted Expert Activation Pruning)

Runs of DJLougen LFM2-24B-A2B-REAP on huggingface.co

0
Total runs
0
24-hour runs
0
3-day runs
0
7-day runs
0
30-day runs

More Information About LFM2-24B-A2B-REAP huggingface.co Model

More LFM2-24B-A2B-REAP license Visit here:

https://choosealicense.com/licenses/lfm1.0

LFM2-24B-A2B-REAP huggingface.co

LFM2-24B-A2B-REAP huggingface.co is an AI model on huggingface.co that provides LFM2-24B-A2B-REAP's model effect (), which can be used instantly with this DJLougen LFM2-24B-A2B-REAP model. huggingface.co supports a free trial of the LFM2-24B-A2B-REAP model, and also provides paid use of the LFM2-24B-A2B-REAP. Support call LFM2-24B-A2B-REAP model through api, including Node.js, Python, http.

LFM2-24B-A2B-REAP huggingface.co Url

https://huggingface.co/DJLougen/LFM2-24B-A2B-REAP

DJLougen LFM2-24B-A2B-REAP online free

LFM2-24B-A2B-REAP huggingface.co is an online trial and call api platform, which integrates LFM2-24B-A2B-REAP's modeling effects, including api services, and provides a free online trial of LFM2-24B-A2B-REAP, you can try LFM2-24B-A2B-REAP online for free by clicking the link below.

DJLougen LFM2-24B-A2B-REAP online free url in huggingface.co:

https://huggingface.co/DJLougen/LFM2-24B-A2B-REAP

LFM2-24B-A2B-REAP install

LFM2-24B-A2B-REAP is an open source model from GitHub that offers a free installation service, and any user can find LFM2-24B-A2B-REAP on GitHub to install. At the same time, huggingface.co provides the effect of LFM2-24B-A2B-REAP install, users can directly use LFM2-24B-A2B-REAP installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

LFM2-24B-A2B-REAP install url in huggingface.co:

https://huggingface.co/DJLougen/LFM2-24B-A2B-REAP

Url of LFM2-24B-A2B-REAP

LFM2-24B-A2B-REAP huggingface.co Url

Provider of LFM2-24B-A2B-REAP huggingface.co

DJLougen
ORGANIZATIONS

Other API from DJLougen

huggingface.co

Total runs: 76
Run Growth: -874
Growth Rate: -1150.00%
Updated:April 10 2026
huggingface.co

Total runs: 11
Run Growth: -612
Growth Rate: -5563.64%
Updated:April 10 2026
huggingface.co

Total runs: 9
Run Growth: -634
Growth Rate: -7044.44%
Updated:April 10 2026
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:January 13 2026
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:January 13 2026
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:May 05 2026