Skip to main content

classify_model

Function classify_model 

Source
pub fn classify_model(
    candidate: &str,
    available_ids: &[String],
    known_or_deprecated: bool,
) -> ModelVerification
Expand description

Pure decision logic for model verification, decoupled from any network IO so it can be unit-tested with an injected list of available model ids.

  • candidate - the model name the user is trying to set.
  • available_ids - model ids returned by the endpoint’s /models listing.
  • known_or_deprecated - true if candidate maps to a built-in/deprecated model (those are always acceptable regardless of what the endpoint advertises).