Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

srb model — Manage Model Artifacts

srb model packages checkpoints as SRB artifacts with identity, optional metrics, dataset provenance, and framework restore metadata.

Usage

srb model <action> [options]

Actions

ActionPurpose
create CHECKPOINT --output OUTPackage one checkpoint into a model artifact. Requires --algo; task, embodiment, and action mode can be inferred from --dataset.
from-run RUN --output OUTPackage the latest checkpoint from a completed SRB run. The algorithm can be inferred from metadata.json.
info PATHPrint the model manifest as JSON.
validate PATHValidate the artifact manifest, checkpoint, and bundled config paths. Use --strict to treat warnings as errors.
card PATHWrite a Hugging Face README.md model card.
push PATHUpload or dry-run a Hugging Face model publication.

create and from-run accept repeated --metric key=value and --metadata key=value. Metrics must be finite numbers; metadata values are strings.

Portable Restore

from-run preserves framework restore context. Dreamer and TD-MPC2 can include config.yaml. RSL-RL first uses a run-level config.yaml when present; otherwise RSL-RL and SKRL use the shared fallback order: agent from .hydra/config.yaml, then the run.agent_cfg snapshot in metadata.json. When the metadata.json snapshot is the fallback, packaging fails if it holds redacted or non-finite values. Credential-bearing keys and strings are removed with a warning that names only key paths. Artifact directories can be passed wherever checkpoint paths are accepted by srb agent eval, collect, teleop, and srb real_agent eval or validate.

SB3/SBX artifacts preserve RL-Zoo normalization state. Normalized runs require vecnormalize.pkl; inference restores its frozen statistics without normalizing evaluation rewards. Missing or contradictory context fails closed. Older artifacts without a normalization declaration need repackaging for SB3/SBX inference. Dict observations and recurrent state keep the trained layout.

Publication requires dataset provenance from --dataset, a consumed-demo run, or --dataset-repo-id with optional --dataset-revision.

Preparation and validation stream hashes under per-file and aggregate byte limits. Validation rejects files that grow or change while being read.

Legacy v1/v2 restore verifies hashes while copying files into owned temporary storage and removes partial copies on failure. Large checkpoints can exceed the 256 MiB whole-byte API limit within the streamed file and artifact limits; framework deserialization limits still apply.

Examples

# Package the latest checkpoint from a run and infer identity from the dataset
srb model from-run ${SRB_LOGS_DIR}/excavation/rsl_rl_ppo/<run> \
  --dataset /data/srb_excavation_policy \
  --output /models/srb_excavation_rsl_rl_ppo

# Validate and inspect the artifact
srb model validate /models/srb_excavation_rsl_rl_ppo --strict
srb model info /models/srb_excavation_rsl_rl_ppo

# Dry-run the Hugging Face upload, including the generated README.md
srb model push /models/srb_excavation_rsl_rl_ppo --dry-run

# Reuse the packaged artifact for policy rollout
srb agent collect --env excavation --model /models/srb_excavation_rsl_rl_ppo