Skip to main content

Crate orbok_embed

Crate orbok_embed 

Source
Expand description

§orbok-embed

Embedding backend factory (RFC-021). Selects and constructs a local EmbeddingModel implementation from an EmbeddingModelConfig.

§Backend selection

BackendFeature flagNotes
MockalwaysDeterministic 8-dim, test-only
CandleCpu/CandleCudacandleHuggingFace candle runtime
OnnxRuntimetractTract ONNX runtime (pure Rust)

Without the candle or tract feature, create_embedding_model returns OrbokError::Cache when called with a non-mock backend. Enable the feature at build time and provide model weights to use real inference:

cargo build --features orbok-embed/tract

§RFC-021 model comparison

Evaluated models for the default recommendation:

ModelDimSizeLicenseJapaneseNotes
all-MiniLM-L6-v2384~22 MBApache 2.0WeakFast, widely supported
nomic-embed-text-v1.5768~137 MBApache 2.0ModerateGood multilingual
multilingual-e5-small384~118 MBMITStrong100 languages including Japanese

Recommended default (RFC-021): multilingual-e5-small for orbok’s mixed Japanese-English use case (RFC-014). The 384-dim vectors keep storage manageable while providing genuine multilingual recall. Users can override via EmbeddingModelConfig.

Constants§

RECOMMENDED_HF_MODEL_ID
HuggingFace model ID for manual download reference.
RECOMMENDED_MODEL_DIMENSION
RECOMMENDED_MODEL_MAX_SEQ_LEN
RECOMMENDED_MODEL_NAME
Recommended default model configuration for new installations.
RECOMMENDED_MODEL_VERSION
RECOMMENDED_ONNX_FILE
Expected ONNX weights file name once downloaded.

Functions§

create_embedding_model
Construct an embedding model from configuration.
recommended_config
Build a default configuration for the recommended model.