represents a configuration for an LLM.
LLMConfiguration[spec]
creates a configuration based on the specification spec.
LLMConfiguration[LLMConfiguration[…],propspec]
creates a configuration based on an existing configuration.
LLMConfiguration
represents a configuration for an LLM.
LLMConfiguration[spec]
creates a configuration based on the specification spec.
LLMConfiguration[LLMConfiguration[…],propspec]
creates a configuration based on an existing configuration.
Details
- LLMConfiguration represents the properties of an LLM task including model, special prompts, sampling strategy, etc.
- LLMConfiguration objects can be used with functions such as LLMSynthesize, ChatObject and ChatEvaluate through the LLMEvaluator option.
- $LLMEvaluator is set to an LLMConfiguration.
- Possible values for spec are:
-
"name" use a named configuration propval set a specific property <|prop1->val1,prop2->val2,...|> set multiple properties - Unspecified properties are set to the values specified by $LLMEvaluator.
- Valid configuration names includes:
-
"WolframAIAccess" use an LLM model via Wolfram "WolframAIAssistant" use the prompts and tools of the Wolfram AI Assistant "AgentOne" use the prompts and tools of the Agent One API - Supported properties of LLMConfiguration objects include:
-
"MaxTokens" maximum amount of tokens to generate "Model" base model "PromptDelimiter" string to insert between prompts "Prompts" initial prompts or LLMPromptGenerator objects "Reasoning" reasoning settings "StopTokens" tokens on which to stop generation "Temperature" sampling temperature "ToolMethod" method to use for tool calling "Tools" list of LLMTool objects to make available "TopProbabilities" sampling classes cutoff "TotalProbabilityCutoff" sampling probability cutoff (nucleus sampling) - Valid settings for "Model" include:
-
name named model {service,name} named model from service <|"Service"service,"Name"name|> fully specified model - Text generated by an LLM is sampled from a distribution. Details of the sampling can be specified using the following properties of the LLMConfiguration:
-
"Temperature"t Automatic sample using a positive temperature t "TopProbabilities"k Automatic sample only among the k highest-probability classes "TotalProbabilityCutoff"p Automatic sample among the most probable choices with an accumulated probability of at least p (nucleus sampling) - The Automatic value of these parameters uses the default for the specified "Model".
- Valid settings for "Reasoning" are:
-
None do not use reasoning "spec" use a named specification "spec" Quantity[n,"Tokens"] allocate n tokens for reasoning - Valid settings for "Prompts" include:
-
"string" static text LLMPrompt["name"] a repository prompt LLMPromptGenerator[…] an LLMPromptGenerator object {prompt1,…} a list of prompts - The setting for "PromptDelimiter" determines how multiple prompts are joined.
- Valid settings for "ToolMethod" include:
-
Automatic "Service" when supported, otherwise "Textual" "Service" rely on the tool mechanism of service "Textual" use prompt-based tool calling assoc specific textual prompting and parsing - Valid keys in assoc include:
-
"ToolPrompt" prompt specifying tool format "ToolRequestParser" function for parsing tool requests "ToolResponseInsertionFunction" function for serializing tool responses - The prompt specified by "ToolPrompt" is only used if at least one tool is specified.
- "ToolPrompt" can be a template, and is applied to an association containing all properties of the LLMConfiguration.
- "ToolRequestParser" specifies a function that takes the most recent completion from the LLM and returns one of the following forms:
-
None no tool request {{start,end},LLMToolRequest[…]} tool request {{start,end},Failure[…]} invalid tool request - The pair of integers {start,end} indicates the character range within the completion string where the tool request appears.
- LLMConfiguration[] gives a configuration with all properties set to their default values.
- Not all LLM services support every parameter that can be specified in the LLMConfiguration.
Examples
open all close allBasic Examples (3)
Create a configuration that includes a prompt:
config = LLMConfiguration["Prompts" -> LLMPrompt["ELI5"]]Use the configuration in an LLM evaluation:
LLMSynthesize["What is the tallest mountain?", LLMEvaluator -> config]Specify multiple properties of a configuration:
config = LLMConfiguration[<|"Prompts" -> LLMPrompt["ELI5"], "Tools" -> LLMTool[...]|>]LLMSynthesize["Which is bigger, Chicago or Boston? Use the tool to check.", LLMEvaluator -> config]Modify an existing configuration:
config1 = LLMConfiguration["Prompts" -> LLMPrompt["ELI5"]]config2 = LLMConfiguration[config1, "Tools" -> LLMTool[...]]Scope (12)
Create a "WolframAIAssistant" configuration to access optimized prompts and tools:
LLMConfiguration["WolframAIAssistant"]Use it to get more relevant answers:
LLMSynthesize["plot a degree 2 polynomial in the complex plane", LLMEvaluator -> %]Use an "AgentOne" configuration to access the Agent One API:
LLMSynthesize["what is the tallest mountain?", "FormattedBoxes", LLMEvaluator -> LLMConfiguration["AgentOne"]]Specify a token limit to the LLM-generated text:
LLMConfiguration["MaxTokens" -> 10]LLMSynthesize["what is the tallest mountain ?", LLMEvaluator -> %]Specify the service and the model to use for the generation:
LLMConfiguration["Model" -> <|"Service" -> "Anthropic", "Name" -> "claude-haiku-4-5" |>]LLMSynthesize["What's the plural of mouse?", LLMEvaluator -> %]Specify several prompts and how to join them together before submitting them to the LLM:
LLMConfiguration[<|"Prompts" -> {LLMPrompt["ELI5"], "Always answer with a single sentence"}, "PromptDelimiter" -> "
-----
" |>]LLMSynthesize["What's the plural of mouse?", "PromptText" , LLMEvaluator -> %]Specify that the sampling should be performed at zero temperature:
LLMConfiguration["Temperature" -> 0]Table[LLMSynthesize["What is the plural of mouse? One sentence.", LLMEvaluator -> %], 6]Specify the maximum cumulative probability before cutting off the distribution (aka nucleus sampling):
LLMConfiguration["TotalProbabilityCutoff" -> .2]LLMSynthesize["What's the plural of mouse?", LLMEvaluator -> %]Specify the number of top-probability tokens to sample from:
LLMConfiguration[<|"TopProbabilities" -> 50, "Model" -> <|"Service" -> "Anthropic", "Name" -> "claude-haiku-4-5" |>|>]LLMSynthesize["What's the plural of mouse?", LLMEvaluator -> %]Specify one or more alternative strings that will stop the LLM generation process:
LLMConfiguration["StopTokens" -> {"mouse"}]LLMSynthesize["What's the plural of mouse?", LLMEvaluator -> %]Specify a tool that the LLM can call if needed:
LLMConfiguration["Tools" -> {LLMTool[{"altimeter", "gives the altitude at a location"}, {"where" -> "Location"}, GeoElevationData[#where]&], LLMTool[{"thermometer", "gives the current temperature at a location"}, {"where" -> "Location"}, AirTemperatureData[#where]&]}]ChatEvaluate[ChatObject[LLMEvaluator -> %], "what are Rome's altitude and the current temperature?"]Specify that tool calls should attempt to use the native API mechanism:
config = LLMConfiguration[<|
"ToolMethod" -> "Service", "Tools" -> {LLMTool[{"altimeter", "gives the altitude at a location"}, {"where" -> "Location"}, GeoElevationData[#where]&], LLMTool[{"thermometer", "gives the current temperature at a location"}, {"where" -> "Location"}, AirTemperatureData[#where]&]}|>]ChatEvaluate[ChatObject[LLMEvaluator -> config], "what are Rome's altitude and the current temperature?"]Compare with the alternative text-based method (which performs a single call at a time):
config2 = LLMConfiguration[config, "ToolMethod" -> "Textual"]ChatEvaluate[ChatObject[LLMEvaluator -> config2], "what are Rome's altitude and the current temperature?"]Create a configuration with all properties set to their default value:
LLMConfiguration[]Possible Issues (1)
Unspecified properties are set to the values specified by $LLMEvaluator:
$LLMEvaluator = LLMConfiguration[<|"Temperature" -> 0.5|>];
LLMConfiguration[<|"MaxTokens" -> 3, "TotalProbabilityCutoff" -> .2|>]["Temperature"]Set only the specified properties, leaving all others to the model default values:
LLMConfiguration[LLMConfiguration[], <|"MaxTokens" -> 3, "TotalProbabilityCutoff" -> .2|>]["Temperature"]See Also
LLMSynthesize ChatObject LLMEvaluator $LLMEvaluator LLMPromptGenerator LLMPrompt LLMTool
Service Connections: OpenAI Anthropic GoogleGemini Cohere DeepSeek Groq MistralAI TogetherAI
Related Guides
History
Introduced in 2023 (13.3) | Updated in 2024 (14.1) ▪ 2025 (14.3) ▪ 2026 (15.0)
Text
Wolfram Research (2023), LLMConfiguration, Wolfram Language function, https://reference.wolfram.com/language/ref/LLMConfiguration.html (updated 2026).
CMS
Wolfram Language. 2023. "LLMConfiguration." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2026. https://reference.wolfram.com/language/ref/LLMConfiguration.html.
APA
Wolfram Language. (2023). LLMConfiguration. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/LLMConfiguration.html
BibTeX
@misc{reference.wolfram_2026_llmconfiguration, author="Wolfram Research", title="{LLMConfiguration}", year="2026", howpublished="\url{https://reference.wolfram.com/language/ref/LLMConfiguration.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_llmconfiguration, organization={Wolfram Research}, title={LLMConfiguration}, year={2026}, url={https://reference.wolfram.com/language/ref/LLMConfiguration.html}, note=[Accessed: 13-June-2026]}