pub struct LlmConfig {Show 15 fields
pub provider: LlmProvider,
pub model: Option<String>,
pub api_key: Option<String>,
pub base_url: Option<String>,
pub max_tokens: Option<u32>,
pub timeout_ms: Option<u64>,
pub connect_timeout_ms: Option<u64>,
pub max_retries: Option<u32>,
pub retry_backoff_ms: Option<u64>,
pub breaker_failure_threshold: Option<u32>,
pub breaker_reset_ms: Option<u64>,
pub breaker_half_open_max_calls: Option<u32>,
pub latency_slo_ms: Option<u64>,
pub error_budget_ratio: Option<f64>,
pub error_budget_window_secs: Option<u64>,
}Expand description
LLM provider configuration.
Fields§
§provider: LlmProviderProvider name: “anthropic”, “openai”, “ollama”, “lmstudio”.
model: Option<String>Model name.
api_key: Option<String>API key (can be environment variable reference like ${OPENAI_API_KEY}).
base_url: Option<String>Base URL for the provider (for self-hosted).
max_tokens: Option<u32>Maximum completion tokens for LLM responses.
timeout_ms: Option<u64>Request timeout in milliseconds.
connect_timeout_ms: Option<u64>Connect timeout in milliseconds.
max_retries: Option<u32>Maximum retries for LLM calls.
retry_backoff_ms: Option<u64>Retry backoff in milliseconds.
breaker_failure_threshold: Option<u32>Consecutive failures before opening circuit breaker.
breaker_reset_ms: Option<u64>Circuit breaker reset timeout in milliseconds.
breaker_half_open_max_calls: Option<u32>Half-open trial requests.
latency_slo_ms: Option<u64>Latency budget in milliseconds.
error_budget_ratio: Option<f64>Error budget ratio threshold.
error_budget_window_secs: Option<u64>Error budget window in seconds.
Implementations§
Source§impl LlmConfig
impl LlmConfig
Sourcepub fn from_config_file(file: &ConfigFileLlm) -> Self
pub fn from_config_file(file: &ConfigFileLlm) -> Self
Creates LLM config from config file settings.
ARCH-HIGH-002: Delegated from SubcogConfig::apply_config_file.
Sourcepub fn merge_from(&mut self, file: &ConfigFileLlm)
pub fn merge_from(&mut self, file: &ConfigFileLlm)
Merges another config into this one.
Only overrides fields that are set in the source.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LlmConfig
impl RefUnwindSafe for LlmConfig
impl Send for LlmConfig
impl Sync for LlmConfig
impl Unpin for LlmConfig
impl UnwindSafe for LlmConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].