site/docs/providers/snowflake.md
Snowflake Cortex is Snowflake's AI and ML platform that provides access to various LLM models through an OpenAI-compatible REST API. Cortex offers industry-leading LLMs including Claude, GPT, Mistral, and Llama models without requiring a dedicated warehouse.
orgname-accountname)SNOWFLAKE.CORTEX_USER database roleThe Snowflake Cortex provider uses this format:
snowflake:<model_name> - Connects to Snowflake Cortex using the specified model name# yaml-language-server: $schema=https://promptfoo.dev/config-schema.json
providers:
- id: snowflake:mistral-large2
config:
accountIdentifier: 'myorg-myaccount'
apiKey: 'your-bearer-token'
Set your Snowflake credentials as environment variables:
export SNOWFLAKE_ACCOUNT_IDENTIFIER="myorg-myaccount"
export SNOWFLAKE_API_KEY="your-bearer-token"
Then use the provider without specifying credentials:
providers:
- id: snowflake:mistral-large2
Snowflake Cortex supports OpenAI-compatible parameters:
providers:
- id: snowflake:mistral-large2
config:
accountIdentifier: 'myorg-myaccount'
apiKey: 'your-bearer-token'
temperature: 0.7
max_tokens: 1024
top_p: 0.9
Override the default base URL if needed:
providers:
- id: snowflake:claude-3-5-sonnet
config:
apiBaseUrl: 'https://custom.snowflakecomputing.com'
apiKey: 'your-bearer-token'
Snowflake Cortex supports:
Authentication is handled via Bearer tokens in the Authorization header. Snowflake Cortex supports multiple token types:
# yaml-language-server: $schema=https://promptfoo.dev/config-schema.json
description: 'Compare Snowflake Cortex models'
prompts:
- 'Explain {{topic}} in simple terms'
providers:
- id: snowflake:claude-3-5-sonnet
config:
temperature: 0.7
max_tokens: 1024
- id: snowflake:mistral-large2
config:
temperature: 0.7
max_tokens: 1024
- id: snowflake:llama-3.1-70b
config:
temperature: 0.7
max_tokens: 1024
tests:
- vars:
topic: quantum computing
assert:
- type: contains
value: quantum