Skip to content

Commit 114a8d8

Browse files
committed
docs: Add ONNX Embeddings section to README
Added documentation for the new ruvector-onnx-embeddings example: - Production-ready ONNX embedding generation in pure Rust - Supports 8+ pretrained models (all-MiniLM, BGE, E5, GTE) - GPU acceleration (CUDA, TensorRT, CoreML, WebGPU) - Code example for basic usage - Model comparison table
1 parent 6e4e0a5 commit 114a8d8

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,43 @@ scipix-cli mcp
291291
claude mcp add scipix -- scipix-cli mcp
292292
```
293293

294+
### ONNX Embeddings
295+
296+
| Example | Description | Path |
297+
|---------|-------------|------|
298+
| [ruvector-onnx-embeddings](./examples/onnx-embeddings) | Production-ready ONNX embedding generation in pure Rust | `examples/onnx-embeddings` |
299+
300+
**ONNX Embeddings** provides native embedding generation using ONNX Runtime — no Python required. Supports 8+ pretrained models (all-MiniLM, BGE, E5, GTE), multiple pooling strategies, GPU acceleration (CUDA, TensorRT, CoreML, WebGPU), and direct RuVector index integration for RAG pipelines.
301+
302+
```rust
303+
use ruvector_onnx_embeddings::{Embedder, PretrainedModel};
304+
305+
#[tokio::main]
306+
async fn main() -> anyhow::Result<()> {
307+
// Create embedder with default model (all-MiniLM-L6-v2)
308+
let mut embedder = Embedder::default_model().await?;
309+
310+
// Generate embedding (384 dimensions)
311+
let embedding = embedder.embed_one("Hello, world!")?;
312+
313+
// Compute semantic similarity
314+
let sim = embedder.similarity(
315+
"I love programming in Rust",
316+
"Rust is my favorite language"
317+
)?;
318+
println!("Similarity: {:.4}", sim); // ~0.85
319+
320+
Ok(())
321+
}
322+
```
323+
324+
**Supported Models:**
325+
| Model | Dimension | Speed | Best For |
326+
|-------|-----------|-------|----------|
327+
| `AllMiniLmL6V2` | 384 | Fast | General purpose (default) |
328+
| `BgeSmallEnV15` | 384 | Fast | Search & retrieval |
329+
| `AllMpnetBaseV2` | 768 | Accurate | Production RAG |
330+
294331
### Bindings & Tools
295332

296333
| Crate | Description | crates.io |

0 commit comments

Comments
 (0)