slime puts Megatron training and SGLang rollout on one RL dataflow path
slime is an LLM post-training framework for RL Scaling.
At a glance
- What is it?
- slime is a Python post-training framework from THUDM that connects Megatron to SGLang for reinforcement learning and routes custom data generation, reward, and verifier work through a single training / rollout / Data Buffer path. It is opinionated about one rollout backend and reaches engine options by string prefix rather than by wrapper.
- Who is it for?
- slime fits a team that has already committed to Megatron and SGLang and wants reward, verifier, and agent logic to live inside one loop rather than beside it. It does not fit anyone shopping for a swappable inference backend, an unpinned reproducible environment, or a pure Python install, because the wheel tag, the dependency list, and the single-backend choice each remove one of those options.
- Can I use it commercially?
- Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 10 days ago.
- What is it written in?
- Mainly Python, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 15, 2026, and from our analysis. They are not legal advice.
Star history
- THUDM/slime8,827 ★ · +379
| Repository | 2026-09-12 | 2026-11-15 |
|---|---|---|
| THUDM/slime | 8.4k | 8.8k |
379 Stars in the last 64 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
Reward and verifier logic plugs into one path, it does not get its own
slime states two capabilities: high-performance training, achieved by connecting Megatron with SGLang, and flexible data generation, through custom data generation interfaces and server-based engines. What makes them one framework rather than two is routing. Megatron training, SGLang rollout, custom data generation, reward computation, verifier feedback, and environment interaction all travel through the same training / rollout / Data Buffer path, and the stated goal is that these capabilities reinforce each other without becoming a heavy stack of disconnected trainers, rollout services, and agent frameworks. The consequence for a reader is direct. Your reward function, your verifier, your sandbox, and your multi-agent setup are not subsystems registered beside the framework, they are data generation or reward workflows that plug into an existing path. Math, code, search, tools, verifiers, environments, and long-horizon agentic work all sit in that one category. Anything that needs to see or alter the training step itself has to go around the path rather than through it. The project names itself as the RL framework behind GLM-4.5 through GLM-5.3 and also lists Qwen3.8, Qwen3.6, Qwen3.5, Qwen3Next, Qwen3MoE, Qwen3, Qwen2.5, DeepSeek V3, V3.1, R1, and Llama 3, which is its own claim about what it has run rather than a benchmark.
Any SGLang flag is reachable by prefix, and nothing checks the suffix
The extension mechanism for the rollout engine is a string prefix. Every argument the installed SGLang supports is reachable by adding --sglang- in front, so a serving knob such as --mem-fraction-static is written as --sglang-mem-fraction-static on the slime command line. Megatron arguments are handled the other way round: slime reads them directly with no slime-prefixed variant, which keeps Megatron-side parallelism, optimizer, checkpointing, and model options available without wrapper code. The trade shows up in two places. Because acceptance is decided by the installed SGLang and not by slime, the set of legal flags changes when the engine version changes. And SGLang itself is not listed in requirements.txt; the only version floors there are sglang-router>=0.3.0, straw-queue>=0.1.5 and sunabako>=0.1.2, leaving the rest to your environment.
SGLang is the only rollout backend, and the narrowing is deliberate
slime is built around one inference engine; the README connects Megatron with SGLang, and its linked blog calls slime an SGLang-native post-training framework. That is a coherent position and it is also a hard boundary. There is no second rollout backend inside slime, so a deployment SGLang will not serve, whether because of a model it will not load or a hardware combination it will not accelerate, has no fallback path in the framework and the search for another engine becomes your work. Topology that does not fit one uniform SGLang group is handled by other means. An optional YAML configuration covers server groups, multiple models, and per-group overrides. A separate document covers PD disaggregation, which separates prefill and decode resources.
Disk transport lets the rollout side sit on other GPUs or another vendor
The least conventional capability is moving serving out of the training job. The external rollout engines path exists for deployments where serving is managed elsewhere: serving processes are managed outside the training job, and disk-based updates work across different GPU fleets. That changes what the two halves of the loop are joined by. Without it, the coupling is a live connection between a trainer and rollout workers it launched. With disk transport the coupling becomes a checkpoint artifact and the contents of a shared directory, and the bill moves to disk throughput, to filesystem semantics, and to how long a large model's weights take to travel. The requirements file shows the parts that come with this, with xxhash annotated as being for disk delta weight sync, covering checksum and codec, and zstandard sitting beside it for compression. Delta weight sync has documentation of its own, described as sending changed weight bytes over shared storage, so the update path is a designed component rather than a side effect of the layout.
The dependency filter drops whole-line comments and keeps the trailing ones
setup.py reads its dependencies from requirements.txt through a helper that reads the file, strips each line, drops blanks, and drops lines beginning with a hash:
def _fetch_requirements(path):
with open(path) as fd:
return [r.strip() for r in fd.readlines() if r.strip() and not r.startswith("#")]The file holds twenty-seven entries and three of them carry trailing comments: memray for debugging, qwen_vl_utils marked for VLM, and xxhash marked as disk delta weight sync. The helper tests the start of a line and not the end, and in this file no line begins with a hash at all, so those three annotations stay attached to the package names as they move into install_requires and whatever happens to them next is left to the toolchain. Three entries carry a version floor, sglang-router>=0.3.0, straw-queue>=0.1.5 and sunabako>=0.1.2. Everything else, including ray[default], transformers, datasets, accelerate, anthropic, openai, openai-agents, e2b, mcp[cli], httpx[http2], blake3, blobfile, numba, omegaconf, pillow, pylatexenc, pyyaml, safetensors, tensorboard, wandb, and zstandard, is unpinned, so two installs of the same release are not guaranteed to resolve the same versions. Neither Megatron nor SGLang nor a deep learning framework is named in this file, which fits a tree that ships build_conda.sh and a docker/ directory for the environment.
setup.py forces a platform wheel and lets the build machine pick the tag
slime is pure Python by content, but its build refuses to say so. setup.py subclasses bdist_wheel and finalize_options sets root_is_pure to False, which produces a platform-specific wheel for a package with no extension modules. The tag is then computed by hand instead of being delegated:
class bdist_wheel(_bdist_wheel):
def finalize_options(self):
_bdist_wheel.finalize_options(self)
self.root_is_pure = False
def get_tag(self):
python_version = f"cp{sys.version_info.major}{sys.version_info.minor}"
abi_tag = f"{python_version}"
if platform.system() == "Linux":
platform_tag = "manylinux1_x86_64"
else:
platform_tag = platform.system().lower()
return python_version, abi_tag, platform_tagBoth decisions put the choice on the machine doing the build rather than on the package. The interpreter tag is read from the Python running setup.py, so the minor version of your builder is the minor version the resulting wheel claims. The platform tag is the hardcoded string manylinux1_x86_64 on any Linux system regardless of which libc is underneath, and on everything else it becomes the lowercased operating system name, so the same source built on macOS and on Linux yields two different tags. Given that the package classifiers name NVIDIA CUDA and distributed computing as its environment, expect to build rather than to pick up a wheel, and read the tag on anything you download before assuming it fits.
pytest is pinned to ./tests and will not descend into examples
The test configuration is deliberately narrow, and the comment on testpaths gives the reason: an explicit path is required to avoid importing another module named tests.
[tool.pytest.ini_options]
# durations=0 will display all tests execution time, sorted in ascending order starting from from the slowest one.
# -vv will also display tests with duration = 0.00s
addopts = "--verbose --pyargs --durations=0 --strict-markers" # always add these arguments to pytest
testpaths = ["./tests"] # must be an explicit path to avoid importing another "tests" module
# directories to ignore when discovering tests
norecursedirs = [
"external",
"examples",
"docs",
"scripts",
"tools",
"tutorials",
"*.egg",
".*",
"_darcs",examples/ sits in the ignore list, which is the right trade for discovery speed and also means the workflows under it are not checked by a bare pytest run. Thirteen of them are named for what they exercise: coding_agent_rl, delta_weight_sync, eval_multi_task, fully_async, geo3k_vlm, geo3k_vlm_multi_turn, multi_agent, on_policy_distillation, retool, search-r1, strands_sglang, tau-bench, and train_infer_mismatch_helper. Someone who starts from one of those directories is picking up a workflow the default collection never looked at, so the arguments inside that directory are the only description of it. strict-markers turns an unregistered marker into an error rather than a warning, and durations=0 asks for every test duration to be printed, which becomes a wall of output once GPU end-to-end tests are included.
The linter allows 320-character lines while the formatter wraps at 119
Style configuration is split across three tools that do not agree with each other. isort and black both use a line length of 119, with isort set to the black profile and py_version pinned to 310. ruff is set to something else:
[tool.ruff]
line-length = 320 # TODO
[tool.ruff.lint]
select = [
"E", # Pycodestyle Errors (Structural/Fundamental Errors like bad indentation)
"F", # Pyflakes (Core Errors: Unused imports, undefined names)
"B", # Flake8-Bugbear (Logic Bugs: Variable shadowing, dangerous default arguments)
"UP", # pyupgrade (Modernization and compatibility issues)
]
ignore = [
"E402", # module-import-not-at-top-of-file
"E501", # Line too long # TODO handle it later
]The 320 carries a TODO in the file, and E501, the long line rule, is ignored with a second TODO, so the net effect is that lines far past the formatter's 119 pass review. The rest of the rule set is a sensible one for infrastructure code, covering pycodestyle errors, pyflakes, bugbear, and pyupgrade. Dependencies show the same unfinished quality. memray is a mandatory install because it is needed for debugging, with a comment saying it is lightweight and could move to dev mode once pyproject.toml is used, and extras_require is an empty dict, so every package in the list is required rather than optional. The interpreter floor is 3.10, and the classifiers name 3.10, 3.11, and 3.12 and nothing newer.
Editorial conclusion
slime fits a team that has already committed to Megatron and SGLang and wants reward, verifier, and agent logic to live inside one loop rather than beside it. It does not fit anyone shopping for a swappable inference backend, an unpinned reproducible environment, or a pure Python install, because the wheel tag, the dependency list, and the single-backend choice each remove one of those options. Before starting, check whether your model and your rollout hardware are on the supported lists, read the fault tolerance and reproducibility documents rather than assuming a long run survives a node loss.
Frequently asked questions
What is THUDM/slime used for?
It is an LLM post-training framework for RL scaling. It provides two capabilities: high-performance training by connecting Megatron with SGLang, and flexible data generation through custom data generation interfaces and server-based engines.
How do I pass an SGLang option to THUDM/slime?
Add the --sglang- prefix, so a serving flag such as --mem-fraction-static is passed as --sglang-mem-fraction-static. Megatron arguments need no prefix because slime reads them directly.
Can THUDM/slime run an inference engine other than SGLang?
No alternative backend is offered. The README connects Megatron training with SGLang rollout, and its linked blog calls slime an SGLang-native post-training framework.
Which Python versions does THUDM/slime support?
setup.py sets python_requires to >=3.10 and the classifiers name 3.10, 3.11, and 3.12. The wheel tag is built from the interpreter running the build, so the builder's minor version ends up in the tag it publishes.
How are rewards and verifiers added in THUDM/slime?
As data generation or reward workflows that plug into the same training / rollout / Data Buffer path used by everything else. Custom generate functions can wrap rollout with multi-turn loops, tool calls, environment/sandbox interaction, and verifier-based reward.
Which models does THUDM/slime support?
The project names the GLM series from GLM-4.5 up to GLM-5.3 as the models it was built behind. It also lists Qwen3.8, Qwen3.6, Qwen3.5, Qwen3Next, Qwen3MoE, Qwen3, Qwen2.5, DeepSeek V3, V3.1, R1, and Llama 3.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/thudm-slime)Star history chart for your README
[](https://hysenlabs.com/projects/thudm-slime)Was this useful?