pub trait ModelFamilyProvider:
Send
+ Sync
+ 'static {
type Config: Clone + Send + Sync + Serialize + DeserializeOwned + 'static;
// Required methods
fn family_id(&self) -> &ModelFamilyId;
fn external_metadata_ids(&self) -> BTreeSet<ExternalModelMetadataId>;
fn validate_config_identity(
&self,
raw: &Value,
config: &Self::Config,
) -> Result<(), VNextError>;
fn validated_external_metadata_id(
&self,
raw: &Value,
config: &Self::Config,
) -> Result<ExternalModelMetadataId, VNextError>;
fn parse_config(&self, raw: &Value) -> Result<Self::Config, VNextError>;
fn weight_schema(
&self,
config: &Self::Config,
) -> Result<WeightSchema, VNextError>;
fn numerical_profiles(
&self,
config: &Self::Config,
) -> Result<FamilyNumericalProfiles, VNextError>;
fn semantic_program(
&self,
config: &Self::Config,
profile: &NumericalExecutionProfile,
) -> Result<ModelProgram, VNextError>;
fn semantic_metadata(
&self,
config: &Self::Config,
) -> Result<ModelSemanticMetadata, VNextError>;
// Provided method
fn specialize_weight_schema(
&self,
_config: &Self::Config,
source: &WeightSchema,
_profile: &NumericalExecutionProfile,
) -> Result<WeightSchema, VNextError> { ... }
}Expand description
Compile-time model family provider with a typed, validated configuration.
Required Associated Types§
Required Methods§
fn family_id(&self) -> &ModelFamilyId
fn external_metadata_ids(&self) -> BTreeSet<ExternalModelMetadataId>
fn validate_config_identity( &self, raw: &Value, config: &Self::Config, ) -> Result<(), VNextError>
Sourcefn validated_external_metadata_id(
&self,
raw: &Value,
config: &Self::Config,
) -> Result<ExternalModelMetadataId, VNextError>
fn validated_external_metadata_id( &self, raw: &Value, config: &Self::Config, ) -> Result<ExternalModelMetadataId, VNextError>
Returns the exact external metadata identity represented by config.
Every provider must make this selection explicit; core never assumes a
singleton catalog row is the intended typed identity.
fn parse_config(&self, raw: &Value) -> Result<Self::Config, VNextError>
fn weight_schema( &self, config: &Self::Config, ) -> Result<WeightSchema, VNextError>
fn numerical_profiles( &self, config: &Self::Config, ) -> Result<FamilyNumericalProfiles, VNextError>
fn semantic_program( &self, config: &Self::Config, profile: &NumericalExecutionProfile, ) -> Result<ModelProgram, VNextError>
fn semantic_metadata( &self, config: &Self::Config, ) -> Result<ModelSemanticMetadata, VNextError>
Provided Methods§
Sourcefn specialize_weight_schema(
&self,
_config: &Self::Config,
source: &WeightSchema,
_profile: &NumericalExecutionProfile,
) -> Result<WeightSchema, VNextError>
fn specialize_weight_schema( &self, _config: &Self::Config, source: &WeightSchema, _profile: &NumericalExecutionProfile, ) -> Result<WeightSchema, VNextError>
Specialization may change logical decoding dtype, never the source’s physical components, layouts, dimensions or tensor identities.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".