pub struct ModelSpec {
pub provider: String,
pub model: String,
pub api_identifier: String,
pub max_output_tokens: usize,
pub input_context: usize,
pub generation: f32,
pub tier: String,
pub legacy: bool,
pub beta_headers: Vec<BetaHeader>,
pub source: ModelSource,
}Expand description
Specification for a single model: its identity, limits, tier, and any beta-header unlocks.
A ModelSpec is the central row of the registry. provider and
tier cross-reference into a ProviderConfig (via
ModelConfiguration::providers and ProviderConfig::tiers).
max_output_tokens and input_context are the base limits; entries
in beta_headers raise them when the corresponding HTTP header is sent.
source is loader-populated and records which layer contributed the
entry — never read from YAML.
§Identifier normalization
The same underlying model is addressable through several identifier formats depending on how the API is reached:
- Canonical (Anthropic direct):
claude-3-7-sonnet-20250219 - Bedrock with region prefix:
us.anthropic.claude-3-7-sonnet-20250219-v1:0 - AWS-direct without region:
anthropic.claude-3-haiku-20240307-v1:0 - Regional gateways:
eu.anthropic.claude-3-opus-20240229-v2:1
All four resolve to the same ModelSpec:
ModelRegistry::get_model_spec tries an exact match first, and on
miss strips region/provider prefixes and version suffixes before
retrying. See ADR-0011 for the design
rationale.
Fields§
§provider: StringAI provider name (e.g., “claude”).
model: StringHuman-readable model name (e.g., “Claude Opus 4”).
api_identifier: StringAPI identifier used for requests (e.g., “claude-3-opus-20240229”).
max_output_tokens: usizeMaximum number of tokens that can be generated in a single response.
input_context: usizeMaximum number of tokens that can be included in the input context.
generation: f32Model generation number (e.g., 3.0, 3.5, 4.0).
tier: StringPerformance tier (e.g., “fast”, “balanced”, “flagship”).
legacy: boolWhether this is a legacy model that may be deprecated.
beta_headers: Vec<BetaHeader>Beta headers that unlock enhanced limits for this model.
source: ModelSourceLayer that contributed this entry. Populated by the loader; never read from YAML.