feat(ruvector-core): Add OnnxEmbedding for real semantic embeddings#265
Merged
feat(ruvector-core): Add OnnxEmbedding for real semantic embeddings#265
Conversation
Add native ONNX Runtime integration for production-ready semantic embeddings. ## New Features - `OnnxEmbedding` struct with `from_pretrained()` and `from_files()` methods - Feature flag: `onnx-embeddings` (optional, not default) - Auto-downloads models from HuggingFace Hub (~90MB for all-MiniLM-L6-v2) - Supports sentence-transformers, BGE, E5 model families - Thread-safe inference via RwLock<Session> - Mean pooling and L2 normalization for sentence transformers ## Dependencies (optional) - ort 2.0.0-rc.9 (ONNX Runtime) - tokenizers 0.20 (HuggingFace tokenizers) - hf-hub 0.3 (model downloads) ## Documentation - Updated ADR-114 with implementation details - Updated lib.rs deprecation warning to reference OnnxEmbedding Closes #263 Co-Authored-By: claude-flow <ruv@ruv.net>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
OnnxEmbeddingwith auto-download from HuggingFace HubRwLock<Session>Changes
Cargo.tomlort,tokenizers,hf-hubdeps +onnx-embeddingsfeatureembeddings.rsOnnxEmbeddingstruct (~350 lines)lib.rsOnnxEmbedding, update deprecation warningADR-114Usage
Test plan
cargo check -p ruvector-core --features onnx-embeddingscargo test -p ruvector-core(123 tests pass)cargo clippy -p ruvector-core --features onnx-embeddingscargo publish --dry-run -p ruvector-coreBreaking Changes
None - This is an additive feature behind an optional feature flag.
Closes #264
🤖 Generated with claude-flow