EfficientMoE/MoE-Infinity

PyTorch library for cost-effective, fast and easy serving of MoE models.

What it solves

MoE-Infinity enables users to run massive Mixture-of-Experts (MoE) models on hardware that lacks enough GPU memory to hold the entire model at once. It solves the memory bottleneck by intelligently offloading expert weights to host memory and SSD, fetching them only when necessary.

How it works

The library uses an activation-aware cache to keep the most frequently used ("hot") experts on the GPU. It employs tracing and prefetching techniques to hide the time cost of moving data from storage to the GPU. For production, it provides an OpenAI-compatible server that supports continuous batching, paged KV caching, and streaming, ensuring efficient resource utilization.

Who it’s for

It is designed for developers and researchers working with large MoE models (such as DeepSeek, Mixtral, or Qwen3-MoE) who need to perform inference on memory-constrained hardware or single-server multi-GPU setups.

Highlights

  • Cost-effective: Allows serving large models on smaller GPUs by offloading experts to SSD and host memory.
  • Production-ready: Includes an OpenAI-compatible HTTP server with features like continuous batching, streaming, and health monitoring.
  • Fast: Uses optimized CUDA kernels, expert caching, and prefetching to minimize latency.
  • Multi-GPU support: Automatically distributes expert parameters across multiple GPUs in a single server.
  • Broad compatibility: Supports a wide range of HuggingFace MoE checkpoints with specific optimizations for models like DeepSeek-V4-Flash and GLM-5.3.

Related

  • Project
  • Project
  • Dispatch
  • Project
  • Project