pub struct LlmConfig {
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 max_attempts: u32,
}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).
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.