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

Use the Snowflake Model Registry Python API to create model versions from scratch. Attempting to create models using SQL alone can be challenging without clear understanding of the serialization schema required for the model.

Some version properties can be modified (see ALTER MODEL … MODIFY VERSION), but the actual model implementation 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.

ADD VERSION 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.

FROM internalStage

Specifies the internal stage that contains the version’s files.