About Streamlit in Snowflake

Streamlit is an open-source Python library that makes it easy to create and share custom web apps for machine learning and data science. By using Streamlit you can quickly build and deploy powerful data applications. For more information about the open-source library, see the Streamlit Library documentation.

Streamlit in Snowflake helps developers securely build, deploy, and share Streamlit apps on Snowflake’s data cloud. Using Streamlit in Snowflake, you can build applications that process and use data in Snowflake without moving data or application code to an external system.

Supported versions of the Streamlit library

Streamlit in Snowflake supports the following versions of the Streamlit open-source library:

  • 1.31.1

  • 1.29.0

  • 1.26.0

  • 1.22.0

To view release notes for each version, see Streamlit library changelog. Note that some features of the open-source Streamlit library are unsupported in Streamlit in Snowflake. See Unsupported Streamlit features.

Select the Streamlit library version

For each Streamlit in Snowflake app, you can select the Streamlit library version in Snowsight or pin the version in the app’s environment.yml file. If you do not pin the version, the latest available version is used.

Snowflake recommends pinning a version of Streamlit to prevent the app from getting upgraded when a new version of Streamlit becomes available in the Snowflake Anaconda Channel.

Supported external packages

By default, Streamlit in Snowflake includes the python, streamlit, and snowflake-snowpark-python packages pre-installed in your environment. The environment also has access to the dependencies required by these packages.

Streamlit in Snowflake apps run in Python 3.8.

You can install additional packages in your Streamlit app. See the Snowflake Anaconda Channel for a list of supported packages.

See the following topics for information about including a supported package in your Streamlilt app:

Concurrency considerations for Streamlit in Snowflake

Streamlit in Snowflake provides session throttling and autoscaling within Snowflake to handle periods of increased demand for a Streamlit app. Streamlit in Snowflake uses a combination of cloud services instances and virtual warehouse instances. See Key Concepts & Architecture for more information.

To maintain the integrity of Snowflake, Streamlit in Snowflake imposes per-instance, per-account, and per-user limits on the number of concurrent Streamlit sessions that a Cloud Services instance can handle. Streamlit sessions are load-balanced between these instances until all instances reach their concurrent session limit. When a limit is reached, the instance is auto-scaled to support additional sessions.

Note

Requests from Streamlit app users might be throttled temporarily. Users might see a “Please Wait” message when autoscaling is initiated.

Billing considerations for Streamlit in Snowflake

Streamlit in Snowflake requires a virtual warehouse to run a Streamlit app and to perform SQL queries. To run a Streamlit app, you must select a single virtual warehouse to run both the app itself and its queries. This warehouse remains active while the app’s WebSocket connection is active. The WebSocket connection, which keeps the Streamlit app’s virtual warehouse active, expires approximately 15 minutes after the app’s last use.

To conserve credits, you can suspend the virtual warehouse. Alternatively, you can close the webpage running the app, which allows the virtual warehouse that is running to auto-suspend.