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

# Snowpark Container Prompt

export const ComponentMetadata = ({warehouses, unsupportedWarehouses = [], componentType, connectionInputs, connectionOutputs}) => {
  const allWarehouses = [...warehouses.map(w => ({
    name: w,
    supported: true
  })), ...unsupportedWarehouses.map(w => ({
    name: w,
    supported: false
  }))];
  return <div style={{
    background: 'var(--colors-background-light, #f9fafb)',
    border: '1px solid var(--colors-border-default, #e5e7eb)',
    borderRadius: '12px',
    padding: '20px 28px',
    marginBottom: '28px',
    boxShadow: '0 1px 4px rgba(0,0,0,0.10)'
  }}>
      <table style={{
    width: '100%',
    borderCollapse: 'collapse'
  }}>
        <tbody>
          <tr>
            <td style={{
    fontWeight: '600',
    paddingRight: '32px',
    paddingBottom: '14px',
    whiteSpace: 'nowrap',
    verticalAlign: 'middle',
    width: '180px'
  }}>Project Availability</td>
            <td style={{
    paddingBottom: '14px',
    verticalAlign: 'middle'
  }}>
              <div style={{
    display: 'flex',
    flexWrap: 'wrap',
    gap: '8px'
  }}>
                {allWarehouses.map((w, i) => <span key={i} style={{
    background: w.supported ? '#dcfce7' : '#fee2e2',
    color: w.supported ? '#15803d' : '#b91c1c',
    border: `1px solid ${w.supported ? '#bbf7d0' : '#fca5a5'}`,
    borderRadius: '9999px',
    padding: '3px 12px',
    fontSize: '0.85rem',
    fontWeight: '500',
    whiteSpace: 'nowrap'
  }}>
                    {w.name} {w.supported ? '✅' : '❌'}
                  </span>)}
              </div>
            </td>
          </tr>
          <tr>
            <td style={{
    fontWeight: '600',
    paddingRight: '32px',
    paddingBottom: '14px',
    whiteSpace: 'nowrap',
    verticalAlign: 'middle'
  }}>Component Type</td>
            <td style={{
    paddingBottom: '14px',
    verticalAlign: 'middle'
  }}>{componentType}</td>
          </tr>
          <tr>
            <td style={{
    fontWeight: '600',
    paddingRight: '32px',
    paddingBottom: '14px',
    whiteSpace: 'nowrap',
    verticalAlign: 'middle'
  }}>Connection Inputs</td>
            <td style={{
    paddingBottom: '14px',
    verticalAlign: 'middle'
  }}>{connectionInputs}</td>
          </tr>
          <tr>
            <td style={{
    fontWeight: '600',
    paddingRight: '32px',
    whiteSpace: 'nowrap',
    verticalAlign: 'middle'
  }}>Connection Outputs</td>
            <td style={{
    verticalAlign: 'middle'
  }}>{connectionOutputs}</td>
          </tr>
        </tbody>
      </table>
    </div>;
};

