Skip to main content

ModelConfigurationResolver

Trait ModelConfigurationResolver 

Source
pub trait ModelConfigurationResolver {
    type ArtifactPlan: Clone + Debug;

    // Required methods
    fn resolve_safetensors(
        &self,
        json: &Value,
    ) -> Result<ResolvedModelConfiguration<Self::ArtifactPlan>, ArtifactError>;
    fn resolve_gguf(
        &self,
        architecture: &str,
        checkpoint: &GgufCheckpoint,
    ) -> Result<ResolvedModelConfiguration<Self::ArtifactPlan>, ArtifactError>;
    fn gguf_companion_requirements(
        &self,
        architecture: &str,
        checkpoint: &GgufCheckpoint,
    ) -> Result<Vec<GgufCompanionRequirement>, ArtifactError>;

    // Provided method
    fn artifact_plan(
        &self,
        _path: &Path,
        _format: ArtifactFormat,
        _configuration: &ModelConfiguration,
        _tensors: &TensorCatalog,
        _validated_gguf: Option<&ValidatedGguf>,
        resolved_plan: Self::ArtifactPlan,
    ) -> Result<Self::ArtifactPlan, ArtifactError> { ... }
}
Expand description

Architecture-owned resolver used by neutral artifact inspection.

Core owns the transport contract but deliberately does not recognize model family aliases, GGUF architecture spellings, or nested configuration wrappers.

Required Associated Types§

Source

type ArtifactPlan: Clone + Debug

Architecture-owned state retained from artifact inspection through materialization.

Required Methods§

Source

fn resolve_safetensors( &self, json: &Value, ) -> Result<ResolvedModelConfiguration<Self::ArtifactPlan>, ArtifactError>

Resolves one Hugging Face config.json value to its canonical family.

Source

fn resolve_gguf( &self, architecture: &str, checkpoint: &GgufCheckpoint, ) -> Result<ResolvedModelConfiguration<Self::ArtifactPlan>, ArtifactError>

Resolves and structurally admits one GGUF architecture and checkpoint.

Source

fn gguf_companion_requirements( &self, architecture: &str, checkpoint: &GgufCheckpoint, ) -> Result<Vec<GgufCompanionRequirement>, ArtifactError>

Declares the sibling artifacts required by one admitted GGUF architecture.

Provided Methods§

Source

fn artifact_plan( &self, _path: &Path, _format: ArtifactFormat, _configuration: &ModelConfiguration, _tensors: &TensorCatalog, _validated_gguf: Option<&ValidatedGguf>, resolved_plan: Self::ArtifactPlan, ) -> Result<Self::ArtifactPlan, ArtifactError>

Finalizes resolved architecture state against the inspected tensor catalog and exact sidecars selected by inspection.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§