Snowflake Cortex AI Function Evaluation for measuring quality
Measure quality, cost, and token usage of custom AI functions and Cortex AI calls against labeled datasets.
O que mudou
Snowflake Cortex AI Function Evaluation enables measuring output quality, cost, and token usage of AI calls and custom functions against labeled datasets. It uses the AI_FUNCTION_EVALUATION experiment type to establish consistent comparison baselines via SQL or the Cortex AI Function Studio.
Use cases
Imagine you have a sentiment classification model in production and want to test new prompt instructions safely:
- Establish a measurable quality baseline before moving an AI function to production.
- Compare different prompts, models, and implementations using the same dataset and metric.
- Evaluate different output types using rule-based metrics,
llm_judge, or custom UDFs. - Measure stability and variance in nondeterministic outputs by repeating runs.
How to use
Create the experiment defining the specification inside a YAML document and then execute it:
CREATE OR REPLACE EXPERIMENT my_db.my_schema.sentiment_eval
TYPE = 'AI_FUNCTION_EVALUATION'
FROM SPECIFICATION $$
query_text: "AI_COMPLETE('claude-sonnet-4-5',
'Reply with exactly one word - POSITIVE, NEGATIVE, or NEUTRAL - '
|| 'for the sentiment of: ' || review)"
metrics:
- name: exact_match
dataset:
name: my_db.my_schema.reviews_labeled
version: v1
ground_truth: expected_sentiment
$$;
EXECUTE EXPERIMENT my_db.my_schema.sentiment_eval;
What happens in this code:
- Creates an experiment object named
sentiment_evalof typeAI_FUNCTION_EVALUATIONin the specified database and schema. - Defines the query under test using the AI function and corresponding model.
- Sets the evaluation metric to
exact_matchagainst the ground truth column (expected_sentiment) of the dataset version. - Triggers asynchronous execution of the experiment using serverless compute.
Limitations and requirements
- Public Preview feature, available to all accounts.
- The dataset must be a Snowflake dataset (
SNOWFLAKE.ML.DATASET) containing at most 1,000 rows (50–200 recommended). - Exactly one metric is allowed per evaluation.
- The
num_eval_runsparameter accepts integer values from 1 to 20. - Requires database role
SNOWFLAKE.CORTEX_USER(orSNOWFLAKE.AI_FUNCTIONS_USER) and usage privileges on the dataset and creation schema.
- cortex ai
- ai evaluation
- machine learning
- llm judge
September 21, 2026: Cortex AI Function Evaluation for measuring quality (Public Preview)
Resumo e explicação gerados por IA a partir da release note oficial. Em caso de dúvida, a documentação oficial da plataforma prevalece.
Relacionadas
- SnowflakeGA
Geração de documentos em PDF, Word e PowerPoint no Snowflake CoWork
O Snowflake CoWork agora gera arquivos PDF, Word, PowerPoint e HTML diretamente de suas análises usando a ferramenta de execução de código do Cortex Agent.
snowflake cowork · cortex agent - SnowflakePublic Preview
Cortex Agent SDK para Python e TypeScript no Snowflake
O Cortex Agent SDK permite criar aplicações que utilizam Cortex Agents e Cortex Code em Python e TypeScript.
cortex agents · python - SnowflakeAtualização
Mensagens de erro mais detalhadas na classificação de dados sensíveis
A view DATA_CLASSIFICATION_LATEST agora traz mensagens de erro específicas e códigos do Snowflake para falhas na classificação.
data governance · trust center