trusty-embedder
Shared text-embedding abstraction for the trusty-* family of projects.
Provides a single async Embedder trait and a production-ready
FastEmbedder implementation backed by fastembed-rs
(all-MiniLM-L6-v2, 384-dimensional output, INT8-quantized ONNX) with LRU
caching and ORT warmup. A MockEmbedder test double is available behind
the test-support feature.
Installation
For tests/benches that want a deterministic stand-in:
Quick Example
use ;
async
Feature Flags
test-support(optional) — exposesMockEmbedder, a deterministic hash-based embedder for unit tests that don't want to load an ONNX model.
Notes
- Model files are downloaded by
fastembedon first use and cached in the standard fastembed cache location. - The crate falls back from
AllMiniLML6V2Q(INT8) toAllMiniLML6V2(FP32) when the quantized variant is unavailable in the host fastembed build. embed_batchis the single primitive — single-text embedding is a thin helper that wraps a one-element batch.
License
Licensed under the Elastic License 2.0.