uubed-rs
High-performance Rust core for position-safe embedding encoding (QuadB64 family).
Overview
This repository contains the Rust implementation of the uubed encoding library, providing:
- Q64 Encoding: Core position-safe encoding algorithm
- SIMD Optimizations: AVX2/AVX-512/NEON acceleration for maximum performance
- Zero-Copy Operations: Direct buffer access for minimal overhead
- Multiple Encoding Methods: SimHash, Top-k, Z-order variants
- PyO3 Bindings: High-performance Python integration
Features
- Position-Safe Encoding: Eliminates substring pollution in embeddings
- Multiple Variants: Eq64, Shq64, T8q64, Zoq64 for different use cases
- High Performance: 40-105x speedup over pure Python implementations
- Memory Efficient: Buffer pooling and zero-copy operations
- Cross-Platform: Linux, macOS, Windows support
- Multi-Architecture: x86_64, ARM64 with optimized SIMD
Installation
Install via pip:
pip install uubed-rs
Or build from source:
maturin build --release --features simd
Usage
import uubed_rs
# Basic encoding
data = b"hello world"
encoded = uubed_rs.q64_encode_native(data)
# Zero-copy with buffers
import numpy as np
input_buffer = np.frombuffer(data, dtype=np.uint8)
output_buffer = np.zeros(len(data) * 2, dtype=np.uint8)
written = uubed_rs.q64_encode_inplace_native(input_buffer, output_buffer)
Performance
- Q64 Encoding: Up to 105x faster than Python
- SimHash: 1.7-9.7x speedup with Rust implementation
- Z-order: 60-1600x performance improvement
- Memory Usage: 50-90% reduction through buffer pooling
License
MIT License - see LICENSE file for details.
Related Projects
- uubed - Main project coordination
- uubed-py - Python implementation
- uubed-docs - Comprehensive documentation
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
uubed_rs-0.1.0.tar.gz
(259.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file uubed_rs-0.1.0.tar.gz.
File metadata
- Download URL: uubed_rs-0.1.0.tar.gz
- Upload date:
- Size: 259.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9a3e92b126357d5e94afd005bbcc11d0bc67c8e7130198d5957f1b2e003691db
|
|
| MD5 |
2a884a604d07db9dbc44f3929c9bf776
|
|
| BLAKE2b-256 |
9dce042b33d58576309283e941e1c9b39cbca96a3bfb7e418d1d60c06035b62a
|
File details
Details for the file uubed_rs-0.1.0-py3-none-macosx_10_12_x86_64.whl.
File metadata
- Download URL: uubed_rs-0.1.0-py3-none-macosx_10_12_x86_64.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 3, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e677b433345ada230e324ac8b5f58e2559e5461bf25a7c096149b8071454dea7
|
|
| MD5 |
e54de49e53f84adcc0a281abc854e220
|
|
| BLAKE2b-256 |
42e43b2cfe96ef86ba2a425d72f41b5ade62c365b826714afc888997e8396ac1
|