LocalModelEncoderProvider class final

A local GGUF model file the host located, opened with LlamaEmbedder.

open verifies the file's size and SHA-256 against spec before it loads the model, so a host need not verify it first; verify checks the same without loading. Both report a file that is missing or unreadable as model-missing and other bytes as model-invalid, and what fixes either is EmbeddingModelRemedy.provideModel: a host keys its wording on the code.

Implemented types

Constructors

LocalModelEncoderProvider({required File modelFile, EmbeddingModelSpec spec = localEmbeddingModel})

Properties

hashCode → int
The hash code for this object.
no setterinherited
identity → WayfinderEncoderIdentity
What every encoder open returns reports, known without opening one.
no setteroverride
modelFile → File
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
spec → EmbeddingModelSpec
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
open() → Future<WayfinderEncoder>
Opens a new encoder, which the caller disposes. Throws a WayfinderException with code model-missing or model-invalid when the model cannot be used.
override
toString() → String
A string representation of this object.
inherited
verify() → Future<void>
Checks modelFile's size and SHA-256 without loading it, with the failures open reports.

Operators

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

Static Methods

identityFor(EmbeddingModelSpec spec) → WayfinderEncoderIdentity
The identity of a provider for spec, known without a model file.