SnowPro Specialty: Gen AI Question 224
Single answerCortex LLM REST APIA team is building an external customer-support application that must generate summaries of support cases by calling Snowflake-hosted LLMs from outside Snowflake. The security team requires that the application use a Snowflake-managed endpoint, authenticate with a Snowflake token, and avoid exposing direct database connections from the app tier. Which approach best meets these requirements when using the Cortex LLM REST API?
- A
Call the Cortex LLM REST API endpoint with a valid Snowflake authentication token, and send the prompt and model in the request body from the external application.
- B
Open a JDBC connection from the application to Snowflake and invoke the REST API through SQL statements so the endpoint is never called directly.
- C
Deploy a separate model-serving container in Snowpark Container Services because Cortex LLM REST API requires customer-managed model hosting.
- D
Use external functions to call the LLM from the application because the Cortex LLM REST API is only available for internal Snowflake services.
Show answer and explanation
Correct answer: A
Explanation
The key requirement is that an external application needs to call Snowflake-hosted LLM functionality without using a direct database connection. The Cortex LLM REST API exists for this purpose: an application can make HTTPS requests to a Snowflake-managed endpoint and authenticate using Snowflake credentials or tokens. This is the most direct and secure fit for the scenario.
The distractors reflect common misconceptions. Some practitioners assume all Snowflake interactions from applications must go through JDBC/ODBC and SQL, but the REST API is specifically intended to support programmatic access patterns outside SQL sessions. Others confuse managed Cortex model access with customer-hosted inference patterns such as Snowpark Container Services. Finally, external functions are often misunderstood as a general-purpose integration mechanism for any external app, when in fact they are for Snowflake-initiated calls to external services, not the other way around.
Best practice is to use the Snowflake-managed Cortex LLM REST API endpoint with appropriate Snowflake authentication and authorization controls, rather than introducing unnecessary database connectivity or custom model hosting. Candidates should also recognize the distinction between Snowflake SQL features, container hosting, and externally consumable REST interfaces in the Cortex ecosystem.
- A. Correct.
Correct. The Cortex LLM REST API is designed for external applications to invoke Snowflake-hosted LLM capabilities over HTTPS using Snowflake authentication. This aligns with the requirement to use a Snowflake-managed endpoint, authenticate with a Snowflake token, and avoid exposing a direct database connection from the application tier.
- B. Incorrect.
Incorrect. JDBC is a database connectivity approach, not the preferred mechanism for an external app that specifically needs to use the Cortex LLM REST API over a Snowflake-managed HTTPS endpoint. This option also contradicts the requirement to avoid exposing direct database connections from the app tier.
- C. Incorrect.
Incorrect. Snowpark Container Services can be used for custom containerized workloads, but it is not required to use the Cortex LLM REST API. Cortex provides managed LLM access; customers do not need to host the model themselves in order to call the REST API.
- D. Incorrect.
Incorrect. External functions are a Snowflake SQL feature for calling external services from within Snowflake. They are not required for an external application to call Cortex LLM REST API, and the claim that the REST API is only for internal Snowflake services is false.