LocalEmbeddingDatasource class
On-device embedding inference using all-MiniLM-L6-v2 via ONNX Runtime.
Downloads the ONNX model and vocabulary on first use (~90 MB total). Uses hardware acceleration on iOS when available.
Constructors
- LocalEmbeddingDatasource(Dio _dio)
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
-
isModelDownloaded
→ Future<
bool> -
Whether the model files have been downloaded.
no setter
- isReady → bool
-
Whether the model is ready for inference.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
dispose(
) → void - Dispose resources.
-
downloadModel(
{void onProgress(double progress)?}) → Future< void> -
Download model files if not present. Reports progress via
onProgress. -
embed(
String text) → Future< List< double> > -
Generate a 384-dim embedding for
text. -
initialize(
) → Future< void> - Initialize the model and tokenizer. Must call downloadModel first.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited