pub struct ModelConfig { /* private fields */ }Expand description
An ordered tier→binding map. Declaration order is priority: earlier tiers are “stronger” — used to
pick the single model when a multi-tier component collapses to one agent. Alongside the authoring
tiers (strong/cheap/custom, which components declare on steps) it carries the reserved
ORCHESTRATOR_TIER used by the split driver.
Implementations§
Source§impl ModelConfig
impl ModelConfig
Sourcepub fn from_flags(strong: String, cheap: String, orchestrator: String) -> Self
pub fn from_flags(strong: String, cheap: String, orchestrator: String) -> Self
Build from the inline --strong/--cheap/--orchestrator flags (the standard-core convenience).
Inline flags are always Anthropic-provider aliases; provider/endpoint routing is --models-config
only (so a non-alias inline flag still loud-fails on the SDK split path, as before).
Sourcepub fn from_yaml(text: &str) -> Result<Self, DispatchError>
pub fn from_yaml(text: &str) -> Result<Self, DispatchError>
Parse a --models-config YAML document. A tier value is EITHER a bare model-alias string
(Anthropic shorthand) OR a { provider, endpoint?, model } map — the structured binding
documented in capability-model.md §7.2. Declaration order is priority;
orchestrator is a reserved tier the split driver uses:
tiers:
strong: opus # shorthand ⇒ provider: anthropic
cheap: # structured binding (capability model §7.2)
provider: openai_compat
endpoint: http://localhost:11434/v1
model: qwen2.5
orchestrator: sonnet # reserved: the per-step-tier split driverSourcepub fn orchestrator(&self) -> Result<&str, DispatchError>
pub fn orchestrator(&self) -> Result<&str, DispatchError>
The model for the reserved orchestrator tier (the split driver), or a loud-fail if a
--models-config omitted it while a component needs a per-step-tier split.
Sourcepub fn require(&self, tier: &str) -> Result<&str, DispatchError>
pub fn require(&self, tier: &str) -> Result<&str, DispatchError>
The model a tier maps to, or a loud-fail naming the undefined tier.
Sourcepub fn binding(&self, tier: &str) -> Result<&TierBinding, DispatchError>
pub fn binding(&self, tier: &str) -> Result<&TierBinding, DispatchError>
The full {provider, endpoint, model} binding a tier maps to (see
capability-model.md §7.2), or a loud-fail. Direct-driving back-ends read this
to route a step cloud-vs-local; the file target uses only ModelConfig::require (the
model) because its provider is the session’s, not per-step.
Sourcepub fn collapsed_model<'a>(
&'a self,
calls: &[LlmCall],
) -> Result<&'a str, DispatchError>
pub fn collapsed_model<'a>( &'a self, calls: &[LlmCall], ) -> Result<&'a str, DispatchError>
The model for a single collapsed agent: the strongest (lowest-rank) tier among the calls.
Trait Implementations§
Source§impl Clone for ModelConfig
impl Clone for ModelConfig
Source§fn clone(&self) -> ModelConfig
fn clone(&self) -> ModelConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more