lnmp-embedding
Native vector embedding support for the LNMP protocol.
This crate provides the core data structures and logic for handling vector embeddings within LNMP, enabling efficient storage, transport, and processing of high-dimensional vectors for AI and ML applications.
Features
- Multiple Data Types: Supports
F32,F16,I8,U8, andBinaryembeddings. - Similarity Metrics: Built-in calculation for Cosine Similarity, Euclidean Distance, and Dot Product.
- ** efficient Serialization**: Optimized binary format for minimal overhead.
Usage
use ;
// Create a vector from f32 data
let v1 = from_f32;
let v2 = from_f32;
// Calculate similarity
let similarity = v1.similarity.unwrap;
assert_eq!;
Integration
This crate is designed to be used with lnmp-core and the LNMP SDKs. It is the underlying implementation for the Embedding mode (0x06) and LnmpValue::Embedding variant.