orbok-embed
Embedding backend factory (RFC-021). Selects and constructs a local
[EmbeddingModel] implementation from an [EmbeddingModelConfig].
Backend selection
| Backend | Feature flag | Notes |
|---|---|---|
Mock |
always | Deterministic 8-dim, test-only |
CandleCpu/CandleCuda |
candle |
HuggingFace candle runtime |
OnnxRuntime |
tract |
Tract 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:
RFC-021 model comparison
Evaluated models for the default recommendation:
| Model | Dim | Size | License | Japanese | Notes |
|---|---|---|---|---|---|
| all-MiniLM-L6-v2 | 384 | ~22 MB | Apache 2.0 | Weak | Fast, widely supported |
| nomic-embed-text-v1.5 | 768 | ~137 MB | Apache 2.0 | Moderate | Good multilingual |
| multilingual-e5-small | 384 | ~118 MB | MIT | Strong | 100 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.