pub struct SummarizerConfig {
pub endpoint: Option<String>,
pub model: Option<String>,
pub kind: Option<BackendKind>,
pub model_path: Option<String>,
pub api_key_file: Option<String>,
pub api_key_env: Option<String>,
pub timeout_secs: u64,
pub retries: u32,
pub fallback_model: Option<String>,
pub keep_alive: Option<String>,
}Expand description
Dedicated configuration for the compression summarizer, loaded from
~/.newt/summarizer.toml (Step 24.10, #559). An absent file means
SummarizerConfig::default() — every field falls back to the session
backend, so behavior is unchanged from “summarizer reuses the session
model”.
The point of the separate file is the own-backend fields
(endpoint/model/kind/api_key_file): a summarizer can run on a
different, fast box than the session model instead of contending with it
(the #548 field incident — a slow primary summarizer stalled ~189s before
the static marker). timeout_secs / retries / fallback_model are the
knobs that used to live under [tui] (moved here in 24.10).
Example ~/.newt/summarizer.toml:
endpoint = "http://REDACTED-HOST:11434" # default: session backend URL
model = "qwen2.5-coder:3b" # default: session model
kind = "ollama" # "ollama" | "openai"
timeout_secs = 45
retries = 1
fallback_model = "nemotron-mini:4b" # else preference-list auto-pick (24.9)Fields§
§endpoint: Option<String>Summarizer endpoint URL. None ⇒ reuse the session backend’s URL.
model: Option<String>Summarizer model. None ⇒ reuse the session backend’s model.
kind: Option<BackendKind>Backend protocol. None ⇒ reuse the session backend’s kind.
model_path: Option<String>For kind = "embedded" (#661 group C): the local GGUF model file for the
in-process candle summarizer. Ignored for HTTP backends.
api_key_file: Option<String>Bearer-token file (first non-empty line). None ⇒ reuse the session key.
api_key_env: Option<String>Bearer-token environment variable (checked before api_key_file).
timeout_secs: u64Per-request timeout (seconds). Default 60 — cold-loading a big model can legitimately exceed it; raise on a slow box that falls back to the marker.
retries: u32Retry attempts before the static marker. Default 1 — each attempt can
cost the full timeout_secs (the #548 189s incident was 3 × 60s).
fallback_model: Option<String>Explicit fallback model. None ⇒ for an Ollama summarizer backend, the
first installed small-model-preference-list entry is auto-picked (24.9).
keep_alive: Option<String>keep_alive for the warm + summary requests. None ⇒ inherit
[tui].keep_alive.
Implementations§
Source§impl SummarizerConfig
impl SummarizerConfig
Sourcepub fn from_toml_str(text: &str) -> Result<Self>
pub fn from_toml_str(text: &str) -> Result<Self>
Parse a summarizer.toml body. Pure — fully unit-testable without disk.
Sourcepub fn resolve() -> Result<Self>
pub fn resolve() -> Result<Self>
Load ~/.newt/summarizer.toml (or $NEWT_SUMMARIZER_CONFIG). A missing
file is not an error — it yields SummarizerConfig::default (reuse the
session backend). Only a present-but-malformed file errors.
Sourcepub fn resolve_api_key(&self) -> Option<String>
pub fn resolve_api_key(&self) -> Option<String>
Resolve this summarizer’s bearer token (env var first, then file), or
None — mirrors BackendConfig::resolve_api_key.
Trait Implementations§
Source§impl Clone for SummarizerConfig
impl Clone for SummarizerConfig
Source§fn clone(&self) -> SummarizerConfig
fn clone(&self) -> SummarizerConfig
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 SummarizerConfig
impl Debug for SummarizerConfig
Source§impl Default for SummarizerConfig
impl Default for SummarizerConfig
Source§impl<'de> Deserialize<'de> for SummarizerConfigwhere
SummarizerConfig: Default,
impl<'de> Deserialize<'de> for SummarizerConfigwhere
SummarizerConfig: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for SummarizerConfig
Source§impl PartialEq for SummarizerConfig
impl PartialEq for SummarizerConfig
Source§fn eq(&self, other: &SummarizerConfig) -> bool
fn eq(&self, other: &SummarizerConfig) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for SummarizerConfig
impl Serialize for SummarizerConfig
impl StructuralPartialEq for SummarizerConfig
Auto Trait Implementations§
impl Freeze for SummarizerConfig
impl RefUnwindSafe for SummarizerConfig
impl Send for SummarizerConfig
impl Sync for SummarizerConfig
impl Unpin for SummarizerConfig
impl UnsafeUnpin for SummarizerConfig
impl UnwindSafe for SummarizerConfig
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.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
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