expand_llm_config: Expand an LLM Config Grid

View source: R/LLM_parallel_utils.R

expand_llm_configR Documentation

Expand an LLM Config Grid

Description

Creates a list of llm_config objects from a base configuration and sweeping parameter vectors. Uses expand.grid() internally.

Usage

expand_llm_config(base_config, ...)

Arguments

base_config

An llm_config object to use as the base.

...

Named vectors of parameter values to sweep (e.g., model, temperature). Parameters named provider, model, api_key, embedding, troubleshooting, or no_change are set as top-level config fields; all others are placed in model_params.

Value

A list of llm_config objects.

See Also

llm_config(), llm_cross_design(), call_llm_par()

Examples

base <- llm_config("openai", "gpt-4.1-nano")
cfgs <- expand_llm_config(base,
                          temperature = c(0, 0.5, 1),
                          model = c("gpt-4.1-nano", "gpt-4.1-mini"))
length(cfgs)


LLMR documentation built on July 11, 2026, 1:06 a.m.