<Info>
  Production use of this feature is available for specific editions only. [Contact our sales team](https://www.matillion.com/contact) for more information.
</Info>

<Badge color="green" shape="pill" stroke size="lg">Public preview</Badge>

<ComponentMetadata warehouses={["Snowflake"]} unsupportedWarehouses={["Databricks", "Amazon Redshift", "BigQuery"]} componentType="Orchestration" connectionInputs="One" connectionOutputs="Unlimited" />

Snowpark Container Prompt is an orchestration component that lets you host your large language models within your [Snowpark Container Services](https://docs.snowflake.com/en/developer-guide/snowpark-container-services/overview#).

This topic presumes you have a strong knowledge of Snowpark Container Services and have already set up your Snowpark container. To learn more about creating an app, read our guide [How to create a Snowpark Container Services application](/docs/guides/snowpark-container-app-how-to).

Matillion sends your data to your Snowflake warehouse as a [user-defined function (UDF)](https://docs.snowflake.com/en/developer-guide/udf/udf-overview). A unique ID is assigned to the UDF sent to Snowflake Container Services. Matillion does not retain this ID once your data has been sent to Snowflake Container Services. Your application that is running in your Snowpark container will receive the UDF data as a JSON payload in the format of an array of arrays where each sub-array represents a row of data:

```json theme={null}
{
    "data": [
                [0, "System Prompt", "User Prompt", {"Input Column Name": "Input Column Value"}, {"metadata key": "metadata value"}]
    ]
}
```

Your app should be set up to receive the data in this format.

You may wish to read the following Snowflake documentation before getting started with this component.

* Read [Available regions](https://docs.snowflake.com/en/developer-guide/snowpark-container-services/overview#available-regions) to check whether Snowpark Container Services is available in your preferred region.
* Read [Service Specification Reference](https://docs.snowflake.com/en/developer-guide/snowpark-container-services/specification-reference) for detailed information about the Snowpark Container Services specification.

***

## Properties

<ResponseField name="Name" type="string" required>
  A human-readable name for the component.
</ResponseField>

{/* <!-- param-start:[spcs.database] | warehouses: [snowflake] --> */}

<ResponseField name="Database" type="drop-down" required>
  The Snowflake database. The special value `[Environment Default]` uses the database defined in the environment. Read [Databases, Tables and Views - Overview](https://docs.snowflake.com/en/guides-overview-db) to learn more.
</ResponseField>

{/* <!-- param-start:[spcs.schema] | warehouses: [snowflake] --> */}

<ResponseField name="Schema" type="drop-down" required>
  The Snowflake schema. The special value `[Environment Default]` uses the schema defined in the environment. Read [Database, Schema, and Share DDL](https://docs.snowflake.com/en/sql-reference/ddl-database.html) to learn more.
</ResponseField>

{/* <!-- param-start:[spcs.service] | warehouses: [snowflake] --> */}

<ResponseField name="Service" type="drop-down" required>
  Select your Snowpark Container Services service. The services available in this list will depend on the selected database and schema.
</ResponseField>

{/* <!-- param-start:[spcs.endpointName] | warehouses: [snowflake] --> */}

<ResponseField name="Endpoint Name" type="drop-down" required>
  Select the endpoint name representing the TCP network port that your application exposes.
</ResponseField>

{/* <!-- param-start:[spcs.endpointPath] | warehouses: [snowflake] --> */}

<ResponseField name="Endpoint Path" type="string" required>
  The path to your selected endpoint.
</ResponseField>

{/* <!-- param-start:[spcs.metadata] | warehouses: [snowflake] --> */}

<ResponseField name="Metadata" type="column editor">
  Optionally supply key:value [metadata](https://docs.snowflake.com/en/sql-reference/metadata) pairs such as `top_p`, `n`, `max_tokens`, and so on to be sent to the large language model.

  Ensure that no personal data, sensitive data, export-controlled data, or other regulated data is entered as metadata in the specification file.
</ResponseField>

{/* <!-- param-start:[source.snowflake.database] | warehouses: [snowflake] --> */}

<ResponseField name="Database" type="drop-down" required>
  The Snowflake *source* database. The special value `[Environment Default]` uses the database defined in the environment. Read [Databases, Tables and Views - Overview](https://docs.snowflake.com/en/guides-overview-db) to learn more.
</ResponseField>

{/* <!-- param-start:[source.snowflake.schema] | warehouses: [snowflake] --> */}

<ResponseField name="Schema" type="drop-down" required>
  The Snowflake *source* schema. The special value `[Environment Default]` uses the schema defined in the environment. Read [Database, Schema, and Share DDL](https://docs.snowflake.com/en/sql-reference/ddl-database.html) to learn more.
</ResponseField>

{/* <!-- param-start:[source.snowflake.table] | warehouses: [snowflake] --> */}

<ResponseField name="Table" type="drop-down" required>
  An existing Snowflake table to use as the input.
</ResponseField>

{/* <!-- param-start:[source.snowflake.keyColumn] | warehouses: [snowflake] --> */}

<ResponseField name="Key Column" type="drop-down" required>
  Set a column as the primary key. Join the results back to the input table.
</ResponseField>

{/* <!-- param-start:[source.snowflake.limit] | warehouses: [snowflake] --> */}

<ResponseField name="Limit" type="integer">
  Set a limit for the numbers of rows from the table to load. The default is 1000.
</ResponseField>

{/* <!-- param-start:[promptContext.userContext] | warehouses: [snowflake] --> */}

<ResponseField name="User Context" type="text editor">
  Provide your prompt. When **Output Format** is TEXT, this property is where you must specify all of the questions that you wish the LLM to provide answers to.

  Prompts should define the following information:

  * A persona. Who or what should the model impersonate when contextualizing their generative responses?
  * A context. Contextualize the situation for the model to enhance its responses.
  * A tone. What kind of language do you want the model to use?

  Providing an example output may improve performance.
</ResponseField>

{/* <!-- param-start:[promptContext.inputs] | warehouses: [snowflake] --> */}

<ResponseField name="Inputs" type="column editor" required>
  Select the source columns to feed as input to the prompt component.

  * **Column Name:** A column from the input table.
  * **Descriptive Name:** An alternate descriptive name to better contextualize the column. Recommended if your column names are low-context.
</ResponseField>

{/* <!-- param-start:[promptContext.outputFormat] | warehouses: [snowflake] --> */}

<ResponseField name="Output Format" type="drop-down" required>
  Choose TEXT or JSON. Choosing JSON will activate an additional property, **Outputs**.
</ResponseField>

{/* <!-- param-start:[promptContext.outputs] | warehouses: [snowflake] --> */}

<ResponseField name="Outputs" type="column editor" required>
  JSON only.

  Define the output columns the prompt component will generate.

  * **Output:** Key of a `key:value` JSON pair. For example, an output might be "review\_score".
  * **Context:** Text that defines the output you expect the model to provide—that is, some task for the model to perform. For example, "Give a score between 0 and 10 on the level of satisfaction you feel in the user's review where 0 is completely dissatisfied and 10 is extremely satisfied." You may wish to use this parameter to configure the tone of the model (where applicable).
</ResponseField>

{/* <!-- param-start:[destination.snowflake.database] | warehouses: [snowflake] --> */}

<ResponseField name="Database" type="drop-down" required>
  The Snowflake *destination* database. The special value `[Environment Default]` uses the database defined in the environment. Read [Databases, Tables and Views - Overview](https://docs.snowflake.com/en/guides-overview-db) to learn more.
</ResponseField>

{/* <!-- param-start:[destination.snowflake.schema] | warehouses: [snowflake] --> */}

<ResponseField name="Schema" type="drop-down" required>
  The Snowflake *destination* schema. The special value `[Environment Default]` uses the schema defined in the environment. Read [Database, Schema, and Share DDL](https://docs.snowflake.com/en/sql-reference/ddl-database.html) to learn more.
</ResponseField>

{/* <!-- param-start:[destination.snowflake.table] | warehouses: [snowflake] --> */}

<ResponseField name="Table" type="string" required>
  The new Snowflake table to load your prompt output into. Will create a new table if one does not exist. Otherwise, will replace any existing table of the same name.
</ResponseField>

{/* <!-- param-start:[destination.snowflake.createTableOptions] | warehouses: [snowflake] --> */}

<ResponseField name="Create Table Options" type="drop-down" required>
  * **Replace if Table Exists:** The pipeline will run despite the table already existing. The table will be recreated.
  * **Fail if Table Exists:** If the table already exists, the pipeline will fail to run.
  * **Append:** If the table already exists, any new rows (records) will be added to the table without modifying or deleting existing rows. If the table does *not* exist, it is created and any new rows are inserted.

  **Snowflake only:**

  This component uses the **CREATE OR REPLACE** clause. When using the **REPLACE** clause, it also applies the **COPY GRANTS** clause. When you clone or create a new object (such as a table, view, schema, or database) from an existing one, the new object doesn't automatically inherit the original's grants (privileges). However, with the **COPY GRANTS** clause, you can seamlessly transfer object-level privileges from the source object to the new one. This helps maintain consistent access control and simplifies permission management when cloning or recreating objects. For more information, read [Snowflake COPY GRANTS](https://docs.snowflake.com/en/sql-reference/sql/create-table#label-create-table-copy-grants).
</ResponseField>

{/* <!-- param-start:[ragConfig.isRagEnabled] | warehouses: [snowflake] --> */}

<ResponseField name="Enable RAG" type="boolean" required>
  Click **Yes** to enable Retrieval-Augmented Generation (RAG). Using RAG optimizes an LLM output by invoking an authoritative knowledge base outside of the LLM's initial training data sources. By using RAG, you can extend an LLM's capabilities to specific domains, such as your organization's documentation, without needing to retrain the model.

  Defaults to No.
</ResponseField>

{/* <!-- param-start:[ragConfig.ragPretext] | warehouses: [snowflake] --> */}

<ResponseField name="Pretext" type="text editor" required>
  Add text to your LLM prompt before the RAG data is listed, thus instructing the LLM what to do with the RAG data. For example, you might wish to use RAG to search relevant documentation snippets to answer a question.

  Example:

  "Use any of the following documentation snippets in your response, if relevant:"
</ResponseField>

{/* <!-- param-start:[ragConfig.inputs.searchColumn] | warehouses: [snowflake] --> */}

<ResponseField name="Search Column" type="drop-down" required>
  Choose a column in the source table that contains a search term for the vector database. The value is then taken from that column and a vector search is performed. For example, a column value might be a user question such as "How do I log in?". A search is then performed on the vector database using the value string, which will return N number of relevant data. N is defined by the Top K parameter, further down.

  If your vector database contained vectors created from chunks of text documentation, in this scenario the RAG data returned may include the chunk "to log in, click on the key button in the top right and enter your username and password". This data is then inserted into the llm prompt to help provide relevant context.
</ResponseField>

{/* <!-- param-start:[ragConfig.embeddingGenerator.embeddingProviderType] | warehouses: [snowflake] --> */}

<ResponseField name="Embedding Provider" type="drop-down" required>
  The embedding provider is the API service used to convert the search term into a vector. Choose either OpenAI or Amazon Bedrock. The embedding provider receives a search term (e.g. "How do I log in?") and returns a vector.

  Choose your provider:

  <Tabs>
    <Tab title="OpenAI">
      <ResponseField name="OpenAI API Key" type="drop-down" required>
        Use the drop-down menu to select the corresponding secret definition that denotes the value of your OpenAI API key.

        Read [Secrets and secret definitions](/docs/guides/secrets-and-secret-definitions) to learn how to create a new secret definition.

        To create a new OpenAI API key:

        1. Log in to [OpenAI](https://platform.openai.com/).
        2. Click your avatar in the top-right of the UI.
        3. Click **View API keys**.
        4. Click **+ Create new secret key**.
        5. Give a name for your new secret key and click **Create secret key**.
        6. Copy your new secret key and save it. Then click **Done**.
      </ResponseField>

      {/* <!-- param-start:[ragConfig.embeddingGenerator.openAI.embeddingModel] | warehouses: [snowflake] --> */}

      <ResponseField name="Embedding Model" type="drop-down" required>
        Select an [embedding model](https://platform.openai.com/docs/guides/embeddings).

        Currently supports:

        * text-embedding-ada-002
        * text-embedding-3-small
        * text-embedding-3-large
      </ResponseField>
    </Tab>

    <Tab title="Amazon Bedrock">
      <ResponseField name="Embedding AWS Region" type="drop-down" required>
        Select your [AWS region](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.RegionsAndAvailabilityZones.html#Concepts.RegionsAndAvailabilityZones.Regions).
      </ResponseField>

      {/* <!-- param-start:[ragConfig.embeddingGenerator.aws.model] | warehouses: [snowflake] --> */}

      <ResponseField name="Embedding Model" type="drop-down" required>
        Select an embedding model.

        Currently supports:

        * [Titan Embeddings G1 - Text](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-titan-embed-text.html)
      </ResponseField>
    </Tab>
  </Tabs>
</ResponseField>

{/* <!-- param-start:[ragConfig.vectorDatabase] | warehouses: [snowflake] --> */}

<ResponseField name="Vector Database" type="drop-down" required>
  Select a vector database to use.

  Currently supports [Pinecone](https://www.pinecone.io/learn/vector-database/) and Postgres.

  <Tabs>
    <Tab title="Pinecone">
      <ResponseField name="Pinecone API Key" type="drop-down" required>
        Use the drop-down menu to select the corresponding secret definition that denotes the value of your Pinecone API key.

        Read [Secrets and secret definitions](/docs/guides/secrets-and-secret-definitions) to learn how to create a new secret definition.
      </ResponseField>

      {/* <!-- param-start:[ragConfig.pinecone.pineconeIndex] | warehouses: [snowflake] --> */}

      <ResponseField name="Pinecone Index" type="string" required>
        The name of the Pinecone vector search index to connect to. To retrieve an index name:

        1. Log in to [Pinecone](https://app.pinecone.io/).
        2. Click **PROJECTS** in the left sidebar.
        3. Click a project tile. This action will open the list of vector search indexes in your project.
      </ResponseField>

      {/* <!-- param-start:[ragConfig.pinecone.pineconeNamespace] | warehouses: [snowflake] --> */}

      <ResponseField name="Pinecone Namespace" type="string">
        The name of the Pinecone namespace. Pinecone lets you partition records in an index into [namespaces](https://docs.pinecone.io/docs/namespaces). To retrieve a namespace name:

        1. Log in to [Pinecone](https://app.pinecone.io/).
        2. Click **PROJECTS** in the left sidebar.
        3. Click a project tile. This action will open the list of vector search indexes in your project.
        4. Click on your vector search index tile.
        5. Click the **NAMESPACES** tab. Your namespaces will be listed.
      </ResponseField>

      {/* <!-- param-start:[ragConfig.pinecone.topK] | warehouses: [snowflake] --> */}

      <ResponseField name="Top K" type="integer" required>
        The number of results to return from the vector database query.

        Between 1-100.

        Default is 3.
      </ResponseField>

      {/* <!-- param-start:[ragConfig.lookupSource.dataLookupStrategy] | warehouses: [snowflake] --> */}

      <ResponseField name="Data Lookup Strategy" type="drop-down" required>
        Select the data lookup strategy. Pinecone only stores the vector associated with text data, and a JSON metadata blob. While the text data *can* be stored in the metadata blob, size limitations can affect coverage—for example when a user has a larger blob of text to be converted to a vector.

        * **Raw data in metadata:** Choosing this option adds an additional property, Data Path, to provide the path to text data within the metadata JSON blob.
        * **Table details in metadata:** Database, schema, and table information is used in the metadata to look up the text data in your warehouse table.
      </ResponseField>

      {/* <!-- param-start:[ragConfig.lookupSource.dataFromMetadataConfig.dataPath] | warehouses: [snowflake] --> */}

      <ResponseField name="Data Path" type="string" required>
        Set the path to the data in the metadata JSON blob.

        Default is `data`.
      </ResponseField>
    </Tab>

    <Tab title="Postgres">
      <ResponseField name="Host" type="string" required>
        Your Postgres hostname.
      </ResponseField>

      {/* <!-- param-start:[ragConfig.postgres.port] | warehouses: [snowflake] --> */}

      <ResponseField name="Port" type="string" required>
        The TCP port number the Postgres server listens on. The default is `5432`.
      </ResponseField>

      {/* <!-- param-start:[ragConfig.postgres.database] | warehouses: [snowflake] --> */}

      <ResponseField name="Database" type="string" required>
        The name of your Postgres database.
      </ResponseField>

      {/* <!-- param-start:[ragConfig.postgres.username] | warehouses: [snowflake] --> */}

      <ResponseField name="Username" type="string">
        Your Postgres username.
      </ResponseField>

      {/* <!-- param-start:[ragConfig.postgres.password] | warehouses: [snowflake] --> */}

      <ResponseField name="Password" type="drop-down">
        Use the drop-down menu to select the corresponding secret definition that denotes the value of your Postgres password.

        Read [Secrets and secret definitions](/docs/guides/secrets-and-secret-definitions) to learn how to create a new secret definition.
      </ResponseField>

      {/* <!-- param-start:[ragConfig.postgres.schema] | warehouses: [snowflake] --> */}

      <ResponseField name="Schema" type="drop-down" required>
        The Postgres schema. The available schemas are determined by the Postgres database you have provided.
      </ResponseField>

      {/* <!-- param-start:[ragConfig.postgres.table] | warehouses: [snowflake] --> */}

      <ResponseField name="Table" type="drop-down" required>
        The table to load data from. The available tables are determined by the Postgres schema you have selected.
      </ResponseField>

      {/* <!-- param-start:[ragConfig.postgres.keyColumnName] | warehouses: [snowflake] --> */}

      <ResponseField name="Key Column Name" type="drop-down" required>
        The column in your table to use as the key column.
      </ResponseField>

      {/* <!-- param-start:[ragConfig.postgres.textColumnName] | warehouses: [snowflake] --> */}

      <ResponseField name="Text Column Name" type="drop-down" required>
        The column in your table with your original text data.
      </ResponseField>

      {/* <!-- param-start:[ragConfig.postgres.embeddingColumnName] | warehouses: [snowflake] --> */}

      <ResponseField name="Embedding Column Name" type="drop-down" required>
        The column in your table used to store your embeddings.
      </ResponseField>

      {/* <!-- param-start:[ragConfig.postgres.similarityFunction] | warehouses: [snowflake] --> */}

      <ResponseField name="Similarity Function" type="drop-down" required>
        Select which similarity function (distance metrics) to use.
      </ResponseField>

      {/* <!-- param-start:[ragConfig.postgres.topK] | warehouses: [snowflake] --> */}

      <ResponseField name="Top K" type="integer" required>
        The number of results to return from the vector database query.

        Between 1-100.

        Default is 3.
      </ResponseField>

      {/* <!-- param-start:[ragConfig.postgres.connectionOptions] | warehouses: [snowflake] --> */}

      <ResponseField name="Connection Options" type="column editor">
        * **Parameter:** A JDBC [Postgres parameter](https://jdbc.postgresql.org/documentation/use/#connection-parameters) supported by the database driver.
        * **Value:** A value for the given parameter.
      </ResponseField>
    </Tab>
  </Tabs>
</ResponseField>
