#[non_exhaustive]pub struct MagiConfig {
pub timeout: Duration,
pub max_input_len: usize,
pub completion: CompletionConfig,
}Expand description
Configuration for the MAGI orchestrator.
Controls timeout per agent, maximum input size, and LLM completion parameters.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.timeout: DurationMaximum time to wait for each agent (default: 300 seconds).
max_input_len: usizeMaximum accepted size of the raw content argument to Magi::analyze, in bytes.
Default: DEFAULT_MAX_INPUT_LEN (4 MB).
Note: for public-facing deployments where content is untrusted,
consider lowering this via MagiBuilder::with_max_input_len to a value
appropriate for your threat model. Default (4 MB) is a compromise between
Python MAGI’s 10 MB and v0.1.2’s 1 MB; a full 10 MB alignment with Python
is deferred to v0.3.0 pending allocation audit of the analyze() pipeline.
§Allocation audit (2026-04-18)
An allocation audit of the analyze() pipeline for magi-core v0.2.0 found
5 copy points on the content’s path from analyze() entry to wire serialization:
(1) user-prompt construction via format!, (2–4) per-agent String::clone to
satisfy tokio::spawn’s 'static bound (3 agents), and (5) HTTP/stdin
serialization by the provider. Peak memory per analysis is approximately
content.len() × 5 plus fixed overhead. For the 4 MB default, peak ≈ 20 MB.
A full 10 MB alignment with Python is deferred to v0.3.0, pending an
Arc<str> refactor of the orchestrator-to-provider path to reduce copies.
completion: CompletionConfigCompletion parameters forwarded to each agent.
Trait Implementations§
Source§impl Clone for MagiConfig
impl Clone for MagiConfig
Source§fn clone(&self) -> MagiConfig
fn clone(&self) -> MagiConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more