pub struct LlmConfig {Show 16 fields
pub url: String,
pub model: String,
pub api_key: Option<String>,
pub headers: HashMap<String, String>,
pub timeout: Duration,
pub temperature: f64,
pub thinking: Option<bool>,
pub model_params: HashMap<String, Value>,
pub cache: bool,
pub max_attempts: u32,
pub provider: Provider,
pub deployment: Option<String>,
pub api_version: Option<String>,
pub auth: AuthConfig,
pub header_commands: HashMap<String, String>,
pub aws: AwsConfig,
}Expand description
Configuration for the LLM client — bundles URL, model, auth, timeouts, and provider-specific options into a single struct passed everywhere.
Fields§
§url: StringOpenAI-compatible API base URL (without trailing /v1/…).
model: StringModel name (e.g. gpt-4o-mini, deepseek).
api_key: Option<String>API key sent as Authorization: Bearer <key>.
headers: HashMap<String, String>Custom headers appended to every LLM request.
timeout: DurationHTTP timeout.
temperature: f64Sampling temperature (0.0–1.0).
thinking: Option<bool>Enable extended thinking / reasoning tokens.
None = don’t send any thinking key (provider default).
model_params: HashMap<String, Value>Provider-specific parameters merged into the request body
(e.g. effort = "high" for Anthropic).
cache: boolSend provider-side prompt-cache markers (default true). Applies to
providers that need explicit markers: AWS Bedrock (cachePoint) and
Anthropic-style OpenAI-compatible models (cache_control). Set to
false to disable.
max_attempts: u32How many times a single call to this endpoint is retried on
transient failures before giving up (or moving to the next fallback
endpoint). Default 3; override globally with
HARNESS_LLM_CALL_ATTEMPTS.
provider: ProviderLLM provider protocol (defaults to OpenAI-compatible).
azure switches to the Azure OpenAI deployments endpoint, bedrock
to the SigV4-signed AWS Bedrock Converse API (feature aws).
deployment: Option<String>Azure OpenAI deployment name (Provider::Azure). Defaults to
model when unset.
api_version: Option<String>Azure OpenAI API version (Provider::Azure). Defaults to
2024-10-21.
auth: AuthConfigAuthentication configuration (API key, token command, Entra ID).
header_commands: HashMap<String, String>Extra HTTP headers produced by running a command per call, keyed by header name. Provider-agnostic.
aws: AwsConfigAWS credential settings (Provider::Bedrock).