HuggingFaceResolver class abstract

A pluggable resolver that turns a Hugging Face repo id into a ResolvedHfModel by reading that repo's deployment metadata.

Implemented in an engine package — e.g. flutter_gemma_litertlm reads litertlm_manifest.json — and passed to FlutterGemma.initialize via huggingFaceResolvers:. Core selects one via the same probe-chain shape as InferenceEngineProvider (highest priority, first-registered breaks ties), but the discriminator differs: an engine's canHandle inspects an already-resolved InferenceModelSpec, whereas a resolver has only a bare org/repo string and the caller's ModelFileType hint until it fetches the manifest. So canResolve selects on that declared fileType hint — the same "select by declared ModelFileType" rule the engine registry uses.

Core never fetches on the resolver's behalf: the resolver does its own IO inside resolve.

Constructors

HuggingFaceResolver()

Properties

hashCode int
The hash code for this object.
no setterinherited
name String
Human-readable name for diagnostics (e.g. 'litertlm-manifest').
no setter
priority int
Selection precedence on overlap. Core-adjacent resolvers use 0; a third party raises this to take precedence for a repo both could handle.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

canResolve(String repo, {ModelFileType? fileType}) bool
Whether this resolver handles a repo whose model is declared as fileType.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resolve(String repo, {String? token, String? platform, PreferredBackend? preferredBackend}) Future<ResolvedHfModel>
Read the repo's deployment metadata and resolve the variant + defaults for the current device.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited