LLM Complete
The LLM Complete processor generates a response to an English-language prompt based on the selected large language model (LLM). Use this processor when you want to customize the style, language, or randomness of the results.
The processor uses the Snowflake LLM Complete function to generate the response based on the processor configuration. Note, however, that the processor supports only a single prompt. It does not support conversations with multiple prompts and responses.
When you configure the LLM Complete processor, you select the large language model to use. You specify a prompt that you want to generate a response to. You can optionally enter a system prompt that provides additional information to guide the style or language of the response.
You can define advanced options, such as specifying permitted randomness of the response or enabling guardrails to omit unsafe responses.
For more information about the Snowflake LLM Complete function and other Snowflake LLM functions, see the Snowflake documentation.
Example
- Model:
llama3-70b
- System Prompt:
Answer in 2 or 3 words
- Prompt:
What does this recipe make? {Submission}
- Output Column:
Recipe
- Extract Message: Enabled
With the following incoming data:
Submission | |
---|---|
my@email.com | Cream the butter, oil, and sugar in the bowl of a stand mixer. Add the eggs one at a time, beating well after each addition. Then, add your vanilla and stir to combine. Combine your dry ingredients in a separate bowl, then add about ⅓ of the mixture into your bowl. Use a spatula to gently stir until just combined. Follow this with about ½ of your buttermilk, and stir again until just combined. Add ½ of the remaining dry ingredients stir, and then add the remainder of the buttermilk. Finish with the final portion of dry ingredients and use your spatula to make sure the batter is smooth. Pour into a prepared pan and bake at 350 degrees until golden brown. |
joe@email.com | This traditional eggs benedict sauce is called hollandaise sauce. The ingredients are butter, egg yolks, lime juice, heavy cream, and salt and pepper. This is a more traditional method for making hollandaise sauce. Some people prefer to make hollandaise sauce in the blender, which would work well for this recipe. To make hollandaise sauce, start by melting butter in a saucepan. Meanwhile, beat egg yolks in separate bowl and add lime juice, heavy cream, and salt and pepper. Once the butter has melted, you’re ready to temper the eggs by adding a small amount of the hot butter to the egg mixture. Stir it well and repeat this process, slowly adding one spoonful of hot butter to the egg mixture. We do this to avoid curdling the eggs. Finally, add the mixture back to the saucepan and cook it for a few more seconds. |
Submission | Recipe | |
---|---|---|
my@email.com | Cream the butter, oil, and sugar in the bowl of a stand mixer. Add the eggs one at a time, beating well after each addition. Then, add your vanilla and stir to combine. Combine your dry ingredients in a separate bowl, then add about ⅓ of the mixture into your bowl. Use a spatula to gently stir until just combined. Follow this with about ½ of your buttermilk, and stir again until just combined. Add ½ of the remaining dry ingredients stir, and then add the remainder of the buttermilk. Finish with the final portion of dry ingredients and use your spatula to make sure the batter is smooth. Pour into a prepared pan and bake at 350 degrees until golden brown. | Cake recipe |
joe@email.com | This traditional eggs benedict sauce is called hollandaise sauce. The ingredients are butter, egg yolks, lime juice, heavy cream, and salt and pepper. This is a more traditional method for making hollandaise sauce. Some people prefer to make hollandaise sauce in the blender, which would work well for this recipe. To make hollandaise sauce, start by melting butter in a saucepan. Meanwhile, beat egg yolks in separate bowl and add lime juice, heavy cream, and salt and pepper. Once the butter has melted, you’re ready to temper the eggs by adding a small amount of the hot butter to the egg mixture. Stir it well and repeat this process, slowly adding one spoonful of hot butter to the egg mixture. We do this to avoid curdling the eggs. Finally, add the mixture back to the saucepan and cook it for a few more seconds. | Hollandaise sauce |
Note that changing property settings can greatly alter the generated response.
This recipe makes Hollandaise sauce, a traditional eggs benedict sauce
Supported Large Language Models
- snowflake-arctic
- llama2-70b-chat
- llama3-8b
- llama3-70b
- gemma-7b
- mistral-large
- mistral-7b
- mistra-8x7b
- reka-core
- reka-flash
Understanding Prompts
The prompts that you define for the LLM Complete processor determine the results that the processor generates.
You can include input columns in prompts by using the Select Column from Schema icon or
by manually enclosing the column name in curly brackets, as follows:
{<column>}
.
- Required prompt
- Use the required Prompt property to specify an English-language prompt that you want the processor to use to generate the response.
- Optional system prompt
- Optionally use the System Prompt property to provide an English-language system prompt to provide additional instructions about how to generate the response or details on the style of the response.
Respond in 2 or 3 words, in
French
. Then, the processor provides the following response for the
hollandaise recipe:
Sauce hollandaise traditionnelle
Response Format
The response generated by the Snowflake LLM Complete function is a JSON object. By default, the LLM Complete processor extracts a plain text response from the JSON object. You can configure the processor to provide the full JSON response by clearing the Extract Message property.
{
"choices": [
{
"messages": "Cake recipe"
}
],
"created": 1724094076,
"model": "llama3-70b",
"usage": {
"completion_tokens": 3,
"prompt_tokens": 178,
"total_tokens": 181
}
}
By default, the Extract Message property is enabled and the processor writes Cake
recipe
to the output column.
If you want to use the entire JSON response in the pipeline, you simply clear the Extract Message property.
Output Column
- When you define an output column that does not exist in incoming data, the processor creates the column.
- When you define an output column that exists, the processor overwrites the data in the column.
Configuring an LLM Complete Processor
Configure an LLM Complete processor to generate a response to an English-language prompt using a specified large language model.
-
On the General tab, configure the following
properties:
General Property Description Name Stage name. Description Optional description. Cache Data Caches processed data. -
On the Complete tab, configure the following
properties:
Complete Property Description Model Large language model to use to respond to configured prompts. System Prompt Optional English-language prompt to provide additional information for the response or instructions for the response style. Prompt Primary English-language prompt to generate a response to. Output Column Column to write the generated response to. Extract Message Extracts a plain text response from the response JSON and writes it to the specified output column. When cleared, the processor passes the entire response JSON to the output column.
Define Advanced Options Enables configuring advanced options. Temperature A value between 0 and 1 that determines how random the responses can be. Higher values allow a more random output. This property influences the selection of tokens at each step.
Available when configuring advanced options.
Top P A value between 0 and 1 that determines the diversity of the language used in the responses. Higher values allow a more diverse output. Can be used as an alternative to Temperature.
Available when configuring advanced options.
Max Tokens The maximum number of tokens to allow in a response. Smaller values can lead to truncated responses. When not specified, the processor uses the Snowflake default, which is 4096 at this time. For more information, see the Snowflake documentation.
Available when configuring advanced options.
Guardrails Filters out possibly unsafe or harmful responses from the results. Available when configuring advanced options.