pub struct LlmConfig {Show 14 fields
pub enabled: bool,
pub backend: BackendKind,
pub endpoint: Option<String>,
pub model: Option<String>,
pub api_key: Option<String>,
pub api_key_command: Option<Vec<String>>,
pub headers: BTreeMap<String, String>,
pub protocol: Option<String>,
pub reasoning_effort: Option<ReasoningEffort>,
pub temperature: Option<f32>,
pub max_tokens: Option<u32>,
pub timeout_secs: u64,
pub max_retries: u32,
pub max_concurrent: usize,
}Expand description
One provider in the failover chain.
deny_unknown_fields because the alternative is what a misspelled key was
doing until this attribute arrived: serde dropped it without a word, and a
user who wrote [llm.headers] before drep could send one got a config that
read as configured and sent nothing. That is the same silent-drop failure
ConfigError::SiteOnlyField exists to refuse one file over, and there is no
reason for drep.toml to be laxer than the policy file about it.
It is the one pass that does not honour “a disabled entry is inert”, because
serde rejects at deserialization and there is no entry yet to skip. So a
parked provider carrying a field from a newer drep refuses to load the file
rather than being ignored. That is the wanted trade - a typo in a parked
entry is still a typo, and the entry is one line from being re-enabled - but
it is a deviation from a rule ${VAR} expansion, field validation and
credential resolution all keep.
Fields§
§enabled: bool§backend: BackendKind§endpoint: Option<String>§model: Option<String>§api_key: Option<String>§api_key_command: Option<Vec<String>>An argv - never a shell line - whose trimmed stdout is the credential.
Declared after api_key because the field order is the resolution order:
an explicit key wins, then this, then the per-machine store.
headers: BTreeMap<String, String>Extra HTTP headers sent with every request to this provider.
For the gateway that identifies its clients by User-Agent, bills
against a header, or authenticates outside its protocol’s default
scheme. A name that collides with one the protocol sets replaces it, so
this can carry an Authorization the SDK’s own scheme would not produce.
A value here can be a credential. A project or tenant token is the
ordinary case, which is the whole reason Debug here, LlmClient’s
Debug, doctor’s listing and ConfigError::UnusableHeaderValue all
print the name and never the value. This is the one place that argument
is made; the others cite it.
A BTreeMap rather than a list of pairs, so the rendered config and the
doctor listing come out in a stable order. That alone does not make the
set unambiguous: two spellings of one name are two map keys and one HTTP
header, so ConfigError::DuplicateHeaderName refuses that pair at load
rather than letting byte order decide which of them is sent.
config::effective_headers overlays what survives on drep’s own defaults
to get what is actually sent.
protocol: Option<String>§reasoning_effort: Option<ReasoningEffort>§temperature: Option<f32>§max_tokens: Option<u32>§timeout_secs: u64§max_retries: u32§max_concurrent: usize