1. Cortex-AI Overview
Snowflake Gen-AI/ML capabilities is empowered by “Cortex-AI”, this is a framework under which there are a lot of features which are available and each of them are being used for a specific use case around solving AI, Gen-AI and ML workloads. Pictorially the entire suit of Cortex-AI looks like below:

2. Cortex-AI features
Now, let us understand the Cortex-AI features and its capabilities on a high level.
- Cortex-LLM functions: Snowflake Cortex LLM function provides seamless access to top-tier large language models (LLMs) developed by leading researchers at companies such as Anthropic, Mistral, Reka AI, Meta, and Google. This includes Snowflake Arctic, an enterprise-grade open model created by Snowflake. Since these LLMs are fully hosted and managed within Snowflake, no setup is required. Your data remains securely within Snowflake, ensuring the performance, scalability, and governance you rely on.
- Cortex Analyst: Cortex Analyst is a fully managed Snowflake Cortex feature that enables applications to deliver accurate answers to business queries using structured data. With natural language support, users can obtain insights without writing SQL. Available via a REST API, it seamlessly integrates into any application. Henceforth with this feature taking form and shape business users would be able to write the SQLs on structured data with plain and simple English.
- Document AI: Document AI, a Snowflake AI feature, leverages Arctic-TILT, a proprietary large language model (LLM), to extract data from various document formats. It processes both text-heavy content and graphical elements like logos, handwritten signatures, and checkmarks. Designed for automated workflows, Document AI enables seamless pipeline creation for continuously processing specific document types, such as invoices or financial statements be it in form of PDF, word document, etc..
- Cortex Search: Cortex Search provides low-latency, high-quality fuzzy search across your Snowflake data, supporting diverse search experiences, including Retrieval Augmented Generation (RAG) applications powered by Large Language Models (LLMs).With a hybrid search engine that combines vector and keyword search, Cortex Search allows you to quickly set up text-based search capabilities in minutes—without the need for manual embedding, infrastructure management, search tuning, or index maintenance.
- Cortex Agents: Cortex Agents coordinate across structured and unstructured data sources to generate insights. They plan, execute tasks using specialized tools, and produce responses. Leveraging Cortex Analyst for structured data and Cortex Search for unstructured data, along with LLMs, Cortex Agents enable comprehensive data analysis. Cortex Search extracts insights from unstructured sources, while Cortex Analyst translates queries into SQL for structured data processing.
In this blog, we would primarily focus on Cortex-LLM functions which are fully hosted and managed by Snowflake.
3. Cortex LLM functions
Cortex LLM functions are available within Snowflake as SQL functions and also available in Python. Primarily these can be broadly categorized into the below set of functions.

All these Cortex-LLM functions are empowered by the usage of the Large Language models of various providers like Mistral, Meta, Anthropic, etc. Hence the usage of these models would drive the sizing and cost. The bigger the model size, the higher no, of tokens was used to train it and hence it is expected to be cost more. Below is the pictorial depiction on how the models and the categorization are done within the platform.

This is how the models have been used and its categories based on the use case, the same can be used and also improve the accuracy of the results.
Now, let us understand some of the key LLM functions and how they work within the platform.
A. COMPLETE:
Let us now see how the COMPLETE function works within the AI data cloud platform.

If we see this we can ask very simple questions and start getting answers by the usage of various LLM models. The above image shows how in each of the question a separate model is used and it can give the response accordingly.

The above is an example we use the Cortex-Complete via SQL and the same generates a response by answering the question.
B. SUMMARIZE (task specific functions):
The SUMMARIZE function generates a concise summary of the provided English text. It is useful for condensing large paragraphs into a one- or two-line summary, making it easier to extract key information. Here’s an example:

C. TRANSLATE (task specific functions):
Snowflake Cortex LLM TRANSLATE functions enable text translation between multiple supported languages. This function allows seamless conversion of text from one language to another using the following supported language codes:

Now, let us see an example as how it works and it can convert the various languages to the language of choice.

As we see when the above function is used, it can seamlessly take the prompt as an input, recognizes it and then convert it as an output and that too in English.
D. SENTIMENT (task specific functions):
This is a function that does a sentiment analysis based on the input provided and gives a score between -1 and 1. The value “-1” being negative and “+1” being positive and “0” being neutral.

