canResolve abstract method

bool canResolve(
  1. String repo, {
  2. ModelFileType? fileType,
})

Whether this resolver handles a repo whose model is declared as fileType.

A resolver should claim a specific fileType (the litertlm resolver returns true only for fileType == ModelFileType.litertlm) and NOT match a null hint — otherwise, with more than one resolver registered, a bare resolveHuggingFace(repo) with no hint would route by registration order and could send an .onnx repo to the litertlm resolver. Callers pass the fileType they are installing (they know it), so requiring it is cheap. repo is available for future host/owner-scoped rules but current selection is by fileType.

Implementation

bool canResolve(String repo, {ModelFileType? fileType});