Snowflake Cortex AI Function Studio GA: test cheaper models on labeled data

Snowflake made Cortex AI Function Studio and Cortex AI Function Optimization generally available on November 16, 2026, according to two entries in its release notes. Together they give data teams a supported way to build a custom AI function in SQL, score it against a labeled sample, and let Snowflake search for a better prompt or a cheaper model before the function is used on production tables.
The practical change is in how teams choose a model for jobs such as ticket classification, document extraction, sentiment scoring or PII redaction. Until now that choice was usually made by hand, by testing a few prompts on a few rows. With optimization, Snowflake generates candidate implementations for each model you list, scores them with one metric on a versioned dataset, and reports each candidate's quality next to its cost relative to the original function. The original function is never modified, so a team can review the results and promote only the candidate it trusts.
Cortex AI Function Studio first appeared as a public preview on May 20, 2026. The November release moves both the guided Studio experience and the underlying optimization experiment type to general availability.
··········
WHAT SNOWFLAKE RELEASED IN CORTEX AI FUNCTION STUDIO.
Snowflake describes AI Function Studio as a guided, agentic experience that takes an AI task through three stages: create, evaluate and optimize. It is launched from CoCo (Cortex Code), either in Snowsight or in the Cortex Code CLI with the command /cortex-ai-function-studio. The Studio menu offers Create, Evaluate, Optimize, Demo, Check Status and Built-in AI Functions.
Studio works on the same Snowflake objects that the SQL interface uses, so an engineer can do the same work directly with CREATE AI FUNCTION, CREATE EXPERIMENT and EXECUTE EXPERIMENT, while an analyst can follow the guided workflow. The release note lists document extraction, summarization, sentiment analysis, classification, structured generation, compliance workflows and reasoning pipelines as typical uses, across text, documents, images, audio and video, depending on what each supported model can process.
When creating a function in Studio, the user describes the task in natural language and chooses between a Direct approach, which wraps a single AI_COMPLETE call, and an Agent Research approach, in which Studio proposes strategies that include SQL pre-processing and post-processing. Studio can also help prepare the labeled data: it can work with an existing labeled dataset, generate labels for existing inputs, or generate synthetic inputs with labels.
........
Component | Status | What it does |
AI Function Studio | GA, Nov 16, 2026 | Guided create, evaluate, optimize flow in CoCo |
CREATE AI FUNCTION | Documented | Reusable scalar function built on AI_COMPLETE or AI_CLASSIFY |
AI_FUNCTION_EVALUATION | Documented | Scores a function on a dataset with one metric |
AI_FUNCTION_OPTIMIZATION | GA, Nov 16, 2026 | Searches prompts and models, reports quality and cost |
........
··········
HOW CORTEX AI FUNCTION OPTIMIZATION WORKS.
An optimization is a Snowflake experiment of type AI_FUNCTION_OPTIMIZATION. Its specification, written in YAML inside CREATE EXPERIMENT, names the function to optimize, one metric, a versioned dataset, one or more candidate models and a reflection model, which is the model that proposes improvements. EXECUTE EXPERIMENT then runs asynchronously on serverless compute. The result is a SEED run, the baseline score of the original function, plus a series of ITER runs, each a candidate with its own model and tuned implementation.
The example below follows the structure in Snowflake's AI_FUNCTION_OPTIMIZATION reference. It assumes a ticket-classification function created with CREATE AI FUNCTION and a labeled dataset of support tickets; the object names are illustrative.
CREATE OR REPLACE EXPERIMENT analytics.support.ticket_class_opt
TYPE = 'AI_FUNCTION_OPTIMIZATION'
FROM SPECIFICATION $$
function:
function_name: "analytics.support.classify_ticket(VARCHAR)"
metrics:
- name: exact_match
dataset:
name: analytics.support.ticket_labels_ds
version: v1
column_mapping:
argument_mapping:
ticket_text: body
ground_truth: expected_category
optimization:
models:
- claude-haiku-4-5
- claude-sonnet-4-5
reflection_model: claude-sonnet-4-5
strategy: balanced
budget: ultra-light
$$;
EXECUTE EXPERIMENT analytics.support.ticket_class_opt;Three settings control the search. The strategy can be quality_first (the default), balanced or cost_first; the documentation says quality_first maximizes the metric, balanced trades quality against cost, and cost_first minimizes cost while holding quality. The budget sets the number of proposal iterations per model: about 4 to 6 for ultra-light, 10 to 15 for light, 18 to 27 for medium and 27 to 40 for heavy, with auto currently resolving to light. Each candidate model receives its own full budget, so listing three models roughly triples the work.
Results are read with SHOW RUNS IN EXPERIMENT and SHOW RUN METRICS IN EXPERIMENT, or in the Cost vs. Quality Pareto view in Snowsight. The fields to compare are val_score (quality on the validation split, from 0 to 1), test_score (quality on a held-out test split, reported for frontier runs), cost_compared_to_seed (below 1 means cheaper than the original) and is_frontier, which marks candidates on the quality and cost frontier. Snowflake advises reviewing the whole frontier and preferring test_score, because validation scores can overfit. A chosen run becomes a new function with CREATE AI FUNCTION and its FROM EXPERIMENT clause, which copies that run's implementation while keeping the original signature and return type.
··········
METRICS, DATASET RULES AND LIMITS FOR AI FUNCTION OPTIMIZATION.
Each evaluation or optimization uses exactly one metric. The documented options are exact_match for classification, fuzzy_match when small formatting differences are acceptable, contains_match, redaction_match for redaction tasks, llm_judge for open-ended output (scored by a judge model on a 0 to 1 scale, with claude-sonnet-4-5 as the default judge) and custom, which calls a scalar UDF that receives the expected and predicted values and returns a score between 0 and 1.
........
Limit or rule | As documented |
Dataset type | Versioned SNOWFLAKE.ML.DATASET only |
Dataset size | Max 1,000 rows; 50 to 200 recommended |
Metrics per run | One |
AI_COMPLETE calls in the function | Exactly one |
Candidate models | At most 5 recommended |
Experiment run time | Terminated after 20 hours |
Target object | Must be a CREATE AI FUNCTION object |
........
The function being optimized must call AI_COMPLETE exactly once, and a plain UDF is rejected as a target. Plain tables and views are not accepted as datasets, so a team has to register its labeled sample as a versioned dataset first. Candidate and reflection models must be authorized for the account, priced for optimization and served in the account's region, or the experiment fails. For the reflection model, Snowflake recommends a model at least as capable as Claude Sonnet, because weaker models often fail to produce usable candidates.
Access is governed by standard Snowflake privileges. Creating the experiment requires CREATE EXPERIMENT on the schema; executing it requires the SNOWFLAKE.CORTEX_USER database role or SNOWFLAKE.AI_FUNCTIONS_USER; and the user needs USAGE on the databases and schemas that hold the function and the dataset. Creating the AI function itself requires CREATE FUNCTION on the schema, and callers need SNOWFLAKE.CORTEX_USER to run the AI calls. Studio is available natively in select regions and in all regions through cross-region inference.
··········
WHAT CORTEX AI FUNCTION STUDIO COSTS TO USE.
The release notes do not publish a separate price for Studio or for optimization. The documentation explains what is metered instead. During development, the account pays for the model tokens used in experiments and for Cortex Code usage. The experiment itself runs on serverless compute metered as SERVERLESS_EXPERIMENTS, and every AI call it makes is billed as Cortex inference tokens. Snowflake's Service Consumption Table effective November 12, 2026, consulted on November 17, lists Serverless Experiments with a compute multiplier of 0.9 and marks that feature as Preview. Once a custom AI function is in production, it is billed for the models it calls, and Snowflake states that the function wrapper adds no surcharge.
The financial case for optimization sits in that production phase. On the same consumption table, AI_COMPLETE with claude-sonnet-4-5 costs 1.80 AI Credits per million input tokens and 9.00 per million output tokens, while claude-haiku-4-5 costs 0.60 and 3.00, with the AI Credit priced at $2.00 globally and $2.20 for regional usage on demand. The illustrative example below assumes a classification function that processes 1,000,000 tickets a month at 400 input tokens and 10 output tokens per ticket. The token counts are assumptions for the example; the rates are Snowflake's published figures.
........
Monthly item (illustrative) | claude-sonnet-4-5 | claude-haiku-4-5 |
Input tokens | 400M | 400M |
Output tokens | 10M | 10M |
AI Credits, input | 720 | 240 |
AI Credits, output | 90 | 30 |
Total AI Credits | 810 | 270 |
Cost at $2.00 global | $1,620 | $540 |
Cost at $2.20 regional | $1,782 | $594 |
........
In this example the Haiku function costs one third of the Sonnet function, a difference of 540 AI Credits or $1,080 a month at the global price. That saving only exists if the cheaper model reaches the accuracy the business needs, which is the question an optimization run answers with a score on labeled data. The one-off cost of running the experiment, its tokens and serverless compute, has to be set against that monthly difference; Snowflake does not publish a per-experiment estimate, and usage can be tracked in SNOWFLAKE.ACCOUNT_USAGE.CORTEX_AI_FUNCTIONS_USAGE_HISTORY. The per-token rates behind this table are covered in more detail in our breakdown of Snowflake Cortex AI Functions pricing, and the warehouse side of the bill in our Snowflake pricing guide to credits and warehouse sizes.
··········
WHAT TO CHECK BEFORE USING OPTIMIZED AI FUNCTIONS.
The quality of an optimization result depends on the labeled sample. With a recommended 50 to 200 rows, the sample has to include the rare categories, edge cases and document formats the function will meet in production, or a cheaper candidate can score well on the sample and fail on real data. Snowflake notes that scores from different datasets, versions, labels, metrics or judge models are not directly comparable, so a team that changes its labels should rerun the baseline before comparing candidates.
Before promoting a candidate, the reviewer should read its function_impl parameter to see the rewritten prompt, confirm that the output format still matches downstream tables, and check test_score rather than val_score. Starting with an ultra-light budget, as the documentation suggests, confirms that the dataset mapping and metric work before a heavier and more expensive search. For extraction tasks on long files, the document limits described in our article on Snowflake AI_EXTRACT with 1,000-page documents still apply to the functions being tuned.
··········
SNOWFLAKE AI FUNCTION STUDIO: WHAT DEPENDS ON YOUR ACCOUNT.
Snowflake has confirmed general availability of AI Function Studio and of the AI_FUNCTION_OPTIMIZATION experiment type as of November 16, 2026, together with the documented metrics, budgets, strategies, privileges and the limits of 1,000 dataset rows, one metric and one AI_COMPLETE call per function. It has also stated that production AI functions are billed only for the models they call.
What a given team can use depends on its region and on which models are authorized and priced for optimization in its account, on whether cross-region inference is enabled, and on Cortex Code access for the guided Studio flow. Snowflake has not published a fixed price per optimization run, and the consumption table still lists Serverless Experiments as Preview, so the cost of the search itself has to be measured in the account's usage views during a first small experiment.
··········
FOLLOW US FOR MORE.
·····
DATA STUDIOS
·····
datastudios.org




