pub struct AgentLoopConfig {
pub max_iterations: usize,
pub max_tokens_per_completion: usize,
pub temperature: f32,
pub top_k: i32,
pub min_p: f32,
pub repeat_penalty: f32,
pub auto_compact: bool,
pub compaction_threshold_pct: f32,
pub compaction_keep_recent: usize,
pub n_batch: usize,
pub stop_sequences: Vec<String>,
}Expand description
Configuration for the agent loop.
Fields§
§max_iterations: usizeMaximum number of iterations (tool-use rounds). 0 = unlimited.
max_tokens_per_completion: usizeMaximum tokens to generate per completion.
temperature: f32Temperature for sampling.
top_k: i32Top-K sampling parameter.
min_p: f32Min-P sampling parameter.
repeat_penalty: f32Repetition penalty.
auto_compact: boolEnable automatic context compaction (default: true).
compaction_threshold_pct: f32Percentage of context window that triggers compaction (0.0–1.0).
compaction_keep_recent: usizeNumber of recent messages to keep when compacting.
n_batch: usizeMaximum tokens per batch during prompt encoding (default: 512).
Large prompts are split into chunks of this size for decoding. Smaller values use less peak GPU memory; larger values may be faster on GPUs with plenty of VRAM.
stop_sequences: Vec<String>List of stop sequences. If the model generates one of these, it stops.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AgentLoopConfig
impl RefUnwindSafe for AgentLoopConfig
impl Send for AgentLoopConfig
impl Sync for AgentLoopConfig
impl Unpin for AgentLoopConfig
impl UnsafeUnpin for AgentLoopConfig
impl UnwindSafe for AgentLoopConfig
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
Mutably borrows from an owned value. Read more