What you will be able to do
- Choose between managed ML Functions, Cortex AI Functions and Snowpark Container Services for an AI/ML requirement
- Describe the image repository, compute pool, service and job service objects in Snowpark Container Services
- Explain how Streamlit in Snowflake and the Snowflake Native App Framework deliver AI/ML results to users and other accounts
1.Managed options first: ML Functions and Cortex AI Functions
A basic AI/ML pipeline on Snowflake brings the model to the data. Start with the most managed option that meets the requirement, and only move to custom containers when it doesn't. Two managed families need no model hosting at all.
ML Functions train a model on your data and return predictions or insights, and Snowflake picks the model type for you. Forecasting and Anomaly Detection work on time-series data. Classification and Top Insights don't need time-series data. Training and prediction use compute, and stored model instances add storage costs.
Cortex AI Functions run LLMs from providers including OpenAI, Anthropic, Meta and Mistral AI over text and images. They are SQL functions that are also available in Python, and the models run inside the Snowflake service perimeter. To call them, a role needs the USE AI FUNCTIONS account privilege and either the CORTEX_USER or the AI_FUNCTIONS_USER database role. They are tuned for throughput, which makes them the right choice for batch processing over large tables. For interactive, latency-sensitive apps, use the REST APIs (Complete, Embed, Agents) instead.
| Requirement | Capability | Family |
|---|---|---|
| Predict future sales from past trends | Forecasting | ML Functions |
| Flag metric values that differ from expectations | Anomaly Detection | ML Functions |
| Score sentiment of support tickets | AI_SENTIMENT | Cortex AI Functions |
| Summarize a text column across many rows | AI_SUMMARIZE_AGG | Cortex AI Functions |
| Keep rows matching a natural-language condition | AI_FILTER | Cortex AI Functions |
| Produce vectors for similarity search | AI_EMBED | Cortex AI Functions |
Checkpoint 1 of 5· Check yourself
An analyst wants to classify 20 million product reviews stored in a table using an LLM, from SQL, without deploying any model. Which approach fits best?
Cortex AI Functions are managed SQL functions optimized for throughput over large tables. The REST API is meant for interactive, low-latency use.
“Batch processing is typically better suited for AI Functions.”Source: docs.snowflake.com
2.Custom workloads: Snowpark Container Services
When the managed functions can't do the job because you need a custom runtime, a specialized library or your own model code, Snowpark Container Services (SPCS) is Snowflake's managed container platform. You package the application as an OCI image, in any language or framework. CPU and GPU machine types support model training, model serving and AI analytics, and the data never leaves Snowflake. Containers can run SQL on a warehouse, read stage files, and reuse network policies, external access integrations, RBAC and event tables.
| Object | Created with | Purpose |
|---|---|---|
| Image repository | CREATE IMAGE REPOSITORY | OCIv2 registry storage; Docker and other OCI clients push images here |
| Compute pool | CREATE COMPUTE POOL | One or more VM nodes, with a machine type and minimum and maximum node counts |
| Service | CREATE SERVICE | Long-running; Snowflake restarts a container that exits |
| Job service | EXECUTE JOB SERVICE | Finite; done when all containers exit, never restarted |
Common SPCS workloads include batch data-processing jobs, service functions that queries call to send batches of rows for custom processing, and APIs or web UIs over Snowflake data that use caller's rights. SPCS can also be managed through Python APIs, REST APIs and Snowflake CLI, so these workloads fit the same CI/CD pipelines as the rest of the platform.
Checkpoint 2 of 5· Match them up
Match each SPCS object to its role
Tap a term, then the definition that fits it.
Images live in a repository and run on a compute pool, either as a long-running service or as a finite job service.
“If a service container exits for whatever reason, Snowflake restarts that container.”Source: docs.snowflake.com
Checkpoint 3 of 5· Exam question
A DataOps team wants developers to test transformation pipeline changes against production-scale data before merging, without risking production tables or waiting for a nightly data refresh. Which approach best supports this DevOps/DataOps principle?
Correct answer: A — Create a zero-copy clone of the production database per feature branch, run the pipeline changes against it, then drop the clone after validation.
- A. Zero-copy cloning creates a metadata-only copy of production at essentially no extra storage cost, giving each branch an isolated, production-scale environment that can be discarded after testing.
- B. Letting developers write directly to production, even temporarily, risks unrecoverable damage from an untested pipeline and depends on error-prone manual reverts instead of isolation.
- C. A quarterly-refreshed shared database quickly drifts from current production data and forces every developer's tests to collide in the same environment, undermining isolated feature validation.
- D. Exporting samples to local laptops loses production scale and referential integrity, and it also risks moving governed data outside Snowflake's access controls entirely.
Sources3
3.Delivering results: Streamlit and the Native App Framework
A pipeline isn't finished until people can use its output. Streamlit is an open-source Python library for data and ML web apps. Streamlit in Snowflake runs those apps on Snowflake-managed compute and storage, with a choice of warehouse or container runtime. The source code lives in a Snowflake object governed by RBAC, so neither the data nor the code has to leave Snowflake. Streamlit apps work with Snowpark, UDFs, stored procedures and the Native App Framework.
To ship data and logic to other accounts, a provider uses the Snowflake Native App Framework. The provider builds an application package that holds data content, application logic (Streamlit, Snowpark, JavaScript or SQL), metadata and a setup script. A manifest file points to the setup script and declares versions. After testing in a single account, the provider publishes the package through a Marketplace or private listing, and later releases new versions and patches. A Native App can also run SPCS containers. In that case the consumer grants the app CREATE COMPUTE POOL or creates the pools manually, and the provider's query text is hidden from the consumer's QUERY_HISTORY.
Checkpoint 4 of 5· Put it in order
Put the Native App lifecycle in order
- 1.Provider develops and tests an application package
- 2.Snowflake creates the application and runs the setup script
- 3.Consumer discovers the listing and installs the app
- 4.Provider publishes a listing containing the application package
Publishing a listing comes after testing the package. Installation then creates the app object and runs the setup script in the consumer account.
“After a provider publishes a listing containing an application package, consumers can discover the listing and install the application.”Source: docs.snowflake.com
Checkpoint 5 of 5· Check yourself
In a Snowflake Native App, which component contains the SQL statements that run when a consumer installs or upgrades the app?
The manifest file only records where the setup script is. The setup script holds the SQL that runs at install and upgrade.
“Contains SQL statements that are run when the consumer installs or upgrades an application”Source: docs.snowflake.com
Exam traps
Each one states something that sounds right. Open it to see what is actually true.
1.Cortex AI Functions in SQL are the best choice for a latency-sensitive chat interface.Why is that wrong?
AI Functions are optimized for throughput and batch processing. For interactive use, the REST APIs (Complete, Embed, Agents) are the recommended path.
Covered in Managed options first: ML Functions and Cortex AI Functions
2.A model-training job should run as a long-running SPCS service so Snowflake restarts it on failure.Why is that wrong?
Long-running services get their containers restarted, but finite work such as training belongs in a job service, which finishes when its containers exit.
Sources
Every claim above is drawn from one of these pages, quoted as it was written on the date shown.
- 1.
“Forecasting predicts future metric values from past trends in time-series data.”
↩︎ Managed options first: ML Functions and Cortex AI Functions“When you use ML functions, you incur storage and compute costs.”
↩︎ Managed options first: ML Functions and Cortex AI Functions - 2.
“your role needs the USE AI FUNCTIONS account-level privilege and one of the CORTEX_USER or AI_FUNCTIONS_USER database roles”
↩︎ Managed options first: ML Functions and Cortex AI Functions“All the LLMs that Snowflake provides access to via our Snowflake AI Features are deployed within the Snowflake Service perimeter.”
↩︎ Managed options first: ML Functions and Cortex AI Functions“For more interactive use cases where latency is important, use the REST API.”
↩︎ Exam trap 1“Batch processing is typically better suited for AI Functions.”
↩︎ Checkpoint - 3.
“You can package your application and its dependencies into an Open Container Initiative (OCI) image”
↩︎ Custom workloads: Snowpark Container Services“with support for advanced CPUs and GPUs, you can run compute-intensive workloads, such as ML model serving, ML model training”
↩︎ Custom workloads: Snowpark Container Services“a compute pool, which is a collection of one or more virtual machine (VM) nodes”
↩︎ Custom workloads: Snowpark Container Services“To start a job service, such as training a machine learning model with GPUs, use the EXECUTE JOB SERVICE command.”
↩︎ Exam trap 2“A job service has a finite lifespan, similar to a stored procedure.”
↩︎ Prediction“If a service container exits for whatever reason, Snowflake restarts that container.”
↩︎ Checkpoint - 4.
“build applications that process and use data in Snowflake without moving data or application code to an external system”
↩︎ Delivering results: Streamlit and the Native App Framework“You can choose between a warehouse and container runtime.”
↩︎ Delivering results: Streamlit and the Native App Framework - 5.
“An application package encapsulates the data content, application logic, metadata, and setup script required by an application.”
↩︎ Delivering results: Streamlit and the Native App Framework“You can distribute and monetize your apps in the Snowflake Marketplace or distribute them to specific consumers using private listings.”
↩︎ Delivering results: Streamlit and the Native App Framework“The query text is hidden from the QUERY_HISTORY view.”
↩︎ Delivering results: Streamlit and the Native App Framework“After a provider publishes a listing containing an application package, consumers can discover the listing and install the application.”
↩︎ Checkpoint“Contains SQL statements that are run when the consumer installs or upgrades an application”
↩︎ Checkpoint