NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI
PyPI
The machine learning client library that is used for interacting with Snowflake to build machine learning solutions.
Latest stable
2.9.0
Last release 12 days ago
09 Nov 2026
Ships on a steady schedule
a new release about every 2 weeks
Nearly every release is documented
notes for 60 of the last 60 stable releases
2 versions withdrawn
withdrawn after publishing
3 years old
105 releases · first in 2023
Drag across the ruler to compare, or tap a release to open it.
Registry: GPU packaging now adds pytorch-gpu when a model has a conda pytorch dependency, so log_model does not require extra GPU conda deps and the i
pytorch-gpu when a model has a conda pytorch dependency, so
log_model does not require extra GPU conda deps and the image build cannot silently install a
CPU PyTorch wheel for a GPU service.read_feature_view(..., store_type=StoreType.OFFLINE)) and online reads from a
hybrid table online store (store_type=StoreType.ONLINE with OnlineStoreType.HYBRID_TABLE) now accept
feature_names that name a case-sensitive column, such as '"f1"', and keys values that contain a backslash.
Both previously produced malformed SQL, so the read failed or filtered on the wrong value. Online reads from a
Postgres online store were not affected.Cortex: Added cortex.evaluate() and cortex.optimize_prompt(), which run AI function evaluation and prompt optimization as Snowflake experiments on a v
Your coding agent can read these notes before it upgrades. Set up the MCP server →
cortex.evaluate() and cortex.optimize_prompt(), which run AI function evaluation and
prompt optimization as Snowflake experiments on a versioned snowflake.ml.Dataset. evaluate() scores an
AI_COMPLETE model and prompt template with one metric and returns an EvaluationJob, whose result() is an
EvaluationResult. optimize_prompt() searches for better prompts and models and returns an
OptimizationJob, whose result() is an OptimizationResult with the cost/quality frontier of Candidates and
selectors such as best_quality(), cheapest(), and best_under_cost(). Prompt placeholders {0}, {1}, ...
must match the inputs columns.predict runs as a scalar function over the named feature columns. An unfitted
estimator is served unbound (in-context-learning): predict is a partitioned table function whose
input carries both the labeled context and the rows to score.cortex.evaluate() now works on AI function experiment executors before V14. It previously
failed with "specification must contain a top-level 'evaluation' or 'optimization' section".copy, re, numpy (as np) and
pandas (as pd), the names StreamConfig already allows a transformation function to use without
importing them. Previously only pd was available, so a function using bare np passed registration
and then failed during backfill.INVALID_ARGUMENT, as HTTP reads do, when a
realtime feature view's UDF fails in its own code (UDF_EXECUTION_FAILED), instead of an internal error.Modeling: Added preprocessing.FrequencyEncoder, which encodes each category by its observed frequency (normalize=True, the default) or raw count (norm
preprocessing.FrequencyEncoder, which encodes each category by its observed frequency
(normalize=True, the default) or raw count (normalize=False) from fit — a compact encoding for
high-cardinality categorical features. Encoding runs entirely in Snowflake for Snowpark DataFrames; local
pandas encoding uses the optional category_encoders package.SNOWFLAKE_ML_ONLINE_WS_ENABLED=true; SNOWFLAKE_ML_ONLINE_WS_POOL_SIZE sets how many connections are held
open, SNOWFLAKE_ML_ONLINE_WS_PIPELINE_DEPTH how many requests may be in flight per connection, and
SNOWFLAKE_ML_ONLINE_WS_MAX_CONN_AGE_SECONDS the longest a connection is held before it is replaced (connections
are otherwise replaced just before the lifetime the service advertises for each). Leaving
the flag unset or unrecognised keeps every read on HTTP, and reads fall back to HTTP automatically whenever
the WebSocket endpoint cannot serve, so behaviour is unchanged unless the flag is set. Requires the
websocket-client package.pause_run moves a running run to PAUSED,
and start_run resumes a paused run back to RUNNING. end_run accepts "CANCELLED" in addition
to "FINISHED" and "FAILED". Metrics, parameters, and artifacts can only be logged while a run is
running."myCol" instead of myCol), so the online columns did not match the
offline table the feature view was built from, and registration reported no error. A case-sensitive
secondary aggregation key is corrected the same way. A tiled feature view aggregating a case-sensitive
source column now resolves its partial columns instead of failing to build, and a case-sensitive feature
column is no longer dropped from an upstream source's column list, nor does a case-sensitive entity
column appear among a realtime feature view's features. Aggregation output
names derived from a case-sensitive source column are well-formed as well; they previously produced an
invalid identifier such as "MYCOL"_SUM_24H. Feature.alias now escapes an interior quote instead of
emitting it verbatim.feeSum2d or fee sum, under its stored name with its values. The pandas result previously filled such a
column with NaN, and the Snowpark result renamed a mixed-case column to upper case (FEESUM2D).plan no longer emits spurious COLUMN_REMOVED warnings for a batch feature view it
already reports as unchanged. The up-to-date check now applies the same refresh_mode normalization as the
planner, and the output-column diff ignores server-derived secondary-key columns. A genuine column removal still
warns.get_feature_view no longer fails with "timestamp_col ... is not found in input dataframe" for tiled
feature views when the session's current database differs from the feature store's, or when the feature store
schema name is case-sensitive.query in FV_SOURCE_REFS, so a
declarative export/init over them builds a valid BatchSource, and a bare
update_feature_view(updated_feature_df=...) evolve re-stamps the new binding.FV_SOURCE_REFS source name is now version-qualified (<FV>_<VERSION>__SOURCE), so two
versions of one batch feature view no longer collapse to one source and replan as RECREATE_SOURCE.snowflake-ml-python just
because its version is missing from the Snowflake Anaconda channel. Such models now install snowflake-ml-python
from PyPI.MLJob.target_instances now reports the instance count the job was submitted with instead of reading
1 when the service's live instance count is not yet available.MLJob.get_logs(limit=n) and MLJob.show_logs(limit=n) now return the most recent n lines when the
logs are read from the event table, as they already do for local container logs, instead of the first n.Feature.alias now keeps the case of a name that is already written with double
quotes, so alias('"myCol"') produces the column myCol rather than MYCOL. It also rejects a
name that cannot form a valid identifier, such as alias("total amount"), instead of emitting a
broken one; pass case_sensitive=True to use such a name verbatim as a quoted column."feeAmount" and "FeeAmount", now raises a ValueError. Both columns map to the same internal tile
column, so their aggregations would otherwise share one column's data.ModelVersion.create_service(block=True) waits for the Snowflake
deploy statement to finish instead of failing locally after 30 minutes per
model-build status poll.ML Jobs: Added register_code_bundle and register_job_from_code_bundle (Public Preview) to create a Snowflake code bundle and run ML Jobs from it. dele
register_code_bundle and register_job_from_code_bundle (Public Preview) to
create a Snowflake code bundle and run ML Jobs from it. delete_code_bundle drops a registered bundle.submit_from_stage accepts stage paths with double-quoted segments, such as a Git repository branch whose
name contains / (@repo/branches/"feature/x"/src). These paths used to fail with "does not exist".MLJob.result() no longer returns another job's result when results are fetched concurrently on one
machine.register_code_bundle and register_job_from_code_bundle (Public Preview) to
create a Snowflake code bundle and run ML Jobs from it. delete_code_bundle drops a registered bundle.huggingface.TransformersPipeline can omit task; when omitted, the task is inferred
automatically from the model's Hugging Face Hub pipeline_tag (requires huggingface_hub).submit_from_stage accepts stage paths with double-quoted segments, such as a Git repository branch whose
name contains / (@repo/branches/"feature/x"/src). These paths used to fail with "does not exist".MLJob.result() no longer returns another job's result when results are fetched concurrently on one
machine.huggingface.TransformersPipeline now takes required model as the first argument;
task is optional and inferred when not provided. Prefer
TransformersPipeline(model="org/model") over passing task explicitly.huggingface_pipeline.HuggingFacePipelineModel and its
log_model_and_create_service API. Use huggingface.TransformersPipeline with
registry.log_model / ModelVersion.create_service instead. A pickle-compat alias remains
for loading models logged with the old class.OnlineConfig.target_lag to
"1 minute" instead of "10 seconds". Setting a Postgres target_lag below 1 minute emits a UserWarning.
Hybrid table online stores are unchanged.Dependencies: Raised the fsspec requirement ceiling from <2026 to <2027 so fsspec 2026.6.0, which fixes CVE-2026-104851, can be installed.
snowflake.ml.modeling estimators and preprocessing transformers are not deprecated.
The DeprecationWarning emitted when importing a snowflake.ml.modeling subpackage, announced in
2.0.0, has been removed.MLJob.get_logs(verbose=False) no longer returns container startup and shutdown logs when other log
lines land between the lines of the job start or end banner.fsspec requirement ceiling from <2026 to <2027 so fsspec
2026.6.0, which fixes CVE-2026-104851, can be installed.Registry: create_service now accepts FeatureGroup objects in feature_sources_per_function
alongside FeatureViews. Snowflake resolves the FeatureGroup's online feature tables at
deploy time, so callers no longer need to enumerate the underlying feature views manually.
Experiment Tracking: Experiment runs now appear as first-class objects in lineage. Calling
model_version.lineage(direction="upstream", domain_filter={"experiment"}) returns Run instances
with database_name, schema_name, experiment_name, and name properties that can be passed straight back
into experiment tracking.
snowflake.ml.modeling estimators and preprocessing transformers are not deprecated.
The DeprecationWarning emitted when importing a snowflake.ml.modeling subpackage, announced in
2.0.0, has been removed.MLJob.get_logs(verbose=False) no longer returns container startup and shutdown logs when other log
lines land between the lines of the job start or end banner.fsspec requirement ceiling from <2026 to <2027 so fsspec
2026.6.0, which fixes CVE-2026-104851, can be installed.Registry: FeatureSpec(dtype=DataType.OBJECT) now accepts schema-free Python dictionaries as a model input or output (SQL OBJECT). Callers can pass a d
Generic: Support Python 3.14.
Registry: FeatureSpec(dtype=DataType.OBJECT) now accepts schema-free Python dictionaries as a
model input or output (SQL OBJECT). Callers can pass a dict to ModelVersion.run, an object
literal in SQL, or a JSON object over REST, without stringifying to JSON. Use shape=(-1,) for
a list of dictionaries (ARRAY(OBJECT)). Closed structs with a fixed field list remain
FeatureGroupSpec.
Experiment Tracking: Added snowflake.ml.experiment.callback.catboost.SnowflakeCatboostCallback, a
CatBoost training callback that logs metrics and, optionally, parameters to a Snowflake experiment.
Pass params=model.get_params() to log parameters. Model logging is handled separately after
training via ExperimentTracking.log_model.
Experiment Tracking: ExperimentTracking accepts an optional warnings_as_errors parameter. When True,
conditions that are normally reported as warnings are raised instead.
Experiment Tracking: Re-constructing the ExperimentTracking singleton now logs an informational
message instead of emitting a UserWarning.
Registry: log_model no longer raises when options={'relax_version': True} is used with pip
requirements or Snowpark Container Services-only targets. The option is ignored, a warning is
emitted, and exact pip version specifications are kept.
Generic: Support Python 3.14.
Registry: FeatureSpec(dtype=DataType.OBJECT) now accepts schema-free Python dictionaries as a
model input or output (SQL OBJECT). Callers can pass a dict to ModelVersion.run, an object
literal in SQL, or a JSON object over REST, without stringifying to JSON. Use shape=(-1,) for
a list of dictionaries (ARRAY(OBJECT)). Closed structs with a fixed field list remain
FeatureGroupSpec.
Experiment Tracking: Added snowflake.ml.experiment.callback.catboost.SnowflakeCatboostCallback, a
CatBoost training callback that logs metrics and, optionally, parameters to a Snowflake experiment.
Pass params=model.get_params() to log parameters. Model logging is handled separately after
training via ExperimentTracking.log_model.
Experiment Tracking: ExperimentTracking accepts an optional warnings_as_errors parameter. When True,
conditions that are normally reported as warnings are raised instead.
Experiment Tracking: Re-constructing the ExperimentTracking singleton now logs an informational
message instead of emitting a UserWarning.
Registry: log_model no longer raises when options={'relax_version': True} is used with pip
requirements or Snowpark Container Services-only targets. The option is ignored, a warning is
emitted, and exact pip version specifications are kept.
Feature Store: update_feature_view() now rejects a target_lag change on a feature view whose online store
is POSTGRES, instead of reporting success for a change that is not applied. Set target_lag when online
storage is first enabled, or delete and re-register the feature view to change it. Enabling or disabling
online storage, and target_lag changes on hybrid-table online stores, are unaffected.
Experiment Tracking: ExperimentTracking accepts an optional model_registry parameter. When provided, log_model stores models in the registry's databas
ExperimentTracking accepts an optional model_registry parameter. When provided,
log_model stores models in the registry's database and schema instead of the experiment's, so experiments
and models can live in separate schemas.Dependencies: Support scikit-learn < 2, including 1.9.
Dependencies: Support scikit-learn < 2, including 1.9.
Feature Store: The Postgres-backed Online Feature Store (Public Preview) now supports feature views with
Iceberg-backed offline storage (StorageConfig(format=StorageFormat.ICEBERG)).
ML Jobs: runtime_environment version pins without a Python suffix now select an image matching the submitting
client's Python version. Pins with an explicit suffix, such as -py311, continue to select that Python version.
Dependencies: Support scikit-learn < 2, including 1.9.
Feature Store: The Postgres-backed Online Feature Store (Public Preview) now supports feature views with
Iceberg-backed offline storage (StorageConfig(format=StorageFormat.ICEBERG)).
ML Jobs: runtime_environment version pins without a Python suffix now select an image matching the submitting
client's Python version. Pins with an explicit suffix, such as -py311, continue to select that Python version.
ModelVersion.load() now compares the model owner to CURRENT_ROLE() (the role that
executes SQL) instead of Session.get_current_role(). Owner's-rights Streamlit apps and
EXECUTE AS OWNER procedures can load when statements run as the owner even if the caller's
primary role is not the owner.scipy is no longer a required dependency of snowflake-ml-python. It is still
installed transitively with pip install snowflake-ml-python[scikit-learn]. Direct scipy usage
in snowflake.ml.modeling.preprocessing already requires that extra.Experiment Tracking: Added ExperimentTracking.get_metric_history, which returns every logged step of a metric instead of only the value at the highest
Experiment Tracking: Added ExperimentTracking.get_metric_history, which returns every logged step of a
metric instead of only the value at the highest step reported by list_metrics. Pass a metric name to scope
the result to one metric, or omit it to get every metric of the run. The result is a lazy Snowpark DataFrame
with name, step, value, and timestamp columns, so filtering and aggregation run in Snowflake.
Feature Store: list_feature_views() now surfaces the online feature table's setup readiness in the
online_config JSON as setup_status, setup_error_msg and setup_time, for both batch/streaming
and realtime feature views. The keys are present only when setup-readiness information is available
for the table, so test for key presence. SETUP_NOTREADY means setup has not concluded yet, not
that setup failed; SETUP_FAILED is the failure signal. Note that SETUP_READY is also reported
when nothing has ever been reported for the table, and in that case setup_status may later change
to SETUP_FAILED.
mlflow.sklearn.save_model(). The model is
now re-logged from the scikit-learn estimator using the serialization format it was saved with,
instead of from MLflow's PyFunc wrapper with the version-dependent default format.Release candidate for the snowflake-ml-python 2.0 major release. This is a breaking release that removes deprecated APIs and slims down the default in…
Release candidate for the snowflake-ml-python 2.0 major release. This is a breaking
release that removes deprecated APIs and slims down the default install footprint.
alter_online_service(size=...), which changes the size of an existing Online Service. The
call returns as soon as the request is recorded; the change runs in the background and can take hours on a large
Online Service, which keeps serving online reads and stream ingestion throughout. Poll
get_online_service_status() until status is RUNNING at the requested size.delete_feature_view now drops the online feature table before the
offline dynamic table or view, so a dependent FeatureGroup (error 099940) does not
leave an orphaned offline object.target_platforms now default to both Warehouse and Snowpark Container Services instead of
Snowpark Container Services only. Warehouse is no longer dropped from the default target
platforms.scikit-learn, xgboost, and shap are no longer required dependencies of
snowflake-ml-python. They are now optional extras. Install them with
pip install snowflake-ml-python[scikit-learn], [xgboost], [shap], or [all] when using
the corresponding functionality. Extras are independent: [xgboost] and [lightgbm] install
only those libraries, not scikit-learn. Native XGBoost or LightGBM models (for example
logging to the Model Registry) only need [xgboost] or [lightgbm].
snowflake.ml.modeling estimators always require scikit-learn, so the XGBoost and LightGBM
wrappers need pip install "snowflake-ml-python[xgboost,scikit-learn]" or
"snowflake-ml-python[lightgbm,scikit-learn]".feature_store extra. Install snowflake-ml-python[feature_store]
to pull in httpx, which is required for online feature serving reads. httpx is not installed by
the default snowflake-ml-python install. Conda users still need to install httpx separately
(for example conda install httpx) to use the online Feature Store.snowflake.ml.modeling subpackage (for example
snowflake.ml.modeling.linear_model, snowflake.ml.modeling.xgboost,
snowflake.ml.modeling.lightgbm, or snowflake.ml.modeling.preprocessing) without the optional
dependencies it needs now raises an actionable ImportError that names only the missing
package(s), instead of a confusing missing-attribute error.
scikit-learn and xgboost are attributed to the 2.0 dependency change; lightgbm was
already an optional extra before 2.0.snowflake.ml.modeling estimators and preprocessing transformers are deprecated and
will be removed in a future release. Importing a snowflake.ml.modeling subpackage now emits a
DeprecationWarning. Train models with the native scikit-learn, XGBoost, or LightGBM estimators
and log them to the Snowflake Model Registry (snowflake.ml.registry) instead.snowflake.ml.utils.connection_params.SnowflakeLoginOptions public API
(deprecated since 1.8.5).ModelVersion.run_batch now runs on EXECUTE INFERENCE JOB SERVICE. The single
job_spec argument is replaced by the resources_spec, inference_spec, and image_build_spec
blocks, and input may be supplied as either a DataFrame (X) or an existing stage path
(input_stage_location). output_spec.stage_location is treated as a base: results are written
under a per-job subdirectory, <stage_location>/<job_name>/. output_spec.base_stage_location,
job_spec.job_name_prefix, and job_spec.block no longer exist.snowflake.ml.model.batch module. Use snowflake.ml.model.batch_inference,
which exports BatchInferenceTask alongside the input, output, resources, inference, and image
build spec classes.last_distinct_n or
first_distinct_n aggregation function can no longer be read offline. generate_dataset,
generate_training_set, retrieve_feature_values, and read_feature_view now raise a
ValueError for such feature views. Re-create the feature view to restore offline reads.snowflake-snowpark-python must now be >=1.37.0. Earlier releases import
pkg_resources, which setuptools removed in 82.0.0, so they fail to import in environments
with a current setuptools.Registry: log_model(..., options={"case_sensitive": True}) and options={"max_batch_size": N} apply those settings to all methods. Per-method method_op
Registry: log_model(..., options={"case_sensitive": True}) and
options={"max_batch_size": N} apply those settings to all methods. Per-method
method_options still override the global values.
Feature Store: create_online_service accepts a size kwarg naming the size to provision the Online
Service at, one of "XS", "S", "M", "L", "XL", "2XL", "3XL" (case-insensitive). When
omitted, the server-side default applies; accounts that cap the available size provision at their
cap. get_online_service_status() now reports the provisioned size, which is None for services
created before sizes were recorded.
Experiment Tracking: Source provenance now also records the id of the enclosing ML job when a run is created from inside one.
refresh_mode)
no longer fail to deserialize; unknown keys are ignored on read and the tag still does not persist
refresh_mode.ModelVersion.load() failing with ValueError: ... is not a valid SQL identifier
when the model's owner role is a quoted identifier.SQL compilation error: invalid value 'ADAPTIVE' for property 'REFRESH_MODE' when enabling online storage for an existing
feature view.Registry: log_model(..., options={"case_sensitive": True}) and
options={"max_batch_size": N} apply those settings to all methods. Per-method
method_options still override the global values.
Feature Store: create_online_service accepts a size kwarg naming the size to provision the Online
Service at, one of "XS", "S", "M", "L", "XL", "2XL", "3XL" (case-insensitive). When
omitted, the server-side default applies; accounts that cap the available size provision at their
cap. get_online_service_status() now reports the provisioned size, which is None for services
created before sizes were recorded.
Experiment Tracking: Source provenance now also records the id of the enclosing ML job when a run is created from inside one.
refresh_mode)
no longer fail to deserialize; unknown keys are ignored on read and the tag still does not persist
refresh_mode.ModelVersion.load() failing with ValueError: ... is not a valid SQL identifier
when the model's owner role is a quoted identifier.SQL compilation error: invalid value 'ADAPTIVE' for property 'REFRESH_MODE' when enabling online storage for an existing
feature view.UPDATING_SIZE). The service serves reads and writes throughout a size
change, which can take hours, so it is now treated as serviceable like UPDATING already was.ML Jobs: submit_file, submit_directory, and submit_from_stage accept a parallel kwarg (default False). With parallel=True, the entrypoint is executed
ML Jobs: submit_file, submit_directory, and submit_from_stage accept a parallel kwarg (default False).
With parallel=True, the entrypoint is executed directly on every instance with the job topology injected into the
environment (SNOWFLAKE_JOB_INDEX, SNOWFLAKE_JOBS_COUNT, MLRS_HEAD_IP, MLRS_RDZV_PORT, MLRS_NODE_IPS).
Not supported for callable (@remote) payloads.
ML Jobs: added MLJob.distributed_result(), the result API for distributed (e.g. parallel=True) jobs, which
have no single head result. On full success it returns a DistributedResult (success, per-instance exit_codes,
failed_instance, and instance 0's return_value); if any instance failed it raises DistributedJobError, which
carries that DistributedResult as .result and the earliest-failing instance's reconstructed exception as its
cause. DistributedResult and DistributedJobError are exported from snowflake.ml.jobs.
ML Jobs: submit_file, submit_directory, and submit_from_stage accept a preflight kwarg, supported only
together with parallel=True. It takes the name of a check level, run on every instance before the entrypoint:
"wiring" checks the rendezvous plus a small collective, and "reference" additionally times a short synthetic
DDP step and reports its step times from instance 0. If a requested check fails, the job aborts without running
the entrypoint and the failure surfaces through distributed_result(). A check that does not apply to the job
("reference" on a CPU pool or a single instance) is reported as skipped and the job continues. Covers only the
PyTorch c10d rendezvous backend.
Feature Store: Iceberg-backed feature views can enable online storage when using the Postgres online store
(OnlineConfig(store_type=OnlineStoreType.POSTGRES)). Online storage with Iceberg remains unsupported for
other store types.
register_feature_view now records FV_SOURCE_REFS metadata for managed batch
feature views (derived from the feature_df schema) when the caller does not supply
source_refs. Streaming and realtime feature views are unaffected.## 1.52.0 ### New Features ### Bug Fixes ### Behavior Changes ### Deprecations
stream_ingest now reuses the Online Service ingest endpoint cached on the
StreamSource by get_stream_source, avoiding a per-call server status round-trip.ML Jobs: artifact_repositories now accepts a list of repositories, allowing multiple artifact repositories to be specified for a job.
artifact_repositories now accepts a list of repositories, allowing multiple artifact
repositories to be specified for a job.target_platforms=["SNOWPARK_CONTAINER_SERVICES"] could drop its pip dependencies, leaving the
deployed model missing required packages.## 1.50.0 ### New Features ### Bug Fixes ### Behavior Changes ### Deprecations
Registry: Fixed a bug where logging a model with explainability enabled could fail with a data validation error ("There is no non-null data in column
Registry: Fixed a bug where logging a model with explainability enabled could fail with a data validation error
("There is no non-null data in column ...") when a numeric input column was entirely null within the background
sample. The explain method now reuses the model's existing input signature instead of re-inferring it from the
sample.
Feature Store: Fixed a bug where get_feature_view() could return stale metadata after re-registering a feature
view with overwrite=True. Metadata reads now select the most recently written row.
ExperimentTracking now captures best-effort source provenance (entry-point filename and any
surrounding git commit, branch, and remote URL) for each new run by default. Pass capture_source_info=False to
disable it. Collection is always non-fatal and never blocks run creation.ModelVersion.load() failing with Result for query <id> has expired inside Snowflake Container
Runtime notebooks. Model file downloads now use the session.file.get FileOperation API (the same mechanism used
when logging a model) instead of a raw GET query, avoiding a dependency on collect() result sets.Experiment Tracking: ExperimentTracking now captures best-effort source provenance (entry-point filename and any surrounding git commit, branch, and r
ExperimentTracking now captures best-effort source provenance (entry-point filename and any
surrounding git commit, branch, and remote URL) for each new run by default. Pass capture_source_info=False to
disable it. Collection is always non-fatal and never blocks run creation.ExperimentTracking now captures best-effort source provenance (entry-point filename and any
surrounding git commit, branch, and remote URL) for each new run by default. Pass capture_source_info=False to
disable it. Collection is always non-fatal and never blocks run creation.explain method now reuses the model's existing input signature instead of re-inferring it from the
sample.Experiment Tracking: Added ExperimentTracking.list_model_versions to retrieve the model versions that were logged under a run. Models logged via log_m
ExperimentTracking.list_model_versions to retrieve the model versions that were
logged under a run. Models logged via log_model inside a run are linked to that run through Snowflake lineage,
and this method traverses that lineage to return the corresponding ModelVersion objects.from snowflake.ml.experiment import ExperimentTracking
exp = ExperimentTracking(session)
exp.set_experiment("MY_EXPERIMENT")
with exp.start_run(run_name="MY_RUN"):
exp.log_model(model, model_name="MY_MODEL", sample_input_data=X)
model_versions = exp.list_model_versions(run_name="MY_RUN")
.set_experiment does not recreate an experiment deleted in Snowsightenable_explainability now defaults to False for all model types when logging a model. Previously it
defaulted to True for XGBoost, LightGBM, and CatBoost models and was auto-enabled for supported scikit-learn and
Snowpark ML modeling models when running in the Warehouse. To generate an explain method, explicitly pass
options={"enable_explainability": True} to log_model (this requires sample_input_data for supported model
types).Registry: For Snowpark ML Pipeline models with explainability enabled, explanations now cover only the columns the final estimator was actually traine
input_cols). Untransformed passthrough columns (e.g. raw string
columns left in place by an encoder using new output_cols, or the label column) are no longer included in the
explain output. This also fixes a failure where such passthrough columns could reach the SHAP explainer and raise an
error during log_model(..., enable_explainability=True).Feature Store: FeatureView now supports an initialization_warehouse that is used for the initial build and any subsequent reinitializations of the bac
FeatureView now supports an initialization_warehouse that is used for the initial build and any
subsequent reinitializations of the backing dynamic table (a full scan of the source data), while warehouse
continues to drive the lighter incremental refreshes. This mirrors the dynamic table INITIALIZATION_WAREHOUSE
knob, lets you pair a larger warehouse for initialization with a smaller one for steady-state refresh, and is also
used for the one-time backfill of streaming feature views. It can be set at registration, changed via
update_feature_view(initialization_warehouse=...), and is surfaced by list_feature_views(verbose=True).draft_fv = FeatureView(
name="F_TRIP",
entities=[entity],
feature_df=feature_df,
refresh_freq="1d",
warehouse="SMALL_WH", # incremental refreshes
initialization_warehouse="LARGE_WH", # initial build / reinitialization
)
fv = fs.register_feature_view(draft_fv, version="1.0")
response_format param matching the OpenAI Chat Completions API
({"type": "json_schema", "json_schema": {"name": "...", "schema": {...}}}), letting callers
constrain model output to a JSON Schema.from pydantic import BaseModel
import pandas as pd
class CityCountry(BaseModel):
city: str
country: str
response_format = {
"type": "json_schema",
"json_schema": {
"name": "city_country",
"schema": CityCountry.model_json_schema(),
},
}
x_df = pd.DataFrame.from_records(
[
{
"messages": [
{
"role": "user",
"content": [
{"type": "text", "text": "What is the capital of France?"},
],
},
],
}
]
)
mv.run(
X=x_df,
params={"response_format": response_format},
service_name=...,
)
## 1.44.0 ### New Features ### Bug Fixes ### Behavior Changes ### Deprecations
Registry: inference_engine_options["engine"] now accepts case-insensitive strings in addition to InferenceEngine enum members. Supported values are "v
inference_engine_options["engine"] now accepts case-insensitive strings in addition to
InferenceEngine enum members. Supported values are "vllm" and "python_generic" (for example,
"vLLM", "VLLM", and "PYTHON_GENERIC" are all accepted). This applies to ModelVersion.create_service()
and ModelVersion.run_batch().from snowflake.ml.registry import Registry
registry = Registry(session)
mv = registry.get_model("my_model").version("v1")
mv.create_service(
service_name="my_vllm_service",
service_compute_pool="GPU_COMPUTE_POOL",
gpu_requests="1",
inference_engine_options={
"engine": "vLLM",
"engine_args_override": ["--max-model-len=4096"],
},
)
job = mv.run_batch(
compute_pool="GPU_COMPUTE_POOL",
X=input_df,
output_spec=output_spec,
inference_engine_options={
"engine": "python_generic",
},
)
explain() failing with type mismatch errors when passing a Snowpark DataFrame.
Snowpark DataFrame columns are now explicitly cast to match model signature types before SQL
generation. Table functions (used by explain) enforce stricter type coercion than scalar functions
(used by predict), so columns that were implicitly coerced for predict would be rejected by
explain.SentenceTransformers models no longer hard-code a default inference batch size of 32.
When batch_size is not specified at log_model time and is not overridden at inference, the
sentence-transformers library default is used. To pin a specific size, pass batch_size via
log_model(..., options={"batch_size": N}) or as an inference-time parameter. All
SentenceTransformers models logged with this release require a client/serving runtime on version
1.43.0 or later (regardless of whether batch_size was specified).Registry: Support truncate_dim for SentenceTransformers models. Truncation set at construction (SentenceTransformer(..., truncate_dim=N)) is captured
Registry: Support truncate_dim for SentenceTransformers models. Truncation set at
construction (SentenceTransformer(..., truncate_dim=N)) is captured when the model is logged
and restored on reload. On clients with sentence-transformers 5.0.0 or later, truncate_dim
is also exposed as a runtime parameter in the model signature.
Registry: log_model() now captures a representative row from sample_input_data and stores it alongside the model
so inference code snippets shown in the model registry UI can be pre-filled with realistic values. Pass
options={"capture_sample_input_data": False} to opt out (e.g., for sensitive data); generic placeholder values
will be used in the snippets instead.
transformers<5 for additional HuggingFace pipeline tasks removed in
transformers 5.x (summarization, text2text-generation, question-answering, and
translation_*), preventing deployment failures from missing pipeline classes.Registry: Extended ParamSpec support to MLflow PyFunc, LightGBM, XGBoost, and CatBoost models. Parameters declared in the model signature can now be p
ParamSpec support to MLflow PyFunc, LightGBM, XGBoost, and CatBoost models.
Parameters declared in the model signature can now be passed at inference time.Feature Store: get_feature_view() now correctly preserves online_config for feature views whose names require SQL quoting (mixed case or special chara
get_feature_view() now correctly preserves online_config for feature views whose
names require SQL quoting (mixed case or special characters such as a space). Previously the returned
FeatureView reported online=False even when online was enabled at registration, causing
read_feature_view(store_type=ONLINE) to fail with "Online store is not enabled".get_feature_view() now correctly preserves online_config for feature views whose
names require SQL quoting (mixed case or special characters such as a space). Previously the returned
FeatureView reported online=False even when online was enabled at registration, causing
read_feature_view(store_type=ONLINE) to fail with "Online store is not enabled".Registry: log_model(..., options=...) now rejects unknown top-level keys and unknown keys inside each
method_options entry (for example misspellings or options that belong to a different model framework).
Previously those keys were ignored. Validation is based on the public save-option TypedDicts and runs
before dependency reconciliation.
Registry: use_gpu is declared on the CatBoost, XGBoost, PyTorch, and TorchScript save-option
TypedDicts to match the save paths that already read this flag.
Feature Store: update_feature_view now correctly handles every transition between duration-based and CRON-based refresh_freq. Previously a CRON expres
update_feature_view now correctly handles every transition between duration-based
and CRON-based refresh_freq. Previously a CRON expression was forwarded to the Dynamic Table's
TARGET_LAG (which Snowflake rejects), duration → cron failed because the companion Task did not
yet exist, and cron → duration left the Task orphaned and continuing to fire on its old schedule.
All four (old, new) transitions now correctly create, alter, or drop the Task as needed, with
symmetric rollback on failure.Feature Store: For CRON-based feature views, get_feature_view(), list_feature_views(), and
register_feature_view() now return the original cron expression as refresh_freq instead of
"DOWNSTREAM". The underlying Dynamic Table still uses TARGET_LAG = 'DOWNSTREAM' with a companion
Task — this is purely a display change so the round-trip preserves what the user passed in.
Registry: When target_platforms includes WAREHOUSE and pip installs are needed without a user-supplied
pip artifact repository, log_model injects snowflake.snowpark.pypi_shared_repository after
verifying access. This applies to explicit pip_requirements and to pip-only packaging when there are
no user conda dependencies. If pypi_shared_repository is inaccessible in the pip-only case, automatic packaging
dependencies fall back to conda instead of forcing pip-only without an index.
Registry: For HuggingFace text-generation pipelines whose tokenizer defines a chat template, the auto-inferred signature now matches the OpenAI Chat C
Registry: For HuggingFace text-generation pipelines whose tokenizer defines a chat template, the
auto-inferred signature now matches the OpenAI Chat Completions API
(_OPENAI_CHAT_SIGNATURE_WITH_PARAMS_SPEC). Inputs are a single messages column and inference
controls (temperature, max_completion_tokens, stop, n, stream, top_p, frequency_penalty,
presence_penalty) move from inputs to params with default values. Predictions return the OpenAI
response shape (id, object, created, model, choices, usage); the generated text is at
choices[0].message.content instead of outputs[0].generated_text.
Registry: For HuggingFace image-text-to-text, video-text-to-text, and audio-text-to-text
pipelines, the auto-inferred signature now uses _OPENAI_CHAT_SIGNATURE_WITH_PARAMS_SPEC instead of
_OPENAI_CHAT_SIGNATURE_SPEC. The input column set narrows to just messages, and the inference
controls move to params with default values; the output schema is unchanged.
ParamSpecs,
allowing users to control inference behavior at prediction time via params. Generative tasks expose
GenerationConfig parameters (e.g. temperature, max_new_tokens, top_p); non-generative tasks expose
their own task-specific parameters (e.g. top_k for fill-mask, aggregation_strategy for
zero-shot-classification).Registry: For HuggingFace text-generation pipelines whose tokenizer defines a chat template, the
auto-inferred signature now matches the OpenAI Chat Completions API
(_OPENAI_CHAT_SIGNATURE_WITH_PARAMS_SPEC). Inputs are a single messages column and inference
controls (temperature, max_completion_tokens, stop, n, stream, top_p, frequency_penalty,
presence_penalty) move from inputs to params with default values. Predictions return the OpenAI
response shape (id, object, created, model, choices, usage); the generated text is at
choices[0].message.content instead of outputs[0].generated_text.
Registry: For HuggingFace image-text-to-text, video-text-to-text, and audio-text-to-text
pipelines, the auto-inferred signature now uses _OPENAI_CHAT_SIGNATURE_WITH_PARAMS_SPEC instead of
_OPENAI_CHAT_SIGNATURE_SPEC. The input column set narrows to just messages, and the inference
controls move to params with default values; the output schema is unchanged.
Experiment Tracking: end_run now accepts an optional status argument ("FINISHED" or "FAILED") to explicitly set the final run status. When a run's con
end_run now accepts an optional status argument ("FINISHED" or "FAILED") to explicitly
set the final run status. When a run's context manager exits with an exception, the status is automatically set to
"FAILED".Registry: Fixed log_model() failing for some Snowpark ML Pipeline models with explainability when the
full pipeline could not be converted to a native object; task inference now uses the final estimator instead.
Registry: run_batch() now raises a clear ValueError when a partitioned model's output signature
includes the partition column. Previously this produced duplicate columns in the output, causing
cryptic Ray/Arrow errors (AttributeError or KeyError) deep in the batch inference pipeline.
Registry (PrPr): The model_init_once save option now applies to TABLE_FUNCTION model methods (including
partitioned table functions) for warehouse deployments, in addition to scalar FUNCTION methods. The generated
handler uses the same eager @udf_init_once model load path as UDFs.
Experiment Tracking: end_run now accepts an optional status argument ("FINISHED" or "FAILED") to explicitly
set the final run status. When a run's context manager exits with an exception, the status is automatically set to
"FAILED".
Registry: Fixed log_model() failing for some Snowpark ML Pipeline models with explainability when the
full pipeline could not be converted to a native object; task inference now uses the final estimator instead.
Registry: run_batch() now raises a clear ValueError when a partitioned model's output signature
includes the partition column. Previously this produced duplicate columns in the output, causing
cryptic Ray/Arrow errors (AttributeError or KeyError) deep in the batch inference pipeline.
Feature Store: for latency-sensitive online feature view reads, set use_session_warehouse=True to re-use the warehouse from the current session and ac
transformers<5 when saving HuggingFace pipeline models that use tasks removed in
transformers 5.x (image-to-text, visual-question-answering, conversational), preventing
deployment failures from missing pipeline classes.pip_requirements and no artifact_repository_map now raises a ValueError
when target_platforms explicitly includes "WAREHOUSE". Previously this combination would silently proceed,
resulting in the warehouse deployment being silently dropped.Registry: Fixed ParamSpec.from_mlflow_spec dropping shape, which caused shaped scalar params (e.g., array of ints) from MLflow to fail validation duri
ParamSpec.from_mlflow_spec dropping shape, which caused shaped scalar params
(e.g., array of ints) from MLflow to fail validation during model import.spec_overrides now validates container keys and warns when keys other than name and secrets
are provided. Additional keys are not officially supported and may not behave as expected.Experiment Tracking: Added list_params and list_metrics methods to retrieve parameters and metrics for runs within an experiment. Both methods return
list_params and list_metrics methods to retrieve parameters and metrics
for runs within an experiment. Both methods return a Dataframe and accept an optional run_name argument
to filter to a specific run.generate_dataset()/generate_training_set() SQL generation for Unicode and case-sensitive
identifiers (for example Japanese column names), ensuring columns are quoted exactly once and preventing SQL
compilation errors such as unexpected '<column_name>'.enable_explainability=True is now allowed for SPCS-only and non-warehouse-runnable models. Previously
this raised a ValueError.Registry: Extended ParamSpec support to PyTorch models. Parameters declared in the model signature can now be passed at inference time, matching the e
ParamSpec support to PyTorch models. Parameters declared in the model signature
can now be passed at inference time, matching the existing support for custom models.model_init_once model save option to log_model. When set to True, the
model is loaded once per worker process at startup, eliminating model-loading overhead. Defaults to False.transformers upper bound to <6, adding compatibility with Hugging Face Transformers v5.with exp.start_run() block.create_service(block=True) where the log-streaming thread could outlive the
error handler when service deployment fails.This creates safetensors files instead of PyTorch binaries or pt files, addressing security vulnerability CVE-2025-32434.
ParamSpec support to scikit-learn models. Parameters declared in the model signature
can now be passed at inference time, matching the existing support for custom models.infer_signature() now accepts a dict for the params argument (e.g.,
params={"temperature": 0.7, "max_tokens": 100}), automatically inferring ParamSpec objects
from the Python value types. The existing Sequence[BaseParamSpec] form is still supported.huggingface.TransformersPipeline and transformers.Pipeline will default to safetensors
file format by default by using safe_serialization=True parameter to the save_pretrained call. This creates
safetensors files instead of PyTorch binaries or pt files, addressing security vulnerability CVE-2025-32434.Registry: Fixed custom model handler to explicitly persist PARTITIONED=False in model metadata for @inference_api methods. Previously, custom models u
PARTITIONED=False in model metadata for
@inference_api methods. Previously, custom models using @inference_api with TABLE_FUNCTION type
were incorrectly reported as partitioned.PARTITIONED=False metadata for
the explain method, preventing it from being incorrectly reported as partitioned at read time.infer_signature for columns containing NaN values. Previously,
the inferred dtype (DOUBLE vs INT64) depended on whether NaN rows survived truncation, causing
downstream validation failures. Now, the original pandas column dtype is respected during infer_signature,
so columns with mix of integer and np.nan or None are consistently inferred as DOUBLE regardless of NaN position.model.run(max_tokens="100") or model.run(some_int_param=True)).MLJobDefinition objects so they can be overwritten in place and invoked
repeatedly without job name collisions; the generate_suffix argument has been removed.Experiment Tracking live logging (PrPr): In SPCS, call set_live_logging_status(True) to automatically capture and persist outputs to stdout and stderr
set_live_logging_status(True) to automatically capture and
persist outputs to stdout and stderr while a run is active. The captured logs can be viewed from the Experiments UI.mlflow.*.save_model() to the Snowflake Model
Registry. Previously, only models logged through mlflow.*.log_model() were supported. This also
enables logging custom mlflow.pyfunc.PythonModel subclasses saved locally.predict method as partitioned, ensuring it
uses a partitioned TABLE_FUNCTION when deployed to Snowflake.text-generation models without chat template. The model will have signatures to automatically take
plain strings as input without needing to specify the signatures in log_model.
The signature can be overridden if the user chooses to.text-generation that do not have chat templates will be logged with signature
that supports plain text (string) as input.Model serving: Introducing InferenceEngine.PYTHON_GENERIC enum value. Users can pass InferenceEngine.PYTHON_GENERIC to use a Python-based inference se
InferenceEngine.PYTHON_GENERIC enum value.
Users can pass InferenceEngine.PYTHON_GENERIC to use a Python-based inference server for model serving.NameError.pd.StringDtype correctly.InferenceEngine.PYTHON_GENERIC enum value.
Users can pass InferenceEngine.PYTHON_GENERIC to use a Python-based inference server for model serving.NameError.pd.StringDtype correctly.snowflake.core as a runtime dependency. If you use snowflake.core (e.g.,
TaskDag, Root, Task), add snowflake.core explicitly to your dependencies.## 1.28.0 ### New Features ### Bug Fixes ### Behavior Changes ### Deprecations
Registry: Fixed a bug where model_version.run() required READ privilege on the model instead of USAGE, causing inference to fail for users with only U
Registry: Fixed a bug where model_version.run() required READ privilege on the model instead of
USAGE, causing inference to fail for users with only USAGE privilege granted (introduced in 1.21.0).
Feature Store: Fixed register_feature_view() with overwrite=True failing when changing between
external and managed feature views.
ML Job: Added support for creating MLJobDefinition (PrPr) and launching jobs with different arguments without re-uploading payloads.
MLJobDefinition (PrPr) and launching jobs with different
arguments without re-uploading payloads.# /path/to/repo/my_script.py
def main(*args):
print("Hello world", *args)
if __name__ == '__main__':
import sys
main(*sys.argv[1:])
from snowflake.ml.jobs.job_definition import MLJobDefinition
job_def = MLJobDefinition.register(
"/path/to/repo/my_script.py",
# If you register a source directory, provide the entrypoint file:
# entrypoint="/path/to/repo/my_script.py",
compute_pool= "test_comput_pool",
stage_name="payload_stage",
)
job1 = job_def()
job2 = job_def(arg1="ML Job")
from snowflake.ml import jobs
@jobs.remote(compute_pool = "test_compute_pool", stage_name = "payload_stage")
def test_job(arg1: str = "world") -> None:
print(f"hello {arg1}")
# this is a job definition handle
job_def_remote = test_job
job1 = job_def_remote()
job2 = job_def_remote(arg1="ML Job")
ModelVersion.run_batch for job-based batch inference in Snowpark Container
Services is now in public preview.from snowflake.ml.registry import Registry
from snowflake.ml.model import OutputSpec
registry = Registry(session)
mv = registry.log_model( ... )
job = mv.run_batch(
compute_pool = "SYSTEM_COMPUTE_POOL_GPU",
X=input_df,
output_spec=OutputSpec(stage_location="@my_db.my_schema.my_stage/output/"),
)
ParamSpec in model signatures. This allows you to define
constant parameters that can be passed at inference time without being part of the input data.import pandas as pd
from snowflake.ml.model import custom_model, model_signature
from snowflake.ml.registry import Registry
# Define a custom model with inference parameters
class MyModelWithParams(custom_model.CustomModel):
@custom_model.inference_api
def predict(
self,
input_df: pd.DataFrame,
*,
temperature: float = 1.0, # keyword-only param with default
) -> pd.DataFrame:
return pd.DataFrame({"output": input_df["feature"] * temperature})
# Create sample data
model = MyModelWithParams(custom_model.ModelContext())
sample_input = pd.DataFrame({"feature": [1.0, 2.0, 3.0]})
sample_output = model.predict(sample_input, temperature=1.0)
# Define ParamSpec for the inference parameter
params = [
model_signature.ParamSpec(
name="temperature",
dtype=model_signature.DataType.FLOAT,
default_value=1.0,
),
]
# Infer signature with params
sig = model_signature.infer_signature(
input_data=sample_input,
output_data=sample_output,
params=params,
)
# Log model with the signature
registry = Registry(session)
mv = registry.log_model(
model=model,
model_name="my_model_with_params",
version_name="v1",
signatures={"predict": sig},
)
# Run inference with custom parameter value
result = mv.run(sample_input, function_name="predict", params={"temperature": 2.0})
Feature Store: Added auto_prefix parameter and with_name() method to avoid column name collisions when
joining multiple feature views in dataset generation.
Feature Store: Added support for Dynamic Iceberg Tables as the backing storage for Feature Views.
Use StorageConfig with StorageFormat.ICEBERG to create Iceberg-backed Feature Views that store
data in open Apache Iceberg format on external cloud storage. A new default_iceberg_external_volume
parameter is available in FeatureStore to set a default external volume for Iceberg Feature Views.
ML Job: Reverted changes related to the introduction of ML Job Definitions.
ML Job: Added support for creating ML job definitions and launching jobs with different arguments without re-uploading payloads.
ML Job: Added support for creating ML job definitions and launching jobs with different arguments without re-uploading payloads.
Inference Autocapture (PuPr): The create_service API will now accept autocapture as a new argument to indicate
whether inference data will be captured.
Model serving: Introduced the min_instances field in the mv.create_service() and
HuggingFacePipelineModel.log_model_and_create_service() APIs (defaulting to 0). The service now launches
with the min_instances and automatically scales between min_instances and max_instances based on
traffic and hardware utilization. When min_instances is set to 0, the service will automatically suspend
if no traffic is detected for a period of time.
Inference Autocapture (PuPr): list_services() now shows autocapture_enabled column to indicate if model
service has autocapture enabled.
Model serving: The mv.create_service() and HuggingFacePipelineModel.log_model_and_create_service() APIs now
include a min_instances field (defaulting to 0). When these APIs are called without specifying min_instances,
the system will now launch the service with 1 instance and enable auto scaling. This replaces the previous behavior,
where min_instances was automatically set to match max_instances, resulting in the immediate launch of the
maximum number of instances.
Feature Store: Added tile-based aggregation support with a new Feature API for efficient and point-in-time correct time-series feature computation usi
Feature Store: Added tile-based aggregation support with a new Feature API for efficient and
point-in-time correct time-series feature computation using pre-computed tiles stored in Dynamic Tables.
Registry: Added auto-signature inference for SentenceTransformer models. When logging a SentenceTransformer
model, sample_input_data is now optional. If not provided, the signature is automatically inferred from
the model's embedding dimension. Supported methods: encode, encode_query, encode_document,
encode_queries, encode_documents.
import sentence_transformers
from snowflake.ml.registry import Registry
# Create model
model = sentence_transformers.SentenceTransformer("all-MiniLM-L6-v2")
# Log model without sample_input_data - signature is auto-inferred
registry = Registry(session)
mv = registry.log_model(
model=model,
model_name="my_sentence_transformer",
version_name="v1",
)
# Run inference with auto-inferred signature (input: "text", output: "output")
import pandas as pd
result = mv.run(pd.DataFrame({"text": ["Hello world"]}))
ML Jobs: Enabled support for Python 3.11 and Python 3.12 by default. Jobs will automatically select a runtime environment matching the client Python v
Registry: Introducing remotely logging a transformer pipeline model using SPCS job.
# create reference of the model
model = huggingface.TransformersPipeline(
model="TinyLlama/TinyLlama-1.1B-Chat-v1.0",
task="text-generation",
)
# Remotely log the model, a SPCS job will run async and log the model
mv = registry.log_model(
model=model,
model_name="tinyllama_remote_log",
target_platforms=["SNOWPARK_CONTAINER_SERVICES"],
signatures=openai_signatures.OPENAI_CHAT_SIGNATURE,
)
# create reference of the model
model = huggingface.TransformersPipeline(
model="TinyLlama/TinyLlama-1.1B-Chat-v1.0",
task="text-generation",
)
# Remotely log the model, a SPCS job will run async and log the model
mv = registry.log_model(
model=model,
model_name="tinyllama_remote_log",
target_platforms=["SNOWPARK_CONTAINER_SERVICES"],
signatures=openai_signatures.OPENAI_CHAT_SIGNATURE,
)
Registry: Added support for image-text-to-text task type in huggingface.TransformersPipeline.
Note: Requires vLLM inference engine while creating the service.
ML Job: Added support for custom command entrypoints. The entrypoint parameter now accepts a
list[str] (e.g., ["arctic_training", "run_causal.yml"]), which is executed directly as a
command rather than being treated as a Python script.
openai_signatures.OPENAI_CHAT_SIGNATURE signature now handles content parts and
requires input data to be passed in list of dictionary. To use string content (previous behavior),
use openai_signatures.OPENAI_CHAT_SIGNATURE_WITH_CONTENT_FORMAT_STRING.from snowflake.ml.model import openai_signatures
import pandas as pd
mv = snowflake_registry.log_model(
model=generator,
model_name=...,
...,
signatures=openai_signatures.OPENAI_CHAT_SIGNATURE,
)
# create a pd.DataFrame with openai.client.chat.completions arguments like below:
x_df = pd.DataFrame.from_records(
[
{
"messages": [
{
"role": "system",
"content": [
{
"type": "text",
"text": "Complete the sentence."
},
]
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "A descendant of the Lost City of Atlantis, who swam to Earth while saying, ",
}
],
},
],
"max_completion_tokens": 250,
"temperature": 0.9,
"stop": None,
"n": 3,
"stream": False,
"top_p": 1.0,
"frequency_penalty": 0.1,
"presence_penalty": 0.2,
}
],
)
# OpenAI Chat Completion compatible output
output_df = mv.run(X=x_df)
Deprecating snowflake.ml.model.models.huggingface_pipeline.HuggingfacePipelineModel and will be removed in later version with a notice.
create_service API will now accept autocapture as a new argument to indicate
whether inference data will be captured.to_huggingface_dataset() method for converting Snowflake data to HuggingFace datasets.
Supports both in-memory Dataset (streaming=False) and streaming IterableDataset (streaming=True) modes.snowflake.ml.model.models.huggingface.TransformersPipeline model which will replace object
snowflake.ml.model.models.huggingface_pipeline.HuggingfacePipelineModel. This is a wrapper class to
transformers.Pipeline model. Currently, following tasks
are supported to log without manually specifying model signatures:
log_metrics or log_params will warn the user
instead of raising an exception.ModelVersion.run() will now raise a ValueError if the model does not support running on warehouse
(e.g. SPCS-only models) and service_name is not provided.additional_payloads (Preview API) behavior is changing.
Use the imports argument to declare additional dependencies, such as zip files and Python modules.
Local directories and Python files are automatically compressed, and their internal layout is determined by the
specified import path. The import path applies only to local directories, Python files and staged python files;
it has no effect on other import types. When referencing files in a stage, only individual files
are supported—not directories.list_services() now shows internal endpoint that does not need EAI to call from another
SPCS node or Notebook.list_services() now shows if model service has autocapture enabled.ExperimentTracking is now a singleton class.snowflake.ml.model.models.huggingface_pipeline.HuggingfacePipelineModel and will be removed in later
version with a notice.Experiment Tracking (PuPr): Reaching the run metadata size limit in log_metrics or log_params will warn the user instead of raising an exception.
log_metrics or log_params will warn the user
instead of raising an exception.create_service API will now
accept inference_engine_options as an argument.from snowflake.ml.model.inference_engine import InferenceEngine
mv = snowflake_registry.log_model(
model=generator,
model_name=...,
...,
# Specifying OPENAI_CHAT_SIGNATURE is necessary to use vLLM inference engine
signatures=openai_signatures.OPENAI_CHAT_SIGNATURE,
)
mv.create_service(
service_name=my_serv,
service_compute_pool=...,
...,
inference_engine_options={
"engine": InferenceEngine.VLLM,
"engine_args_override": [
"--max-model-len=2048",
"--gpu-memory-utilization=0.9"
]
}
)
Experiment Tracking (PrPr): No longer throw an exception in list_artifacts when run does not have artifacts.
list_artifacts when run does not have artifacts.get_version_by_alias: now requires an exact match of snowflake identifier.snowflake.ml.experiment) is in public preview.Registry: The create_service API now validates that a model has a GPU runtime configuration and will throw a descriptive error if the configuration is
ModelVersion.run_batch for batch inference in Snowpark Container Services.version_name argument to the autologging callbacks
to specify the version name for the autologged model.Python 3.9 is deprecated.ML Job: Added support for retrieving details of deleted jobs, including status, compute pool, and target instances.
MLJob.result() API with broader cross-version
compatibility and support for additional data types, namely:
snowflake-ml-python>=1.17.0 to be installed inside remote container environment.MLRS_USE_SUBMIT_JOB_V2 to falseRegistry: Remove redundant pip dependency warnings when artifact_repository_map is provided for warehouse model deployments.
artifact_repository_map is provided for warehouse model deployments.runtime_environment
(image tag or full image URL) at submission time.
Examples:
Volatility.VOLATILE or Volatility.IMMUTABLE.from snowflake.ml.model.volatility import Volatility
options = {
"embed_local_ml_library": True,
"relax_version": True,
"save_location": "/path/to/my/directory",
"function_type": "TABLE_FUNCTION",
"volatility": Volatility.IMMUTABLE,
"method_options": {
"predict": {
"case_sensitive": False,
"max_batch_size": 100,
"function_type": "TABLE_FUNCTION",
"volatility": Volatility.VOLATILE,
},
}
Registry: Dropping support for deprecated conversational task type for Huggingface models. To read more
conversational task type for Huggingface models.
To read more https://github.com/huggingface/transformers/pull/31165ML Job: The additional_payloads argument is now deprecated in favor of imports.
additional_payloads argument is now deprecated in favor of imports.Registry: Log a HuggingFace model without having to load the model in memory using the huggingface_pipeline.HuggingFacePipelineModel. Requires hugging
huggingface_pipeline.HuggingFacePipelineModel. Requires huggingface_hub package to installed.
To disable downloading HuggingFace repository, provide download_snapshot=False while creating the
huggingface_pipeline.HuggingFacePipelineModel object.enable_categorical=True with pandas DataFrameRegistry: Fixed an issue where the string representation of dictionary-type output columns was being incorrectly created during structured output dese
text-generation models.from snowflake.ml.model import openai_signatures
import pandas as pd
mv = snowflake_registry.log_model(
model=generator,
model_name=...,
...,
signatures=openai_signatures.OPENAI_CHAT_SIGNATURE,
)
# create a pd.DataFrame with openai.client.chat.completions arguments like below:
x_df = pd.DataFrame.from_records(
[
{
"messages": [
{"role": "system", "content": "Complete the sentence."},
{
"role": "user",
"content": "A descendant of the Lost City of Atlantis, who swam to Earth while saying, ",
},
],
"max_completion_tokens": 250,
"temperature": 0.9,
"stop": None,
"n": 3,
"stream": False,
"top_p": 1.0,
"frequency_penalty": 0.1,
"presence_penalty": 0.2,
}
],
)
# OpenAI Chat Completion compatible output
output_df = mv.run(X=x_df)
segment_columns parameter to ModelMonitorSourceConfig to specify columns for segmenting monitoring dataadd_segment_column(): Add a new segment column to an existing monitordrop_segment_column(): Remove a segment column from an existing monitorlog_artifactlist_artifactsdownload_artifactsML Job: Fix Error: Unable to retrieve head IP address if not all instances start within the timeout.
Error: Unable to retrieve head IP address if not all instances start within the timeout.TypeError: SnowflakeCursor.execute() got an unexpected keyword argument '_force_qmark_paramstyle'
when running inside Stored Procedures.ModelVersion.create_service(): Made image_repo argument optional. By
default it will use a default image repo, which is
being rolled out in server version 9.22+.snowflake.ml.experiment.callback.keras.SnowflakeKerasCallback.Registry: add progress bars for ModelVersion.create_service and ModelVersion.log_model.
ModelVersion.create_service and ModelVersion.log_model.ModelVersion.create_service will be written to a file. The file location
will be shown in the console.snowflake.ml.experiment.callback.xgboost.SnowflakeXgboostCallback and
snowflake.ml.experiment.callback.lightgbm.SnowflakeLightgbmCallback.ModelVersion.create_service and ModelVersion.log_model.ModelVersion.create_service will be written to a file. The file location
will be shown in the console.DataConnector: Fix self._session related errors inside Container Runtime.
self._session related errors inside Container Runtime.None to array (pd.dtype('O')) in signature and pandas data handler.from snowflake.ml.experiment import ExperimentTracking
from snowflake.ml.experiment.callback import SnowflakeXgboostCallback, SnowflakeLightgbmCallback
exp = ExperimentTracking(session=sp_session, database_name="ML", schema_name="PUBLIC")
exp.set_experiment("MY_EXPERIMENT")
# XGBoost
callback = SnowflakeXgboostCallback(
exp, log_model=True, log_metrics=True, log_params=True, model_name="model_name", model_signature=sig
)
model = XGBClassifier(callbacks=[callback])
with exp.start_run():
model.fit(X, y, eval_set=[(X_test, y_test)])
# LightGBM
callback = SnowflakeLightgbmCallback(
exp, log_model=True, log_metrics=True, log_params=True, model_name="model_name", model_signature=sig
)
model = LGBMClassifier()
with exp.start_run():
model.fit(X, y, eval_set=[(X_test, y_test)], callbacks=[callback])
Registry: Fix a bug when trying to set the PAD token the HuggingFace text-generation model had multiple EOS tokens. The handler picks the first EOS to
text-generation model had multiple EOS tokens.
The handler picks the first EOS token as PAD token now.create_service function in snowflake/ml/model/models/huggingface_pipeline.py
which creates a service to log a HF model and upon successful logging, an inference service is created.from snowflake.ml.model.models import huggingface_pipeline
hf_model_ref = huggingface_pipeline.HuggingFacePipelineModel(
model="gpt2",
task="text-generation", # Optional
)
hf_model_ref.create_service(
session=session,
service_name="test_service",
service_compute_pool="test_compute_pool",
image_repo="test_repo",
...
)
from snowflake.ml.experiment import ExperimentTracking
exp = ExperimentTracking(session=sp_session, database_name="ML", schema_name="PUBLIC")
exp.set_experiment("MY_EXPERIMENT")
with exp.start_run():
exp.log_param("batch_size", 32)
exp.log_metrics("accuracy", 0.98, step=10)
exp.log_model(my_model, model_name="MY_MODEL")
Registry: Fixed bug causing snowpark to pandas dataframe conversion to fail when QUOTED_IDENTIFIERS_IGNORE_CASE parameter is enabled
QUOTED_IDENTIFIERS_IGNORE_CASE
parameter is enabledlist_jobs() API has been modified. The scope parameter has been removed,
optional database and schema parameters have been added, the return type has changed
from snowpark.DataFrame to pandas.DataFrame, and the returned columns have been updated
to name, status, message, database_name, schema_name, owner, compute_pool,
target_instances, created_time, and completed_time.relax_version to false when pip_requirements are specified while logging modeltarget_platforms supports TargetPlatformMode: WAREHOUSE_ONLY, SNOWPARK_CONTAINER_SERVICES_ONLY,
or BOTH_WAREHOUSE_AND_SNOWPARK_CONTAINER_SERVICES.snowflake.ml.model.target_platform.TargetPlatform, target platform constants, and
snowflake.ml.model.task.Task.**kwargslist_jobs() behavior changed, see Behavior Changes for more infoQUOTED_IDENTIFIERS_IGNORE_CASE
parameter is enabled{% for message in messages %}
{{'<|im_start|>' + message['role'] + '\n' + message['content'] + '<|im_end|>' + '\n'}}
{% endfor %}
{% if add_generation_prompt %}
{{ '<|im_start|>assistant\n' }}
{% endif %}"
list_jobs() API has been modified. The scope parameter has been removed,
optional database and schema parameters have been added, the return type has changed
from snowpark.DataFrame to pandas.DataFrame, and the returned columns have been updated
to name, status, message, database_name, schema_name, owner, compute_pool,
target_instances, created_time, and completed_time.relax_version to false when pip_requirements are specified while logging modeltarget_platforms supports TargetPlatformMode: WAREHOUSE_ONLY, SNOWPARK_CONTAINER_SERVICES_ONLY,
or BOTH_WAREHOUSE_AND_SNOWPARK_CONTAINER_SERVICES.snowflake.ml.model.target_platform.TargetPlatform, target platform constants, and
snowflake.ml.model.task.Task.**kwargslist_jobs() behavior changed, see Behavior Changes for more infoRegistry: Add service container info to logs.
submit_from_stage() API for submitting a payload from an existing stage path.snowpark.Session objects in the argument list of
@remote decorated functions. Session object will be injected from context in
the job execution environment.One column per quarter.