THUDM/slime

slime is an LLM training framework for RL Scaling.

What it solves

slime tackles the problem of making reinforcement learning (RL) post-training of large language models practical at scale. Training a model with RL requires a tight loop: the model generates new samples (rollout), those samples are scored with rewards or verifiers, and the model is updated based on that feedback. Doing this efficiently usually means stitching together separate tools for training, serving, and data handling, which becomes a heavy, disconnected stack. slime instead provides a single framework where Megatron (training), SGLang (rollout), custom data generation, reward computation, and environment interaction all flow through one shared training/rollout/Data Buffer path. It is designed to be small enough to understand and extend, yet battle-tested behind state-of-the-art model releases.

How it works

slime connects two major engines: Megatron for the training process and SGLang for generating new samples (rollout). A central Data Buffer bridges them, managing prompts, custom data, and rollout generation methods. After training, parameters are synchronized to the rollout module; after rollout, new samples (including rewards and verifier outputs) are stored back into the buffer. Custom generation functions can wrap the rollout loop with multi-turn interactions, tool calls, sandbox execution, and verifier-based rewards, enabling agentic workflows. Configuration is straightforward: Megatron arguments are passed directly, SGLang arguments use a --sglang- prefix, and slime-specific arguments are documented separately. The default transport for payloads is Ray's object store, with an optional straw mode for persistent storage on shared filesystems.

Who it’s for

slime is aimed at researchers and engineers who need to run RL post-training on large language models, especially those doing agentic RL, domain-specific RL, or rollout-system research. It is the framework behind the GLM model family and is used as a reusable substrate by independent projects like Dressage, Miles, vime, Relax, and others. Users should be comfortable with Megatron and SGLang concepts, and typically want to customize data generation, reward functions, verifiers, or environments.

Highlights

  • Production-proven: Used to train GLM-5.3-Flash, GLM-5.3, GLM-5.2, GLM-5.1, GLM-5, GLM-4.7, GLM-4.6, and GLM-4.5.
  • Direct engine integration: Megatron arguments work as-is; SGLang arguments are passed through with a --sglang- prefix.
  • Customizable data generation: Generation functions, reward functions, verifiers, and environments connect through documented interfaces.
  • Agentic RL support: Examples include multi-agent generation, search/RAG-style multi-turn generation, fully-async rollout, and coding-agent RL.
  • Correctness and reliability: Separate rollout-only and train-only debugging, reproducibility controls, recovery, and CPU/GPU tests support long-running experiments.
  • Broad model support: Works with GLM, Qwen, DeepSeek, and Llama 3 families.
  • Ecosystem: Several independent frameworks (Dressage, Miles, vime, Relax, OpenClaw-RL, P1, RLVE, TritonForge, APRIL, qqr, ART) build on slime as their RL substrate.

Related

  • Dispatch
  • Project
  • Dispatch
  • Project
  • Project