Skip to content

Training recipes for Mixture of Experts models with DeepSpeed or HuggingFace, covering routing, load balancing, and expert parallelism.

CCM score
61 of 100
skills.sh installs
1.1K
GitHub stars
14.9K
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers MoE architecture design, top-1 and top-2 routing mechanisms, auxiliary load-balancing and router z-loss terms, and expert parallelism setup
  • Includes runnable PyTorch code for a top-k MoE layer, a deepspeed pretrain_gpt_moe.py launch command, and a DeepSpeed JSON config with moe settings
  • Provides capacity-factor and token-dropping controls for training versus evaluation, plus guidance on inference-time sparse activation
  • Designed for teams training large models under limited compute budgets or implementing sparse architectures like Mixtral or DeepSeek-V3

Install

$ npx -y skills add orchestra-research/ai-research-skills --skill moe-training -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

MoE Training: Mixture of Experts

When to Use This Skill

Use MoE Training when you need to:

  • Train larger models with limited compute (5× cost reduction vs dense models)
  • Scale model capacity without proportional compute increase
  • Achieve better performance per compute budget than dense models
  • Specialize experts for different domains/tasks/languages
  • Reduce inference latency with sparse activation (only 13B/47B params active in Mixtral)
  • Implement SOTA models like Mixtral 8x7B, DeepSeek-V3, Switch Transformers

Notable MoE Models: Mixtral 8x7B (Mistral AI), DeepSeek-V3, Switch Transformers (Google), GLaM (Google), NLLB-MoE (Meta)

Installation

# DeepSpeed with MoE support
pip install deepspeed>=0.6.0

# Megatron-DeepSpeed for large-scale training
git clone https://github.com/microsoft/Megatron-DeepSpeed
cd Megatron-DeepSpeed
pip install -r requirements.txt

# Alternative: HuggingFace Transformers
pip install transformers accelerate

Quick Start

Basic MoE Architecture

import torch
import torch.nn as nn

class MoELayer(nn.Module):
    """Sparse Mixture of Experts layer."""

Details

Repository
github.com/orchestra-research/ai-research-skills
Categories
Data Science & Analytics, AI Agents & LLM Apps
First seen
Jun 3, 2026

Questions

What does the moe-training skill do?

The moe-training skill helps an agent train Mixture of Experts models using DeepSpeed or HuggingFace. It covers MoE architectures, routing mechanisms, load balancing, expert parallelism, and inference optimization, with examples for models like Mixtral 8x7B and DeepSeek-V3.

How do I install the moe-training skill?

Run npx -y skills add orchestra-research/ai-research-skills --skill moe-training -y in a project to install moe-training. Once installed, the agent can use it to plan and set up sparse model training.

Which category does moe-training belong to on Claude Marketplaces?

moe-training is listed in the Data Science & Analytics category on Claude Marketplaces. Its own description and SKILL.md focus on training large sparse models rather than analytics work.

What does the moe-training skill need before I use it?

The moe-training skill relies on deepspeed, transformers, torch and accelerate as its dependencies. Installing DeepSpeed version 0.6.0 or newer and HuggingFace Transformers with accelerate gives the agent the libraries the skill's examples use.

More from orchestra-research/ai-research-skills

All 92

Similar to Moe Training

More Data Science & Analytics