# pjlab-sys4nlp/llama-moe

⛷️ LLaMA-MoE: Building Mixture-of-Experts from LLaMA with Continual Pre-training (EMNLP 2024)

Repository: https://github.com/pjlab-sys4nlp/llama-moe
Canonical: https://ross.abutalabs.com/products/llama-moe
Homepage: https://arxiv.org/abs/2406.16554
Language: Python
License: Apache-2.0
License Family: permissive
Topics: llama, llm, mixture-of-experts, moe, continual-pre-training, expert-partition
Last push: 2024-12-06T04:47:07+00:00

## Health v2 (maintenance only)
Score: 19/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 0, release rhythm 8, longevity 81
- inputs: {"age_days": 1136, "days_push": 635, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1001, forks 61 (observed 2026-09-03T02:15:16.915343+00:00)

## What it is
LLaMA-MoE is a Python toolkit and model series for building Mixture-of-Experts (MoE) language models from dense LLaMA models via expert construction and continual pre-training. It provides multiple expert partitioning methods, gating strategies, and efficient training utilities with FlashAttention-v2 and streaming data loading.

## Use cases
- convert a dense LLaMA model into a mixture-of-experts model
- continually pre-train an MoE LLM on my own dataset
- compare expert construction methods like clustering or co-activation graph partitioning
- train a small affordable sparse MoE model with top-K gating
- fine-tune an MoE language model with supervised fine-tuning
- monitor gate load and balance loss during MoE training

## When to choose
- you want to build or study MoE models derived from existing dense LLMs
- you need a lightweight ~3.5B activated-parameter open model for research or deployment
- you want reproducible code from a published EMNLP 2024 paper on MoE construction

## When to avoid
- you need a production inference server rather than a training/research toolkit
- you lack multi-GPU resources for continual pre-training
- you want a general-purpose LLM fine-tuning framework without MoE specifics

## Facets
- artifact type: library
- maturity: active
- function: llm-training, machine-learning, deep-learning, sdk
- domain: large-language-models, machine-learning, deep-learning
- platform: python
- tags: mixture-of-experts, llama, continual-pre-training, expert-partitioning, moe, model-training, huggingface, natural-language-processing, gpu, linux

## Member repositories
- pjlab-sys4nlp/llama-moe (main) score 19

## Provenance
- Observed fields: from GitHub, fetched 2026-09-03T02:15:16.915343+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T07:16:08.453454+00:00, confidence not recorded.
  - readme: https://github.com/pjlab-sys4nlp/llama-moe (fetched 2026-09-03T02:15:16.915343+00:00, sha fb75f77e7ac1)
  - homepage: https://arxiv.org/abs/2406.16554 (fetched 2026-08-29T13:14:17.741131+00:00, sha ff7adda366dc)
  - site_page: https://info.arxiv.org/about/donate.html (fetched 2026-08-29T13:14:17.743698+00:00, sha cca9c3a11c56)
  - site_page: https://info.arxiv.org/about/ourmembers.html (fetched 2026-08-29T13:14:17.746896+00:00, sha 47cbc55ff1de)
  - site_page: https://info.arxiv.org/about (fetched 2026-08-29T13:14:17.748685+00:00, sha a1f16f915a9a)
  - site_page: https://info.arxiv.org/labs/index.html (fetched 2026-08-29T13:14:17.745344+00:00, sha b14a8d05a0ec)
- Data as of 2026-08-30T08:39:29.467469+00:00.
