Set model alias
set_model_aliasCreate or move a model alias to a specific trained model version so prediction calls stay unchanged while the alias switches versions; request confirmation before schema or target changes.
Instructions
Point a model alias, such as staging or production, at one of the
model's versions: creates the alias, or moves it. Callers that predict with
model_id + alias score with the new version from then on, without
changing their calls. Pointing an alias at the version it already has
changes nothing.
Promote a version only after it passed holdout validation (playbook section
validate) and the user agreed. alias starts with a lowercase letter,
then lowercase letters, digits or -, 32 characters at most; latest
is reserved. The version must belong to model_id and have finished
training (TRAINING_COMPLETED).
Every call first checks the change without writing. When the version was
trained on different columns or a different target than the one the alias
points to now, callers sending the old columns may fail or get a different
kind of answer, so the tool writes nothing and returns
needs_confirmation: true with warnings (TRAINING_COLUMNS_CHANGED
with the added and removed columns, TARGET_FEATURE_CHANGED,
TRAINING_COLUMNS_UNKNOWN), current_model_version_id,
expected_current_model_version_id and next_steps. Show the user
those changes and call again with confirm=true and that
expected_current_model_version_id only if they agree. If the alias moved
in between, nothing is written and needs_confirmation comes back with
the new state. Otherwise the alias is written and the result has
modelVersionId, version, previousModelVersionId, warnings
and ui_url.
Needs a full-scope API key: a predict-only key gets 403 INSUFFICIENT_SCOPE,
and only the user can supply a full-scope key. A 409 means the alias moved
at the same moment and nothing was written; call again without confirm
to see where it points now.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| alias | Yes | ||
| confirm | No | Write the alias even though the check found warnings. Set it only after the user has seen the warnings and agreed. | |
| model_id | Yes | ||
| project_id | Yes | ||
| model_version_id | Yes | ||
| expected_current_model_version_id | No | The current_model_version_id returned by the needs_confirmation result, or the literal 'none' for a new alias. With confirm=true, the alias is written only if it still points there; otherwise the tool returns needs_confirmation again with the new state. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||