ALTER MODEL … ADD VERSION

Adds a new version to an existing model from an internal stage. Versions are the actual model code that contains methods that can be called to perform inference and other functions.

Note

This command exists for use by the Snowpark Model Registry Python API. Use that API to create model versions. You cannot currently create model versions using SQL.

Some version properties can be modified (see ALTER MODEL … MODIFY VERSION), but the code contained in a version is immutable.

See also:

ALTER MODEL … MODIFY VERSION, ALTER MODEL … DROP VERSION

Syntax

ALTER MODEL [ IF EXISTS ] <name> ADD VERSION <version_name> FROM internalStage
Copy

Where:

internalStage ::=
    @[<namespace>.]<int_stage_name>[/<path>]
| @[<namespace>.]%<table_name>[/<path>]
| @~[/<path>]
Copy

For additional internal stage details, see Choosing an internal stage for local files.

Parameters

name

Specifies the identifier of the model. If the identifier contains spaces, special characters, or mixed-case characters, the entire identifier must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. For information on identifier syntax, see Identifier requirements.

version_name

Specifies the identifier of the version, which must be unique within the model. If the identifier contains spaces, special characters, or mixed-case characters, the entire identifier must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. For information on identifier syntax, see Identifier requirements.

internalStage

Specifies the internal stage that contains the version’s files. The required layout of these files is not currently documented.