Skip to main content

ModelConfig

Struct ModelConfig 

Source
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

Source

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).

Source

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 driver
Source

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.

Source

pub fn require(&self, tier: &str) -> Result<&str, DispatchError>

The model a tier maps to, or a loud-fail naming the undefined tier.

Source

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.

Source

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.

Source

pub fn validate(&self, ir: &WarbleIr) -> Result<(), DispatchError>

Validate every step tier in the IR maps to a model (front-loaded so emission is infallible).

Trait Implementations§

Source§

impl Clone for ModelConfig

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ModelConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ModelConfig

Source§

fn default() -> Self

The Claude Code defaults: strong→opus, cheap→haiku, orchestrator→sonnet (all Anthropic).

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.