If we see this function, what it did was based on the prompt that we gave, it derived the scoring and because it was an optimistic statement hence the response was near to 1.
E. COUNT_TOKENS (helper functions):
This function calculates the number of tokens in a given prompt for a large language model or a specified task-specific function. It does not support fine-tuned models. This function can be a very good asset when it comes to evaluating the cost, as it gives us the information about the tokens getting scanned OR used so that the model gives the output.

In this example we see how the MIXTRAL LLM model was used to assess the prompt based on the number of tokens that prompt has. Like-wise there are multiple models we can use to ensure we get the value of the tokens.
To summarize, we have seen how Cortex COMPLETE, TASK SPECIFIC functions and helper functions work within the platform. These are natively available within the platform so that various workloads can benefit from integrated AI capabilities. Expert Snowflake development solutions can further help in automating, scaling, and customizing these functions for industry-specific applications.
4. COST CONSIDERATIONS
Snowflake Cortex LLM functions offer a powerful way to extract insights from structured and unstructured data, but understanding their costs and usage limits is crucial. Compute costs are based on the number of tokens processed, where a token represents the smallest text unit, approximately four characters. The cost per million tokens varies depending on the specific LLM function and model used.
There are two important things which needs to be monitored. The first one is how do we track the AI Services cost. Now, this cost is a measure of all the AI services within the account which includes the Cortex-LLM functions. The key SQL which can be used are:
SELECT * FROM SNOWFLAKE.ACCOUNT_USAGE.METERING_DAILY_HISTORY
WHERE SERVICE_TYPE='AI_SERVICES';

Another important point is to have a way to track just the usage of the Cortex LLM functions. Over here, we can refer the object name i.e.,
SNOWFLAKE.ACCOUNT_USAGE.CORTEX_FUNCTIONS_USAGE_HISTORY, it is where we get the exact credits consumed by the usage of various model in the LLM functions.

If we want to establish a relationship between the objects of the consumption i.e.,
“SNOWFLAKE.ACCOUNT_USAGE.METERING_DAILY_HISTORY” and “SNOWFLAKE.ACCOUNT_USAGE.CORTEX_FUNCTIONS_USAGE_HISTORY”
then we can in most of the cases see the o/p of the below 2 queries matching:

5. Date Engineering use case:
There are so many possibilities within this AI data cloud which can be solved by these LLM functions over here we would be demonstrating how we can derive quick insights from an attribute with very minimum hassle. With the right use case identification and model tuning, guided by Snowflake consulting professionals, even complex tasks like deriving missing attributes can be streamlined with LLM functions.
Let us say we have a CUSTOMER table, which has all the attributes but that doesn’t have a key column which is “Gender”, and that needs to be derived based on the data which is available in the table. Now, this is important because if we know these attributes we can easily do the customer segmentation, do advanced analytics and even we can send customized benefits. Let us consider we have a table named “DEMO_CUSTOMER_LLM”, which has the data sets as mentioned below:

Now, if there is an ask to get the Gender names by looking up to the Salutation field and imagine if this table is having millions of records, then how do we solve this problem? This is exactly where we can use the Cortex LLM functions and get the “gender” value. Please see the below section on how it is being used to get the Gender value.

If we see over here, for most of the cases by looking up to the SALUTATION field, we got the gender values, the model even has given us the suggestions whenever there is a generic title that has been used. That is how we can get quick insights using the LLM functions. We can even use this syntax and try multiple models to get the similar output.
Cortex-LLM functions enhance data engineering by enabling AI-driven automation, natural language interactions, and intelligent search. While they simplify AI adoption in Snowflake, organizations must optimize token usage to control costs effectively. It simplifies data processing, enabling easy access to complex queries and insights, even for non-technical users. This enhances efficiency and productivity in data operations.
- in (infinity)
- -inf (negative infinity)
These values are case-insensitive and should be enclosed in single quotes. It’s important to note that Snowflake handles ‘NaN’ differently from the IEEE 754 standard, treating all ‘NaN’ values as equal and considering ‘NaN’ to be greater than any other FLOAT value.
Summary
As we have seen Snowflake supports variety of data types that makes this platform unique with respect to handling various forms and formats of the data sets these features apart from many others makes this platform very unique for managing and analyzing the data at scale. Snowflake’s data types as a set of keys on a keyring, each designed to unlock a specific door to solve a particular data challenge. Whether it’s numeric precision, text processing, or managing complex JSON structures, each key represents a unique data type tailored for the task. Just like selecting the right key ensures seamless access, choosing the right data type in Snowflake unlocks the full potential of your data efficiently and effectively.