slime
What it does
It explains slime, a framework that post-trains large language models with reinforcement learning, using Megatron for training and SGLang for generating outputs. It is for research teams training large models at scale.
When to use it
- βWhen you want reinforcement learning post-training for a large model.
- βWhen you need custom data generation workflows for training.
- βWhen you are training models such as GLM, Qwen3, or Llama 3 with Megatron.
Skill link
https://github.com/NousResearch/hermes-agent/blob/main/optional-skills/mlops/slime/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βSet up a slime post-training run for our Qwen3 model, with a custom data generation workflow.β
5 new skills a week. 1 minute to read.
How it works
The agent sets up the data buffer, the rollout generation with SGLang, and the Megatron training loop, and connects these parts the way the framework's architecture describes.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
slime: LLM Post-Training Framework for RL Scaling
slime is an LLM post-training framework from Tsinghua's THUDM team, powering GLM-4.5, GLM-4.6, and GLM-4.7. It connects Megatron-LM for training with SGLang for high-throughput rollout generation.
When to Use slime
Choose slime when you need:
- Megatron-LM native training with SGLang inference
- Custom data generation workflows with flexible data buffers
- Training GLM, Qwen3, DeepSeek V3, or Llama 3 models
- Research-grade framework with production backing (Z.ai)
Consider alternatives when:
- You need enterprise-grade stability features β use miles
- You want flexible backend swapping β use verl
- You need PyTorch-native abstractions β use torchforge
Key Features
- Training: Megatron-LM with full parallelism support (TP, PP, DP, SP)
- Rollout: SGLang-based high-throughput generation with router
- Data Buffer: Flexible prompt management and sample storage
- Models: GLM-4.x, Qwen3, DeepSeek V3/R1, Llama 3
Architecture Overview
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Data Buffer β
β - Prompt initialization and management β
β - Custom data generation and filtering β
β - Rollout sample storage β
βββββββββββββββ¬ββββββββββββββββββββββββββββ¬ββββββββββββββββ
β β
βββββββββββββββΌββββββββββββ βββββββββββββββΌββββββββββββββββ
β Training (Megatron-LM) β β Rollout (SGLang + Router) β
β - Actor model training β β - Response generation β
β - Critic (optional) β β - Reward/verifier output β
β - Weight sync to rolloutβ β - Multi-turn support β
βββββββββββββββββββββββββββ βββββββββββββββββββββββββββββββ
Installation
# Recommended: Docker
docker pull slimerl/slime:latest
docker run --rm --gpus all --ipc=host --shm-size=16g \
-it slimerl/slime:latest /bin/bash
# Inside container
cd /root/slime && pip install -e . --no-deps
From Source
git clone https://github.com/THUDM/slime.git
cd slime
pip install -r requirements.txt
pip install -e .
Quick Start: GRPO Training
# Source model configuration
source scripts/models/qwen3-4B.sh
# Launch training
python train.py \
--actor-num-nodes 1 \
--actor-num-gpus-per-node 4 \
--rollout-num-gpus 4 \
--advantage-estimator grpo \
--use-kl-loss --kl-loss-coef 0.001 \
--rollout-batch-size 32 \
--n-samples-per-prompt 8 \
--global-batch-size 256 \
--num-rollout 3000 \
--prompt-data /path/to/data.jsonl \
${MODEL_ARGS[@]} ${CKPT_ARGS[@]}
Workflow 1: Standard GRPO Training
Use this workflow for training reasoning models with group-relative advantages.
Prerequisites Checklist
- Docker environment or Megatron-LM + SGLang installed
- Model checkpoint (HuggingFace or Megatron format)
- Training data in JSONL format
Step 1: Prepare Data
# data.jsonl format
{"prompt": "What is 2 + 2?", "label": "4"}
{"prompt": "Solve: 3x = 12", "label": "x = 4"}
Or with chat format:
{
"prompt": [
{"role": "system", "content": "You are a math tutor."},
{"role": "user", "content": "What is 15 + 27?"}
],
"label": "42"
}
Step 2: Configure Model
Choose a pre-configured model script:
# List available models
ls scripts/models/
# glm4-9B.sh, qwen3-4B.sh, qwen3-30B-A3B.sh, deepseek-v3.sh, llama3-8B.sh, ...
# Source your model
source scripts/models/qwen3-4B.sh
Step 3: Launch Training
python train.py \
--actor-num-nodes 1 \
--actor-num-gpus-per-node 8 \
--rollout-num-gpus 8 \
--advantage-estimator grpo \
--use-kl-loss \
--kl-loss-coef 0.001 \
--prompt-data /path/to/train.jsonl \
--input-key prompt \
--label-key label \
--apply-chat-template \
--rollout-batch-size 32 \
--n-samples-per-prompt 8 \
--global-batch-size 256 \
--num-rollout 3000 \
--save-interval 100 \
--eval-interval 50 \
${MODEL_ARGS[@]}
Step 4: Monitor Training
- Check TensorBoard:
tensorboard --logdir outputs/ - Verify reward curves are increasing
- Monitor GPU utilization across nodes
Workflow 2: Asynchronous Training
Use async mode for higher throughput by overlapping rollout and training.
When to Use Async
- Large models with long generation times
- High
FAQ
Which models does it support?
The skill lists GLM-4.x, Qwen3, DeepSeek V3 and R1, and Llama 3.
What are the alternatives?
The skill suggests miles for enterprise stability features, verl for swapping backends, and torchforge for PyTorch-native work.
Who builds it?
The skill says it comes from Tsinghua's THUDM team and powers the GLM models.
Details
Original description by the author
RL post-training for LLMs with Megatron and SGLang.
Popularity
- GitHub stars
- 260k
- Ranking position
- #526
- License
- MIT
- Updated
- 11/2/2026
Comments
- β¦
More skills from this repository
agent-merge-conflict-arbiter
260kSettles a git merge conflict between two agents' branches as a neutral third party, producing one merged result for the repo.
antigravity-cli
260kGuides you through installing, updating, and troubleshooting the Antigravity command line tool, including its plugins, sign-in, and sandbox.
blackbox
260kLets your agent hand a coding task to the Blackbox AI command line tool, which runs several AI models and picks the best result.
dynamic-workflow
260kTeaches your agent to run large batches of similar work as a saved script, so only verified results return to the main conversation.
Similar skills
pytorch-patterns
280kHelps your agent use PyTorch for machine learning models. It applies best practices for efficient model training and ensures reproducible results.
evm-token-decimals
280kHelps your agent avoid errors with decimal numbers across different blockchain networks. It ensures token values are accurate in transactions and calculations.
ito-inference
280kLets your agent check the availability of AI models for use. It connects the compute request with the ready model service.