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
impl ModelConfig
pub fn is_empty(&self) -> bool
Sourcepub fn known_models(&self) -> Vec<ModelEntry>
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.
Sourcepub fn resolve_capabilities(
&self,
vendor: &str,
capabilities: &[String],
min_context: Option<i64>,
) -> Result<String, String>
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.
Sourcepub fn validate(&self, built_in: &[&str]) -> Result<(), String>
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
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