pub struct ResolvedLlm {
pub backend: String,
pub model: String,
pub base_url: String,
pub api_key_source: KeySource,
pub source: ConfigSource,
/* private fields */
}Expand description
Canonical resolved-LLM configuration. Produced by
AppConfig::resolve_llm. Every LLM-init surface (MCP stdio,
HTTP daemon, ai-memory atomise, ai-memory curator,
embed-client fallback, boot banner) consumes this struct rather
than reading raw config / env / tier presets.
Secret handling. The api_key field is private; access via
api_key(). The Debug impl redacts the value (<redacted>).
Fields§
§backend: StringBackend alias / wire-shape selector (e.g. "ollama", "xai",
"openai-compatible").
model: StringModel identifier passed verbatim to the chat endpoint.
base_url: StringBase URL of the chat endpoint (vendor-default or operator override).
api_key_source: KeySourceProvenance of the resolved API key for boot-banner / doctor-probe display.
source: ConfigSourceProvenance of the resolved configuration (CLI / env / config / legacy / compiled-default).
Implementations§
Source§impl ResolvedLlm
impl ResolvedLlm
Sourcepub fn api_key(&self) -> Option<&str>
pub fn api_key(&self) -> Option<&str>
Access the resolved API key. Use this only when constructing
the LLM client; do NOT log or {:?} the result.
Sourcepub fn is_ollama_native(&self) -> bool
pub fn is_ollama_native(&self) -> bool
True when the resolved backend uses the Ollama-native wire
shape (/api/chat, /api/embed, no auth). False for any
OpenAI-compatible vendor.
Compares self.backend against the canonical
crate::llm::BACKEND_OLLAMA selector (#1174 PR4 substrate
cleanup) so the literal lives in llm.rs alongside the rest
of the vendor-alias tables instead of being re-named at each
substrate site.
Sourcepub fn display_label(&self) -> String
pub fn display_label(&self) -> String
Display string for the boot banner: <backend>:<model>.
Trait Implementations§
Source§impl Clone for ResolvedLlm
impl Clone for ResolvedLlm
Source§fn clone(&self) -> ResolvedLlm
fn clone(&self) -> ResolvedLlm
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ResolvedLlm
impl Debug for ResolvedLlm
impl Eq for ResolvedLlm
Source§impl PartialEq for ResolvedLlm
impl PartialEq for ResolvedLlm
Source§fn eq(&self, other: &ResolvedLlm) -> bool
fn eq(&self, other: &ResolvedLlm) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ResolvedLlm
Auto Trait Implementations§
impl Freeze for ResolvedLlm
impl RefUnwindSafe for ResolvedLlm
impl Send for ResolvedLlm
impl Sync for ResolvedLlm
impl Unpin for ResolvedLlm
impl UnsafeUnpin for ResolvedLlm
impl UnwindSafe for ResolvedLlm
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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