June 17, 2024 — New LLM helper functions - TRY_COMPLETE and COUNT_TOKENS

With this release, we are pleased to announce the availability of two Cortex LLM helper functions, TRY_COMPLETE and COUNT_TOKENS. These functions are purpose-built and managed functions that help to reduce cases of query failures when the number of input tokens exceed a model limit.

For more information, see Large Language Model (LLM) Functions (Snowflake Cortex).

New SQL function

The following functions are now generally available with this release:

Function Category

New Function


LLM Function


Tries to run the COMPLETE function but returns NULL instead of an error code if unable to run.

LLM Function


Counts the tokens in a given input text based on the model or function specified.