MetricSign
EN|NLRequest Access
Medium severityexecution

Power BI Refresh Error:
LLM_FUNCTION_FAILED

What does this error mean?

A Snowflake Cortex LLM function such as COMPLETE(), SUMMARIZE(), or TRANSLATE() failed to return a result due to a model-side error or an invalid input.

Common causes

  • 1The input prompt or text exceeds the model's maximum context window
  • 2The selected model is temporarily unavailable in the current Snowflake region
  • 3The input contains characters or encoding that the model cannot process
  • 4The function was called with an unsupported model name

How to fix it

  1. 1Step 1: Check the error message for the specific reason — context length exceeded, model unavailable, or invalid argument.
  2. 2Step 2: If context length exceeded, truncate or chunk the input text: use LEFT(text, 4000) or split into batches.
  3. 3Step 3: Verify the model name is supported in your region: SELECT SNOWFLAKE.CORTEX.COMPLETE('supported-model', 'test').
  4. 4Step 4: Add a TRY_CAST or IFF wrapper to handle failures gracefully in batch queries.
  5. 5Step 5: Check Snowflake status page for regional Cortex AI service disruptions.

Frequently asked questions

Does Snowflake COMPLETE() support all LLM models in all regions?

No — model availability varies by Snowflake region and cloud provider. Run SHOW FUNCTIONS LIKE '%COMPLETE%' or check the Snowflake Cortex AI documentation for the current supported model list per region.

How do I handle Cortex failures gracefully in a batch SQL query?

Snowflake does not have a TRY_COMPLETE() variant, but you can use a JavaScript UDF wrapper with error handling, or post-filter NULL results from failed rows.

Other execution errors