back to home

THUDM / slime

slime is an LLM post-training framework for RL Scaling.

4,808 stars
642 forks
247 issues
PythonShellCuda

AI Architecture Analysis

This repository is indexed by RepoMind. By analyzing THUDM/slime in our AI interface, you can instantly generate complete architecture diagrams, visualize control flows, and perform automated security audits across the entire codebase.

Our Agentic Context Augmented Generation (Agentic CAG) engine loads full source files into context on-demand, avoiding the fragmentation of traditional RAG systems. Ask questions about the architecture, dependencies, or specific features to see it in action.

Source files are only loaded when you start an analysis to optimize performance.

Embed this Badge

Showcase RepoMind's analysis directly in your repository's README.

[![Analyzed by RepoMind](https://img.shields.io/badge/Analyzed%20by-RepoMind-4F46E5?style=for-the-badge)](https://repomind.in/repo/THUDM/slime)
Preview:Analyzed by RepoMind

Repository Overview (README excerpt)

Crawler view

slime 中文版 **slime** is an LLM post-training framework for RL scaling, providing two core capabilities: • **High-Performance Training**: Supports efficient training in various modes by connecting Megatron with SGLang; • **Flexible Data Generation**: Enables arbitrary training data generation workflows through custom data generation interfaces and server-based engines. slime is the RL-framework behind GLM-5, GLM-4.7, GLM-4.6, GLM-4.5 and apart from models from Z.ai, we also supports the following models: • Qwen3 series (Qwen3Next, Qwen3MoE, Qwen3), Qwen2.5 series; • DeepSeek V3 series (DeepSeek V3, V3.1, DeepSeek R1); • Llama 3. Blogs • Our vision: slime: An SGLang-Native Post-Training Framework for RL Scaling. • Our ideas on agentic training: Agent-Oriented Design: An Asynchronous and Decoupled Framework for Agentic RL • v0.1.0 release note: v0.1.0: Redefining High-Performance RL Training Frameworks Table of Contents • Architecture Overview • Quick Start • Projects Built with slime • Arguments Walkthrough • Developer Guide • FAQ & Acknowledgements Architecture Overview **Module Descriptions**: • **training (Megatron)**: Responsible for the main training process, reads data from the Data Buffer, and synchronizes parameters to the rollout module after training. • **rollout (SGLang + router)**: Generates new data (including rewards/verifier outputs) and stores it in the Data Buffer. • **data buffer**: A bridge module that manages prompt initialization, custom data, and rollout generation methods. Quick Start For a comprehensive quick start guide covering environment setup, data preparation, training startup, and key code analysis, please refer to: • Quick Start Guide We also provide examples for some use cases not covered in the quick start guide; please check examples. Projects Built upon slime slime has powered several novel research projects and production systems. Here are some notable examples: 🦞 OpenClaw-RL: Train a Personalized Clawbot Simply by Talking to It **OpenClaw-RL** is an RL server for personalized OpenClaw agents. It hosts the OpenClaw model and improves it from prior conversations across deployments, while slime's asynchronous RL infrastructure prevents training from interfering with API serving. It supports two automatic optimization methods: GRPO with binary feedback inferred from subsequent states, and on-policy distillation that extracts hindsight hints from later feedback for the current policy. ⚛️ P1: Mastering Physics Olympiads with Reinforcement Learning **P1** is a family of open-source physics reasoning models trained entirely through reinforcement learning. P1 leverages slime as the RL post training framework, and introduces a multi-stage RL training algorithm that progressively enhances reasoning ability through adaptive learnability adjustment and stabilization mechanisms. Enpowered by this training paradigm, P1 delivers breakthrough performance in open-source physics reasoning. 📈RLVE: Scaling LM RL with Adaptive Verifiable Environments **RLVE** introduces an approach using verifiable environments that procedurally generate problems and provide algorithmically verifiable rewards, to scale up RL for language models (LMs). With joint training across 400 verifiable environments, RLVE enables each environment to dynamically adapt its problem difficulty distribution to the policy model's capabilities as training progresses. ⚡ TritonForge: Agentic RL Training Framework for Kernel Generation **TritonForge** leverages slime's SFT & RL capabilities to train LLMs that automatically generate optimized GPU kernels. By using a two-stage training approach—supervised fine-tuning followed by reinforcement learning with multi-turn compilation feedback—TritonForge achieves remarkable results in converting PyTorch operations into high-performance Triton kernels. 🚀 APRIL: Accelerating RL Training with Active Partial Rollouts **APRIL** introduces a system-level optimization that seamlessly integrates with slime to accelerate the rollout generation phase in RL training. By intelligently over-provisioning requests and actively managing partial completions, APRIL addresses the long-tail generation bottleneck that typically consumes over 90% of RL training time. 🏟️ qqr: Scaling Open-Ended Agents with ArenaRL & MCP **qqr** (a.k.a. hilichurl) is a lightweight extension for slime designed to evolve open-ended agents. It implements the **ArenaRL** algorithm to tackle discriminative collapse through tournament-based relative ranking (**e.g., Seeded Single-Elimination, Round-Robin**) and seamlessly integrates the **Model Context Protocol (MCP)**. qqr leverages slime's high-throughput training capabilities to enable scalable, distributed evolution of agents in standardized, decoupled tool environments. These projects showcase slime's versatility—from training code-generation models to optimizing RL training systems—making it a powerful foundation for both research and production deployments. Arguments Walkthrough Arguments in slime are divided into three categories: • **Megatron arguments**: slime reads all arguments in Megatron. You can configure Megatron by passing arguments like . • **SGLang arguments**: All arguments for the installed SGLang are supported. These arguments must be prefixed with . For example, should be passed as . • **slime-specific arguments**: Please refer to: slime/utils/arguments.py For complete usage instructions, please refer to the Usage Documentation. Developer Guide • **Contributions are welcome\!** If you have suggestions for new features, performance tuning, or feedback on user experience, feel free to submit an Issue or PR 😊 • Use pre-commit to ensure code style consistency for your commits: • For debugging tips, please refer to the Debugging Guide FAQ & Acknowledgements • For frequently asked questions, please see the Q\&A • Special thanks to the following projects & communities: SGLang, Megatron‑LM, mbridge, OpenRLHF, veRL,…