Skip to main content

ModelConfig

Struct ModelConfig 

Source
pub struct ModelConfig {
    pub default: Option<String>,
    pub providers: Vec<ProviderConfig>,
    pub prices: Vec<ModelPrice>,
    pub catalogue: Vec<ModelEntry>,
}
Expand description

The [model] section of a manifest.

Fields§

§default: Option<String>

Which provider answers a call the artifact did not pin to a vendor.

§providers: Vec<ProviderConfig>§prices: Vec<ModelPrice>

What each model costs, so budget.cost can be charged.

Deployment configuration rather than part of the program, for the same reason [[mcp.server]] is: a price is provider- and time-dependent, and an artifact carrying one would be stale the moment it was published.

§catalogue: Vec<ModelEntry>

What each model can do, so model requires { ... } can be matched against something.

Deployment configuration for the same reason a price is: a model’s context window and capabilities change on the vendor’s schedule, not on this project’s release schedule. They used to be consts in a provider module, which meant a model growing a larger window was a code change and a release – and that two of the three providers refused capability requirements outright, because neither had “a catalogue to match them against”. This is that catalogue.

Implementations§

Source§

impl ModelConfig

Source

pub fn is_empty(&self) -> bool

Source

pub fn known_models(&self) -> Vec<ModelEntry>

Every model this deployment knows about, the operator’s first.

Order is preference order and it is the operator’s: their entries are tried before the built-in ones, so overriding a built-in means declaring it, not editing this binary. Within each group, declaration order.

Source

pub fn resolve_capabilities( &self, vendor: &str, capabilities: &[String], min_context: Option<i64>, ) -> Result<String, String>

The first model of vendor that satisfies a requirement, or why none does.

The one place capability matching happens, so the three providers cannot answer the same question differently – which is what they did before this existed: one had a hardcoded default and two refused outright.

Source

pub fn pricing(&self) -> Pricing

The prices a run is given, as the interpreter wants them.

Source

pub fn validate(&self, built_in: &[&str]) -> Result<(), String>

Reject what cannot work, before a key is read or a request is built.

built_in are the names available without being declared, so that default = "anthropic" is accepted without an [[model.provider]] entry restating what Ingot already knows.

Trait Implementations§

Source§

impl Clone for ModelConfig

Source§

fn clone(&self) -> ModelConfig

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() -> ModelConfig

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for ModelConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for ModelConfig

Source§

impl PartialEq for ModelConfig

Source§

fn eq(&self, other: &ModelConfig) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for ModelConfig

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for ModelConfig

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.