> ## Documentation Index
> Fetch the complete documentation index at: https://docs.elementum.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Snowflake Cortex Setup

> Configure Snowflake Cortex as your AI provider for language model and embedding services

## Overview

Snowflake Cortex brings AI capabilities directly to your data warehouse, allowing you to run LLMs and embedding models on your data without moving it outside your secure environment. This guide walks you through setting up Snowflake Cortex as an AI Provider in Elementum.

<Warning>
  Snowflake Cortex AI features are only available when your Snowflake CloudLink uses **key-pair authentication**. Password authentication cannot access these capabilities. If you haven't connected Snowflake yet, complete [Connect Snowflake to Elementum](/administration/connect-snowflake-to-elementum) first—this guide assumes that's done. For background on CloudLink itself, see the [CloudLink Overview](/administration/cloudlink-overview).
</Warning>

## Step 1: Verify CloudLink prerequisites

Before setting up Snowflake Cortex, confirm your Snowflake CloudLink is in place:

1. Go to **Organization Settings** → **CloudLinks** and verify your Snowflake connection is active.
2. Confirm the CloudLink uses **key-pair authentication**. If it doesn't, follow [Key rotation](/administration/connect-snowflake-to-elementum#key-rotation) on the Snowflake setup page to migrate.
3. Confirm the [Cortex AI grants](/administration/connect-snowflake-to-elementum#step-4-grant-permissions-and-set-the-network-policy) have been applied to the `ELEMENTUM` role.

### Snowflake Account Requirements

Your Snowflake account must meet the following requirements for Cortex AI access:

* **Snowflake Edition**: Enterprise or higher
* **Cortex Features**: Enabled and available in your region (most AWS, Azure, and GCP regions are supported)
* **Permissions**: USAGE privileges on Cortex functions for your service account
* **Billing**: Cortex usage is billed through your Snowflake account

## Step 2: Configure Snowflake Cortex in Elementum

When you have a CloudLink connection with key-pair authentication, Elementum automatically discovers available Snowflake Cortex capabilities.

### Add the Provider

1. In Elementum, go to **Organization Settings** and select the **Providers** tab
2. Click **+ Provider** and select **Snowflake** — you'll see your existing CloudLink connections listed
3. Configure the provider settings:

<Tabs>
  <Tab title="Basic Configuration">
    **Provider Name**: Enter a descriptive name (e.g., "Snowflake Cortex AI")

    **CloudLink**: Select your key-pair authenticated CloudLink

    **Service Account Credentials**: Auto-populated from your CloudLink
  </Tab>

  <Tab title="Manual Configuration">
    If automatic discovery doesn't populate your settings, you may need to configure manually:

    **Provider Name**: Descriptive name for your Snowflake provider

    **Location**: Your Snowflake region and account details

    **Project ID**: Your Snowflake account identifier

    **CloudLink**: Select the appropriate CloudLink connection
  </Tab>
</Tabs>

4. Click **Save** to create the provider. Elementum will automatically validate your connection and discover available models — look for a green checkmark indicating a successful connection.

## Step 3: Create your first AI service

With your Snowflake Cortex provider configured, create an AI Service that uses a Cortex model. See [AI Services](/ai-agents/ai-services) for the full walkthrough, including LLM and embedding service configuration, assignment, and failover.

For a side-by-side comparison of Cortex LLMs and embedding models—including recommendations for daily tasks vs. complex reasoning and embedding quality tiers—see [AI Models](/ai-agents/ai-models).

<Info>
  **Embeddings for AI Search**: Snowflake Cortex is the only provider that supports embedding services in Elementum. If you plan to use [AI Search](/ai-agents/ai-search), create an embedding service from this provider.
</Info>

<Info>
  **Model availability**: Available models depend on your Snowflake account tier, region, and current Cortex offerings. Model selection may vary over time.
</Info>

## Usage Guidelines

### Cost Management

Snowflake Cortex usage is billed through your Snowflake account. To manage costs:

<Tabs>
  <Tab title="Monitor Usage">
    * Monitor Cortex function usage in the Snowflake console
    * Track warehouse usage for AI workloads
    * Set up Snowflake resource monitors and billing alerts
    * Review token consumption regularly
  </Tab>

  <Tab title="Optimize Usage">
    * Use appropriate models for each task (Claude 3.7 Sonnet for routine work, Opus 4 only when necessary)
    * Process multiple requests in batches when possible
    * Cache frequent AI results to avoid redundant calls
    * Scale warehouses appropriately — larger models may need bigger warehouses
  </Tab>
</Tabs>

### Best Practices

<Accordion title="Model Selection">
  * Use **Claude 3.7 Sonnet** for most daily automation and customer support tasks
  * Use **Claude Sonnet 4** for advanced reasoning and premium applications
  * Reserve **Claude Opus 4** for the most complex tasks requiring maximum intelligence
  * Use **Mistral Large 2** for European regulatory compliance and multilingual tasks
</Accordion>

<Accordion title="Prompt Engineering">
  * Be specific and clear in your prompts
  * Use system messages for consistent behavior
  * Provide examples for better results
  * Structure complex problems step-by-step for reasoning models
</Accordion>

<Accordion title="Performance Optimization">
  * Scale warehouses based on model complexity and concurrent usage
  * Enable auto-scaling for variable workloads
  * Choose models appropriate for the task complexity — avoid over-provisioning
  * Implement result caching for repeated queries
</Accordion>

## Troubleshooting

<Accordion title="Cortex Functions Not Available">
  **Symptoms:** Cannot access Snowflake Cortex AI functions

  **Common Causes:**

  * Using password authentication instead of key-pair
  * Insufficient permissions on Cortex functions
  * Account doesn't have Cortex access

  **Solutions:**

  1. Verify key-pair authentication is configured on your CloudLink
  2. Check USAGE privileges on Cortex functions
  3. Contact Snowflake support for account access
  4. Verify account edition (Enterprise or higher) and region support
</Accordion>

<Accordion title="Model Discovery Issues">
  **Symptoms:** Expected models don't appear in service creation

  **Common Causes:**

  * Regional model availability
  * Account tier limitations
  * CloudLink connection issues

  **Solutions:**

  1. Verify CloudLink connection is active
  2. Check regional model availability in Snowflake documentation
  3. Review account tier and permissions
  4. Refresh provider configuration
</Accordion>

<Accordion title="Performance Issues">
  **Symptoms:** Slow AI response times or timeouts

  **Common Causes:**

  * Undersized warehouse for AI workloads
  * Inefficient query patterns
  * Large data volumes

  **Solutions:**

  1. Scale up warehouse size
  2. Optimize data queries
  3. Implement result caching
  4. Consider dedicated warehouses for AI workloads
</Accordion>

## Security Considerations

<Tabs>
  <Tab title="Data Residency">
    Snowflake Cortex runs AI directly on your data warehouse, which provides key security advantages:

    * Data never leaves your Snowflake environment
    * Maintains existing data governance and compliance policies
    * Leverages Snowflake's built-in security model and encryption
    * All access is auditable through Snowflake's audit logging
  </Tab>

  <Tab title="Credential Management">
    * CloudLink manages credential encryption and secure storage
    * Rotate key-pair credentials according to your security policy
    * Use dedicated service accounts with minimal permissions
    * Monitor service account usage in Snowflake for anomalies
  </Tab>
</Tabs>

## Next Steps

With Snowflake Cortex configured as your AI Provider:

<CardGroup cols={2}>
  <Card title="Create AI Services" icon="cog" href="/ai-agents/ai-services">
    Set up specific LLM and embedding services using Cortex models
  </Card>

  <Card title="Enable AI Search" icon="search" href="/ai-agents/ai-search">
    Use Snowflake embeddings for intelligent search on your data
  </Card>

  <Card title="Build Agents" icon="robot" href="/ai-agents/agents-experience">
    Create agents that can directly access your Snowflake data
  </Card>

  <Card title="Connect Cortex Agents" icon="snowflake" href="/ai-agents/snowflake-cortex-agents-setup">
    Integrate Snowflake Cortex Agents into your Apps
  </Card>
</CardGroup>
