Registry / ai-ml / snowflake-ml-python

snowflake-ml-python

JSON →
library1.53.0pypypi✓ verified 22d ago

The Snowflake ML Python Library (snowflake-ml-python) is the official client for interacting with Snowflake to build and deploy machine learning solutions. It provides interfaces for machine learning lifecycle management including session management, model development, model registry, feature store, and experiment tracking. The library is actively maintained with frequent minor releases, typically on a monthly to bi-monthly cadence, and is currently at version 1.34.0.

pip install snowflake-ml-python
INSTALL
IMPORT
SIG · SNOWFLAKE-ML-PYTHO
S
snowflake-ml-python
ai-mlpythonv1.53.0
Install
43.3s avg
Import
4714ms
Disk
1495MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.53.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
build_error
glibc
py 3.103.95 runs
installs and imports cleanly · install 43.3s · import 4.714s · 1536MB
1495MB installed
● package 1495MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Session
from snowflake.snowpark import Session
Required to establish the underlying Snowpark connection.
get_session
from snowflake.ml.session import get_session
Obtains the ML-specific session object, typically from an existing Snowpark Session.
Model
from snowflake.ml.model import Model
Main class for interacting with the Snowflake Model Registry.
Registry
from snowflake.ml.registry import Registry
Provides methods for managing models in the Snowflake Model Registry.

This quickstart demonstrates how to establish a Snowflake ML Session by first creating a Snowpark Session using environment variables for connection parameters. This session is the entry point for all operations within the snowflake-ml-python library.

import os from snowflake.snowpark import Session from snowflake.ml.session import get_session # Ensure environment variables are set for connection: # SNOWFLAKE_ACCOUNT, SNOWFLAKE_USER, SNOWFLAKE_PASSWORD, SNOWFLAKE_ROLE, # SNOWFLAKE_WAREHOUSE, SNOWFLAKE_DATABASE, SNOWFLAKE_SCHEMA connection_parameters = { "account": os.environ.get("SNOWFLAKE_ACCOUNT", "your_account"), "user": os.environ.get("SNOWFLAKE_USER", "your_user"), "password": os.environ.get("SNOWFLAKE_PASSWORD", "your_password"), "role": os.environ.get("SNOWFLAKE_ROLE", "your_role"), "warehouse": os.environ.get("SNOWFLAKE_WAREHOUSE", "your_warehouse"), "database": os.environ.get("SNOWFLAKE_DATABASE", "your_database"), "schema": os.environ.get("SNOWFLAKE_SCHEMA", "your_schema"), } session = None try: # Establish a Snowpark Session session = Session.builder.configs(connection_parameters).create() print("Snowpark Session created successfully.") print(f"Current database: {session.get_current_database()}, schema: {session.get_current_schema()}") # Obtain the Snowflake ML Session (uses the Snowpark session) ml_session = get_session(session) print("Snowflake ML Session obtained successfully.") # You can now use ml_session for various ML tasks, e.g., # ml_session.model.deploy(...) # ml_session.feature_store.register_feature_view(...) except Exception as e: print(f"An error occurred: {e}") finally: if session: session.close() print("Snowpark Session closed.")
Debug
Known issues
gotchaIncorrect permissions can prevent model inference. Previously, `model_version.run()` required `READ` privilege on the model instead of `USAGE`, leading to failures. While fixed in 1.27.0, ensure your Snowflake role has appropriate `USAGE` grants on the model and other necessary objects.
fix
Grant `USAGE` privilege on the model and required schema/database objects to the executing role. Always verify required privileges in the official Snowflake documentation.
affects: <1.27.0 (bug), all (general permission issue)
gotchaHandling case-sensitive or Unicode identifiers (e.g., Japanese column names) can lead to errors due to incorrect quoting in generated SQL. This particularly affected `generate_dataset()` and `generate_training_set()` for Feature Store operations.
fix
Ensure all identifiers (table names, column names) that are case-sensitive or contain special characters are consistently quoted and handled correctly throughout your Snowflake objects and Python code. Upgrade to 1.34.0+ for fixes related to Feature Store SQL generation.
affects: <1.34.0 (bug), all (general Snowflake behavior)
gotchaUsing `ParamSpec` (inference parameters) with table functions or partitioned model methods has historically had issues, leading to runtime failures or incorrect behavior. While fixes have been released, understanding the nuances of `ParamSpec` with various model types (custom, sklearn, PyTorch) and deployment configurations is crucial.
fix
Consult the latest documentation for `ParamSpec` usage. Test thoroughly when combining `ParamSpec` with complex deployment scenarios (e.g., partitioned inference, custom handlers). Upgrade to recent versions for improved support and stability.
affects: <1.29.0 (bug), <1.32.0 (limited support), all (complexity)
Upgrade
Version history
1.53.0latest on PyPI · released Aug 24, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
26 hits · last 30 days
node
19
Bingbot
1
OpenAI (training)
1
Resources
snowflake-ml-python — pip install snowflake-ml-python · libregistry