Lego-RL Config
SkillDev toolsCompose, edit, refactor, and validate Lego-RL train/eval/infer .env configs and reusable scripts/templates modules. Use when Codex is asked to generate an experiment config, migrate legacy wrappers into configs, edit template modules, dry-run a train/eval/infer workload for config validation, or explain the runner/template/site-env contract. For Claude-style operational commands use the one-to-one Codex counterparts $rl-check, $rl-run, $rl-status, $rl-dashboard, and $rl-k8s-sandbox-install.
Available today. Use it from your connected AI after setup.
No other account needed.
Connect ahel once, and every AI you use reads what you have installed.
Then ask your AI: use the Lego-RL Config skill
What this skill tells your AI
The instructions your AI receives, as published by legox/lego-rl in .agents/skills/lego-rl-config/SKILL.md and read by ahel’s review.
Use this skill for Lego-RL configuration work. The current design is a
single runner per workload plus small .env experiment configs composed from
reusable modules under scripts/templates.
This skill follows the Claude /rl:* plugin's layering rule:
Scripts own deterministic behavior. Skills own orchestration, judgement, and the final report.
Related Operational Skills
Use this skill for config and template work. Use the one-to-one Codex counterparts for Claude plugin operations:
$rl-checkfor/rl:check$rl-runfor/rl:run$rl-statusfor/rl:status$rl-dashboardfor/rl:dashboard$rl-k8s-sandbox-installfor/rl:k8s-sandbox-install
Start Here
- Find the repository root: it contains
scripts/train/train.sh,scripts/infer/infer.sh,scripts/eval/eval.sh, andscripts/templates/README.md. - Read
scripts/templates/README.mdfirst. It is the authoritative runner and template contract. - Read
references/config-generation.mdbefore creating or refactoring configs. - Inspect only the files relevant to the requested workload:
scripts/<kind>/<kind>.sh,scripts/<kind>/_template.env,scripts/<kind>/configs/*.env,scripts/<kind>/lib/*.sh, and the selectedscripts/templates/**.envmodules. - Preserve user-owned run configs. Do not rewrite unrelated configs, logs, checkpoints, trial outputs, or cluster state.
Workflow
1. Resolve The Workload
Classify the request as train, infer, or eval.
train: verl policy training, sync/async mode, VeOmni/FSDP engine,TRAIN_FILES,VAL_FILES,NNODES,N_NODES_TRAIN,N_NODES_ROLLOUT.infer: batch trajectory generation throughutils/eval_swerebench_filtered.py,INDEX_FILE, optionalINSTANCES_FILE,RESULTS_DIR,OUTPUT_INDEX, single-node vLLM serving knobs such asGEN_TP,GPUS_PER_NODE, andVLLM_PORT.eval: Harbor-native scoring, exactMODEL_PATH, exactly one ofDATASET_PATHorDATASET_NAME, local plain-vLLM serving, generated HarborJobConfig, andharbor run.
If a config path is provided, infer the kind from scripts/<kind>/.... If only a
bare name is provided, search scripts/{train,infer,eval}/configs/. Ask only
when multiple plausible configs match.
2. Compose Template Modules
Templates live under scripts/templates/**.env, and a config chooses them with
TEMPLATE_MODULES. The config is sourced first, then modules are sourced in
order from scripts/templates. Template defaults should use:
: "${VAR:=default}"
That means explicit config values are authoritative, while modules provide defaults and derived values.
Use the current module ownership model:
runtime/process.env: process-level env, sockets, NCCL/logging defaults, tokenizer/thread knobs, Ray ports, and Ray object store memory.backend/k8s.envandbackend/docker.env: Harbor backend selectors and backend defaults.harbor/common.env: Harbor agent, trial, validation, retry, resource, verifier, and timeout defaults shared across workloads.scaffold/{ohsdk,oh,cc,oc}.env: agent identity and runtime image defaults.verl/common.env: shared train-side verl data/model/actor/rollout/ref/ algorithm/topology/log defaults.verl/{async,sync}.env: train mode entrypoint/config and mode-specific defaults.verl/{veomni,fsdp}.env: train model-engine-specific actor/ref/router-replay overrides.infer/{vllm,common}.env: infer single-node vLLM serving plus infer rollout/data/output/log defaults.eval/{common,vllm}.env: Harbor-native eval job/data/log defaults plus single-node plain-vLLM serving defaults.
Keep TEMPLATE_MODULES at the end of configs so module names and derived
defaults can depend on earlier explicit settings.
3. Generate Or Edit The Config
Write generated configs to exactly one of:
scripts/train/configs/<name>.envscripts/infer/configs/<name>.envscripts/eval/configs/<name>.env
Use the workload skeleton as the starting point:
scripts/train/_template.envscripts/infer/_template.envscripts/eval/_template.env
Keep configs readable as experiment records: template selection first, identity,
runtime, model, data/output, topology or serving, optional overrides, then
TEMPLATE_MODULES. Keep generated configs small; do not copy every template
default into the config.
Important current variable names:
- Use
EXP_NAME, notEXP_TAG. - Train uses
TRAIN_FILESandVAL_FILES. - Infer uses
INDEX_FILEfor the parquet passed to--index. - Eval uses
MODEL_PATHdirectly; oldMODEL_PRESET-based eval templates are not part of the current runner contract. - Eval must set exactly one of
DATASET_PATHorDATASET_NAME.
4. Validate Through The Runner
Do not re-implement runner checks. Use the workload runner's dry-run path:
bash scripts/<kind>/<kind>.sh --dry-run scripts/<kind>/configs/<config>.env
Dry-run sources the config and modules, validates required variables, initializes
local runtime state, prints === Final Environment ===, prints the launch
command block, then exits before Ray startup, vLLM startup, Harbor job writing,
or training/eval/infer execution.
For static syntax checks, use the commands in scripts/templates/README.md, for
example:
bash -n scripts/train/train.sh scripts/train/lib/*.sh
bash -n scripts/infer/infer.sh scripts/infer/lib/*.sh scripts/templates/infer/*.env
bash -n scripts/eval/eval.sh scripts/eval/lib/*.sh scripts/templates/eval/*.env
If validation fails, report the exact fatal/error lines and adjust only the config or template layer that owns the value.
5. Report
Answer in Chinese unless the user asked otherwise. Include:
- config path or template path created/changed
- template modules used or introduced
- key resolved axes: kind, backend, scaffold, model, and topology/serving; for train also mode and engine
- validation commands run and their result
- any manual values still needed, especially data paths, checkpoint/model paths, kubeconfig/backend/site values, registry/image/mount values, and multi-node host/rank values
Refactor Rules
- Keep existing runners as the execution contract:
scripts/train/train.sh,scripts/infer/infer.sh, andscripts/eval/eval.sh. - Move reusable defaults to
scripts/templates, notscripts/lib. - Keep
scripts/libfor executable shell helpers and workload orchestration. - Generated configs belong under the workload's
configs/directory, never underscripts/templates. - Site-specific paths, kubeconfigs, registries, mounts, Docker hosts, and secrets remain in site env, caller env, or explicit run configs when the site requires them. Do not bake them into shared templates.
- Do not delete legacy monolithic scripts unless the user explicitly asks. When
migrating one, preserve behavior with one generated config plus reusable
modules, then validate with
--dry-run. - Prefer the existing module tree over introducing new dimensions. Add a module only when an existing module has the wrong ownership boundary.
Guardrails
- Do not launch training/eval/infer unless the user explicitly asks and confirms.
- Do not kill processes, clear
/dev/shm, runray stop, delete logs, delete checkpoints, or mutate the cluster. - Do not SSH to worker nodes; for multi-node flows, print the commands the user must run on each node.
- Do not claim a config is validated without runner output.
- Do not hardcode secrets such as
WANDB_API_KEY, kubeconfig contents, registry credentials, or personal tokens into templates or generated configs.
Signals
- GitHub stars
- 86
- Forks
- 4
- Last commit
- Sep 2026
Advanced
- Catalog kind
- skill
- Gateway key
lego-rl-config- Source
- github.com/legox/lego-rl