SuperAPIAI Directory

RL-Factory

github.com · AI developer platforms

Train your Agent model via our easy and efficient framework.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)
PlatformsAndroid

About this tool

RL-Factory is a reinforcement learning (RL) post-training framework for agentic learning, focused on "simplicity" and "efficiency." Its goal is to let users focus on reward logic and tool setup with minimal code, quickly completing agent training, while allowing advanced developers to focus on improving training efficiency and model performance.

Purpose and Positioning RL-Factory decouples the environment from RL post-training. Users only need to provide a tool configuration and a reward function to start training, making it suitable for researchers and developers who want to train their own Agent models (such as a DeepSearch Agent).

Main Capabilities

  • Environment decoupling: Easily define tool-use environments, including tool setup and reward function definitions.
  • Flexible reward functions: Supports computing rewards through rules, model-judge, and tools.
  • Seamless tool setup: Simply provide configuration files for MCP tools and custom tools to integrate them into RL learning.
  • Multi-agent extensibility: Agents can be converted into MCP format to facilitate multi-agent interaction; LLM chat simulation will also be added in the future to improve multi-turn dialogue capabilities.
  • Efficient training: Improves online RL training efficiency through batching and asynchronous parallel tool calls; deploys LRMs (such as QwQ-32B) in a distributed manner for efficient model judging, and uses asynchronous parallelism to accelerate reward computation. The official claim is that compared with Search-R1 based on the original verl, the required training time is reduced by 1.5 to 2 times, and if model judging is involved, the efficiency improvement is even greater.
  • Model support: The current version supports Qwen3 models. The official statement is that Qwen3 is significantly better than Qwen2.5 in tool calling, can accurately call tools even without SFT, and supports the MCP protocol. Currently, only the Qwen series models have been tested.
  • One-click DeepSearch training: The current version natively supports one-click DeepSearch training and provides a reproduction example of Search-R1.

Usage

  • Environment dependencies (key): CUDA >=12.0 (12.4 recommended); Python >=3.10 (3.10 recommended); Qwen3 model support requires vllm >=0.8.3 (0.8.5 recommended).
  • Installation commands: pip3 install accelerate bitsandbytes datasets deepspeed==0.16.4 einops flash-attn==2.7.0.post2 isort jsonlines loralib optimum packaging peft pynvml ray[default]==2.46.0 tensorboard torch==2.6.0 torchmetrics tqdm transformers==4.51.3 transformers_stream_generator wandb wheel pip3 install vllm==0.8.5 pip3 install "qwen-agent[code_interpreter]" pip3 install llama_index bs4 pymilvus infinity_client codetiming tensordict==0.6 omegaconf torchdata==0.10.0 hydra-core easydict dill python-multipart mcp==1.9.3 pip3 install -e . --no-deps pip3 install faiss-gpu-cu12 # Optional, required when using rag_server for end-to-end search model training pip3 install nvidia-cublas-cu12==12.4.5.8 # Optional, required when encountering the ray worker died issue during training
  • Users only need to provide an environment. For a minimal tutorial, see docs/rl_factory/main_tutorial.md.
  • Training command: Before running, modify MODEL_PATH, REWARD_MODEL_PATH, and several actor_rollout_ref.env parameters as needed, then execute bash main_grpo.sh.
  • Evaluation or inference command: Before running, modify MODEL_PATH, REWARD_MODEL_PATH, and several data and trainer parameters as needed, then execute bash main_eval.sh.
  • Official documentation is in docs/rl_factory/main_tutorial.md provides an RLFactory reproduction example of Search-R1, using Qwen3-4B and Qwen3-8B as the base models for RL training.

Applicable scenarios Suitable for research and development scenarios that require training agent models with tool-calling capabilities, such as DeepSearch agent training. The official training results show that: under the same computing resources, software, and verl version, RLFactory's training time is about half that of Search-R1; after training for 100 steps (8*A100 about 5 hours), Qwen3-4B scores 0.458, and Qwen3-8B scores 0.463.

Limitations and plans

  • Currently only the Qwen series models have been tested; support for other models (such as Deepseek, Llama, etc.) is still planned.
  • Planned features include: WebUI (data processing, tool and environment definition, training configuration and project management, under rapid development), support for AsyncLLMEngine to enable more efficient rollout, more model support, process reward, more application examples (such as TravelPlanner), multimodal (image) agent training, Android environment support, tool caching, and the convenient evaluation script main_eval.sh, etc. The framework has also been upgraded to VeRL-0.5 and added MS-SWIFT-3.7 support.

The project expects users and developers to participate and contribute. You can submit issues via GitHub, or contact us via chaijiajun@meituan.com and gjyin@outlook.com, and you can also join the WeChat communication group. The project thanks verl, Search-R1, and Qwen-Agent, and plans to introduce TRL in the future.

The code repository address of this framework is https://github.com/Simple-Efficient/RL-Factory,使用教程、安装说明、框架与模型信息可参见仓库中的 Tutorial, Installation, Framework, Model sections.

Up/Down to navigate · Enter to open · ESC to closeBrowse all tools