pub struct RlmConfig {
pub mode: String,
pub threshold: f64,
pub max_iterations: usize,
pub max_subcalls: usize,
pub runtime: String,
pub root_model: Option<String>,
pub subcall_model: Option<String>,
}Expand description
RLM configuration
Fields§
§mode: StringMode: “auto”, “off”, or “always”
threshold: f64Threshold ratio of context window to trigger RLM (0.0-1.0)
max_iterations: usizeMaximum iterations for RLM processing.
§Semantics
An “iteration” is one full router step: system prompt + tools →
LLM round-trip → tool calls → results → next LLM round-trip.
The loop terminates in one of four ways, mapped directly to
RlmOutcome on the emitted
RlmComplete event:
| Termination condition | Outcome |
|---|---|
Model emitted a FINAL: marker | Converged |
max_iterations reached without FINAL: | Exhausted |
| Provider or tool raised an error | Failed |
The caller’s AbortHandle fired | Aborted |
Exhausted is not an error — the partial result is still
returned and the caller decides whether to retry with a higher
limit, fall back to chunk compression, or surface the partial
answer to the user. Session-level context compaction (see
crate::session::helper::compression) treats Exhausted the
same as success and re-uses the summary it produced.
max_subcalls: usizeMaximum recursive sub-calls
runtime: StringPreferred runtime: “rust”, “bun”, or “python”
root_model: Option<String>Model reference for root processing (provider:model)
subcall_model: Option<String>Model reference for subcalls (provider:model)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for RlmConfig
impl<'de> Deserialize<'de> for RlmConfig
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>,
Auto Trait Implementations§
impl Freeze for RlmConfig
impl RefUnwindSafe for RlmConfig
impl Send for RlmConfig
impl Sync for RlmConfig
impl Unpin for RlmConfig
impl UnsafeUnpin for RlmConfig
impl UnwindSafe for RlmConfig
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<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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request