Lego-RL

Installation

Build the venv and load the agent plugin

Installing Lego-RL needs a Linux host and uv. Nothing on this page needs a GPU, a cluster or a checkpoint.

git clone https://github.com/LegoX/Lego-RL.git
cd Lego-RL

1. Venv

bash scripts/setup_env.sh

Safe to re-run. It builds .venv with uv, clones harbor to <repo>/../harbor and verl to <repo>/../verl-swe_agent_opd_dev, and installs both editably with pinned veomni / vllm / flash_attn / transformers / cupy.

That verl directory name matters: when a run starts, scripts/lib/common_env.sh adds the same path to PYTHONPATH, so it has to be the tree that was installed. Both sides derive it from the repo location, so a checkout anywhere works.

OverrideEffect
VENV_PATHvenv location
HARBOR_DIR / VERL_DIRclone locations
HARBOR_REF / VERL_REFbranches
PYTHON_VERSIONinterpreter, default 3.12.3
SKIP_CLONE / SKIP_FLASH_ATTN / SKIP_CUPY / SKIP_VEOMNIskip that step

The script exits green only if veomni's training-path modules import and verl / harbor resolve to the checkouts it just installed. To confirm by hand:

.venv/bin/python -c "import harbor, verl, verl_patch; print(harbor.__file__)"

veomni is required by the default modeling backend (MODEL_ENGINE=veomni), and its published metadata pins datasets<=2.21.0, contradicting verl/vllm. overrides.txt lifts that bound; the installer applies it through UV_OVERRIDE. Installing by hand without --overrides overrides.txt will fail to resolve.

2. Agent plugin

Skills that know this repository's layout: they check the right files, show the resolved run parameters, and ask for confirmation before anything expensive starts. Both agents read them straight from the repo, so starting the agent in the repository root is the whole installation.

Claude Code

.claude/settings.json registers .claude/plugins/ as a local marketplace:

cd /path/to/Lego-RL
claude

Type / and search for rl; you should see /rl:check, /rl:run, /rl:status and /rl:dashboard. In an already-open session, run /reload-plugins first (Setup FAQ).

Codex

The harbor-rl-config skill lives at .agents/skills/harbor-rl-config/, with its Codex manifest in agents/openai.yaml:

cd /path/to/Lego-RL
codex

Ask for $harbor-rl-config. It writes and refactors train / eval / infer configs out of the template modules, explains the runner contract, and validates what it wrote with the runner's own --dry-run. It will not launch a run unless you ask and confirm.

Claude CodeCodexShell
Write a config$harbor-rl-configcopy _template.env and edit it
Validate/rl:check <config>$harbor-rl-configPREFLIGHT_ONLY=1 bash scripts/train/train.sh <config>
Launch/rl:run <config>bash scripts/train/train.sh <config>
Watch/rl:statustail -F logs/<exp>.log
Serve the dashboard/rl:dashboardbash webui/start_dashboard.sh

The plugin adds the judgement a config-only script cannot make: whether a run is already in flight, whether those GPUs are yours, whether the port is free. See Agent Plugin.

The plugin is an operator interface, not part of the training runtime

Lego-RL runs entirely from shell. The agent plugin adds guided validation, launch and diagnosis on top; nothing in the training path calls it, and no Anthropic account is required to train a model with Lego-RL. Every page here gives the shell equivalent.

Next

Configuration — the values you must supply before a run.

On this page