prime-rl is a framework for large-scale reinforcement learning. It is designed to be easy to use and hackable, yet capable of scaling to 1000+ GPUs. Here is what we think sets it apart:
verifiers environments through the Environments Hub, including built-in support for SWE and agentic environments.GLM-5 FP8 with P/D disaggregation, the llm-d router, and Mooncake KV offload.The trainer works with both Hugging Face and Prime custom ModelForCausalLM out of the box. For selected families (especially large MoE) we also ship highly optimized training code under src/prime_rl/trainer/models/, including expert parallelism (EP) for MoE layers and context parallelism (CP) for long sequences (see the table), and additional kernels like quack-kernels.
With [model] impl = "auto" (the default), the trainer selects that custom stack when the Hugging Face config type is registered.
| Family | Example IDs | MoE | EP | CP |
|---|---|---|---|---|
GLM-5 (glm_moe_dsa) | zai-org/GLM-5, zai-org/GLM-5-FP8 | yes | ✅ | ✅ |
Qwen3 MoE (qwen3_moe) | Qwen/Qwen3-30B-A3B, … | yes | ✅ | ✅ |
Qwen3.5 MoE (qwen3_5_moe) | Qwen/Qwen3.5-35B-A3B, … | yes | ✅ | ✅ |
| Qwen3 / Qwen3.5 VLMs | see advanced.md (qwen3_vl, qwen3_5, qwen3_5_moe) | MoE only on MoE VLMs | MoE only | ❌ |
Poolside Laguna (laguna) | poolside/Laguna-XS.2 | yes | ✅ | ✅ |
MiniMax M2 (minimax_m2) | MiniMax/MiniMax-M2 | yes | ✅ | ✅ |
Nemotron H (nemotron_h) | nvidia/Nemotron-3-Nano-30B-A3B, nvidia/Nemotron-3-Super-120B-A12B, … | yes | ✅ | ✅ |
Trinity (afmoe) | arcee-ai/Trinity-Mini, … | yes | ✅ | ✅ |
GLM-4 · GLM-4.5 MoE · INTELLECT-3 (glm4_moe) | THUDM/GLM-4-9B-0414, zai-org/GLM-4.5-Air, zai-org/GLM-4.5, PrimeIntellect/INTELLECT-3, … | yes | ✅ | ✅ |
| GPT-OSS (HF, MoE) | openai/gpt-oss-20b, openai/gpt-oss-120b | yes | ✅ | ✅ |
| Other HF causal LMs | Qwen3 dense, Mistral, … (impl = "hf") | varies | ❌ | ✅ |
We develop and test on NVIDIA RTX 3090/4090/5090, A100, H100, H200, and B200. If your setup fails, please create an issue.
Currently, you need at least one NVIDIA GPU to use prime-rl. If you don't already have access to one, we recommend our compute platform for everything from renting on-demand single GPUs for developing, debugging and small ablations, to reserving 1000+ GPU clusters for production-scale training.
Set up prime-rl in a single command.
curl -sSL https://raw.githubusercontent.com/PrimeIntellect-ai/prime-rl/main/scripts/install.sh | bash
git clone https://github.com/PrimeIntellect-ai/prime-rl.git
cd prime-rl
git submodule update --init -- deps/verifiers deps/renderers deps/prime-envs deps/pydantic-config
curl -LsSf https://astral.sh/uv/install.sh | sh
source $HOME/.local/bin/env
uv sync --all-extras
NOTE: Environments are opt-in uv workspace members —
uv sync --all-extrasdoes not install them. To train on them, install all withuv sync --all-extras --all-packages, or a subset withuv sync --package prime-rl --package <env>.
3.1. Optional: Install Flash Attention 3 (on Hopper GPUs only, for flash_attention_3 attention backend)
NOTE: This step will take a while, as it builds the Flash Attention 3 extension from source, as it has no wheels prebuilt. NOTE: After this step, you can't run
uv sync --all-extrasoruv runas it will uninstall the package, you can avoid it by runninguv sync --inexactoruv run --no-sync
uv pip install "flash-attn-3 @ git+https://github.com/Dao-AILab/flash-attention.git@main#subdirectory=hopper" --no-build-isolation
uv run python -V
flash-attn is installeduv run python -c "import flash_attn"
uv run sft @ configs/debug/fake/sft.toml
uv run trainer @ configs/debug/fake/rl.toml
uv run inference --vllm.model Qwen/Qwen3-0.6B
uv run rl @ configs/basic/reverse-text/rl.toml
uv run wandb login
# Or set `export WANDB_API_KEY=...`
uv run hf auth login
# Or set `export HF_TOKEN=...`
We provide end-to-end training examples in the examples directory to highlight features of the framework and guide you through the process of training your own models.
Follow this guide to learn the basics of prime-rl. You can train your own models on 1 to 8 GPUs. Ideal for getting started and exploring the capabilities of the framework. These guides cover most use cases -- single-turn, multi-turn, tool calling, etc. -- on toy environments and small models.
Qwen3-0.6B to reverse a small chunk of text. Demonstrates tiny-scale single-turn SFT and RL training. Can be trained on a single consumer GPU in a few minutes, and is ideal for getting started.Qwen3-1.7B to play Wordle. A fun example of multi-turn SFT and RL training. Can be trained on a 2-4 H100 GPUs in a few hours. Ideal for exploring the multi-turn training capabilities of the framework.Qwen3-4B-Instruct-2507 to sort names alphabetically. Demonstrates multi-turn RL training via LoRA without SFT warmup. Can be trained on a single H100 GPU in just over an hour. Ideal for exploring LoRA-based training.Qwen3-4B-Instruct-2507 to answer trivia questions by searching through a Wikipedia. Demonstrates multi-turn with web search tool use.DeepSeek-R1-Distill-Qwen-1.5B using a filtered subset of MATH where the model already partially solves 20-80% of problems. Useful for algorithm ablations.Follow this guide to train large models on hard reasoning and agentic tasks. These guides are designed to be run from a Slurm cluster but can also be adapted to k8s deployments.
Qwen3-30B-A3B on math, SWE, and agentic tool use.GLM-4.5-Air on search, SWE, and terminal tasks.Nemotron-3-Super-120B hybrid-Mamba MoE on SWE at 131k context.MiniMax-M2.5 on agentic SWE tasks.INTELLECT-3.1 training run.GLM-5/GLM-5.2 inference with P/D disaggregation, the llm-d router, and FP8.Check out the docs directory for in-depth guides on how to use prime-rl.
We warmly welcome community contributions! We use issues to track bugs, feature requests, and share our internal roadmap. If you encounter bugs, have pain points during development, or have ideas for new features, please open an issue.
Contributions are welcome via PR. Please follow these guidelines:
Please install the pre-commit hooks to ensure your code is formatted correctly.
uv run pre-commit install
uv run pytest -v # everything
uv run pytest tests/unit -v # unit only
uv run pytest tests/integration -v # integration only
uv run pytest -v -m "not gpu" # CPU-only (inverse of the gpu marker)
This project is licensed under the Apache 2.0 license, as found in the License file.
If you find our work useful, feel free to cite it using
@misc{primeintellect2025prime-rl,
author = {Prime Intellect},
title = {prime-rl},
url = {https://github.com/PrimeIntellect-ai/prime-rl},
year = {2025}
}
(top 30 of 69)
Python
86.2%
JavaScript
7.8%
Shell
2.6%
CSS
1.8%
prime-rl is a framework for large-scale reinforcement learning. It is designed to be easy to use and hackable, yet capable of scaling to 1000+ GPUs. Here is what we think sets it apart:
verifiers environments through the Environments Hub, including built-in support for SWE and agentic environments.GLM-5 FP8 with P/D disaggregation, the llm-d router, and Mooncake KV offload.The trainer works with both Hugging Face and Prime custom ModelForCausalLM out of the box. For selected families (especially large MoE) we also ship highly optimized training code under src/prime_rl/trainer/models/, including expert parallelism (EP) for MoE layers and context parallelism (CP) for long sequences (see the table), and additional kernels like quack-kernels.
With [model] impl = "auto" (the default), the trainer selects that custom stack when the Hugging Face config type is registered.
| Family | Example IDs | MoE | EP | CP |
|---|---|---|---|---|
GLM-5 (glm_moe_dsa) | zai-org/GLM-5, zai-org/GLM-5-FP8 | yes | ✅ | ✅ |
Qwen3 MoE (qwen3_moe) | Qwen/Qwen3-30B-A3B, … | yes | ✅ | ✅ |
Qwen3.5 MoE (qwen3_5_moe) | Qwen/Qwen3.5-35B-A3B, … | yes | ✅ | ✅ |
| Qwen3 / Qwen3.5 VLMs | see advanced.md (qwen3_vl, qwen3_5, qwen3_5_moe) | MoE only on MoE VLMs | MoE only | ❌ |
Poolside Laguna (laguna) | poolside/Laguna-XS.2 | yes | ✅ | ✅ |
MiniMax M2 (minimax_m2) | MiniMax/MiniMax-M2 | yes | ✅ | ✅ |
Nemotron H (nemotron_h) | nvidia/Nemotron-3-Nano-30B-A3B, nvidia/Nemotron-3-Super-120B-A12B, … | yes | ✅ | ✅ |
Trinity (afmoe) | arcee-ai/Trinity-Mini, … | yes | ✅ | ✅ |
GLM-4 · GLM-4.5 MoE · INTELLECT-3 (glm4_moe) | THUDM/GLM-4-9B-0414, zai-org/GLM-4.5-Air, zai-org/GLM-4.5, PrimeIntellect/INTELLECT-3, … | yes | ✅ | ✅ |
| GPT-OSS (HF, MoE) | openai/gpt-oss-20b, openai/gpt-oss-120b | yes | ✅ | ✅ |
| Other HF causal LMs | Qwen3 dense, Mistral, … (impl = "hf") | varies | ❌ | ✅ |
We develop and test on NVIDIA RTX 3090/4090/5090, A100, H100, H200, and B200. If your setup fails, please create an issue.
Currently, you need at least one NVIDIA GPU to use prime-rl. If you don't already have access to one, we recommend our compute platform for everything from renting on-demand single GPUs for developing, debugging and small ablations, to reserving 1000+ GPU clusters for production-scale training.
Set up prime-rl in a single command.
curl -sSL https://raw.githubusercontent.com/PrimeIntellect-ai/prime-rl/main/scripts/install.sh | bash
git clone https://github.com/PrimeIntellect-ai/prime-rl.git
cd prime-rl
git submodule update --init -- deps/verifiers deps/renderers deps/prime-envs deps/pydantic-config
curl -LsSf https://astral.sh/uv/install.sh | sh
source $HOME/.local/bin/env
uv sync --all-extras
NOTE: Environments are opt-in uv workspace members —
uv sync --all-extrasdoes not install them. To train on them, install all withuv sync --all-extras --all-packages, or a subset withuv sync --package prime-rl --package <env>.
3.1. Optional: Install Flash Attention 3 (on Hopper GPUs only, for flash_attention_3 attention backend)
NOTE: This step will take a while, as it builds the Flash Attention 3 extension from source, as it has no wheels prebuilt. NOTE: After this step, you can't run
uv sync --all-extrasoruv runas it will uninstall the package, you can avoid it by runninguv sync --inexactoruv run --no-sync
uv pip install "flash-attn-3 @ git+https://github.com/Dao-AILab/flash-attention.git@main#subdirectory=hopper" --no-build-isolation
uv run python -V
flash-attn is installeduv run python -c "import flash_attn"
uv run sft @ configs/debug/fake/sft.toml
uv run trainer @ configs/debug/fake/rl.toml
uv run inference --vllm.model Qwen/Qwen3-0.6B
uv run rl @ configs/basic/reverse-text/rl.toml
uv run wandb login
# Or set `export WANDB_API_KEY=...`
uv run hf auth login
# Or set `export HF_TOKEN=...`
We provide end-to-end training examples in the examples directory to highlight features of the framework and guide you through the process of training your own models.
Follow this guide to learn the basics of prime-rl. You can train your own models on 1 to 8 GPUs. Ideal for getting started and exploring the capabilities of the framework. These guides cover most use cases -- single-turn, multi-turn, tool calling, etc. -- on toy environments and small models.
Qwen3-0.6B to reverse a small chunk of text. Demonstrates tiny-scale single-turn SFT and RL training. Can be trained on a single consumer GPU in a few minutes, and is ideal for getting started.Qwen3-1.7B to play Wordle. A fun example of multi-turn SFT and RL training. Can be trained on a 2-4 H100 GPUs in a few hours. Ideal for exploring the multi-turn training capabilities of the framework.Qwen3-4B-Instruct-2507 to sort names alphabetically. Demonstrates multi-turn RL training via LoRA without SFT warmup. Can be trained on a single H100 GPU in just over an hour. Ideal for exploring LoRA-based training.Qwen3-4B-Instruct-2507 to answer trivia questions by searching through a Wikipedia. Demonstrates multi-turn with web search tool use.DeepSeek-R1-Distill-Qwen-1.5B using a filtered subset of MATH where the model already partially solves 20-80% of problems. Useful for algorithm ablations.Follow this guide to train large models on hard reasoning and agentic tasks. These guides are designed to be run from a Slurm cluster but can also be adapted to k8s deployments.
Qwen3-30B-A3B on math, SWE, and agentic tool use.GLM-4.5-Air on search, SWE, and terminal tasks.Nemotron-3-Super-120B hybrid-Mamba MoE on SWE at 131k context.MiniMax-M2.5 on agentic SWE tasks.INTELLECT-3.1 training run.GLM-5/GLM-5.2 inference with P/D disaggregation, the llm-d router, and FP8.Check out the docs directory for in-depth guides on how to use prime-rl.
We warmly welcome community contributions! We use issues to track bugs, feature requests, and share our internal roadmap. If you encounter bugs, have pain points during development, or have ideas for new features, please open an issue.
Contributions are welcome via PR. Please follow these guidelines:
Please install the pre-commit hooks to ensure your code is formatted correctly.
uv run pre-commit install
uv run pytest -v # everything
uv run pytest tests/unit -v # unit only
uv run pytest tests/integration -v # integration only
uv run pytest -v -m "not gpu" # CPU-only (inverse of the gpu marker)
This project is licensed under the Apache 2.0 license, as found in the License file.
If you find our work useful, feel free to cite it using
@misc{primeintellect2025prime-rl,
author = {Prime Intellect},
title = {prime-rl},
url = {https://github.com/PrimeIntellect-ai/prime-rl},
year = {2025}
}
(top 30 of 69)
Python
86.2%
JavaScript
7.8%
Shell
2.6%
CSS
1.8%