Skip to content

models:switch

Terminal window
rai models:switch [OPTIONS] <NAME>

Switch the current model.

Validates that name is a provisioned model schema, then updates deployment.schema in raiconfig (preserving comments/layout). This is the schema rai models deploy and rai models branch use.

Validation dispatches on the configured oplog backend, so switch is a first-class verb on every backend. It only rewrites raiconfig (recording nothing), so unlike deploy/pull/merge it also works when the oplog is disabled, like teardown:

  • jsonl: the model is provisioned iff its local oplog store has records (a parent carries Deploy/Create entries; a branch a leading BranchEntry). Validated purely from the oplog — no SQL connection.
  • snowflake: keep the is_model_schema gate (the RAI_MODEL object tag set during real provisioning), unchanged.
  • oplog disabled: there is no oplog to consult, and a disabled-mode deploy is a plain schema install that sets no RAI_MODEL tag — so is_model_schema would wrongly reject it. Fall back to schema_exists (existence-only, no tag), the least-surprising gate that still catches a typo’d target.

Options

OptionTypeDescription
--yes, -yBooleanSkip confirmation prompts (e.g. when modifying a raiconfig.yaml outside the current directory). Default: False.

See Also