Practical overview
When it fits
Use Fsrl when you want a PyTorch-based starting point for safe-RL experiments involving constrained policies, supported algorithms, and configurable training workflows.
Who it is for
- Researchers comparing safe reinforcement-learning algorithms.
- Developers prototyping constraint-aware agents for robotics or simulated decision-making tasks.
Documented uses
- Implement and compare constrained reinforcement-learning methods.
- Configure and train a PPO-Lagrangian agent in a documented safety-task example.
- Log experiment results with TensorBoard or Weights & Biases.
Requirements & limits
The repository identifies an MIT license and provides source-checkout and Git-based pip installation instructions.
- The library builds on both PyTorch and Tianshou.
- Its README documents a PPO-Lagrangian example using SafetyCarCircle-v0 and TensorBoard logging.
- The project states that its algorithms support multiple constraints and standard reinforcement-learning tasks.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Install Fsrl from its source repository
Install the library in editable mode from a local source checkout.
Before you start
- Python 3.8 or later
- A shell and pip
Steps
Clone https://github.com/liuzuxin/fsrl.git.
Change into the fsrl directory.
Run pip install -e .
Check the installation by importing fsrl and printing fsrl.__version__.
Expected outcome
Fsrl is installed from the local checkout, and the README provides an import-and-version check.
Guide limitations
- This covers installation and the documented import check, not training an agent.
Set up the documented PPO-Lagrangian training example
Initialize the README’s SafetyCarCircle-v0 task, logger, agent, and training and test environments.
Before you start
- Fsrl and the example's Python dependencies
- The SafetyCarCircle-v0 environment
- Python 3.8 or later
Steps
Import bullet_safety_gym, gymnasium, DummyVectorEnv, PPOLagAgent, and TensorboardLogger as shown in the README.
Set the task to SafetyCarCircle-v0 and initialize a TensorBoard logger.
Create the PPO-Lagrangian agent with gym.make(task).
Create 10 training environments and one test environment using DummyVectorEnv.
Expected outcome
The example’s agent, logger, and vectorized training and test environments are initialized; the README’s next step is to call agent.learn(train_envs, test_envs, epoch=100).
Guide limitations
- This recipe covers setup only; it does not claim that training was run.
- The environment and package dependencies must be available for the example to proceed.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 16 October 2026
- Original website title
- liuzuxin/FSRL · Official homepage title · retained in its source language

