30 releases (8 stable)
Uses new Rust 2024
| new 1.3.0 | Apr 7, 2026 |
|---|---|
| 1.2.1 | Feb 18, 2026 |
| 1.1.3 | Jan 8, 2026 |
| 1.1.2 | Sep 8, 2025 |
| 0.3.1 | Jul 30, 2024 |
#478 in Database interfaces
145KB
1K
SLoC

valentinus
A thread-safe vector database for model inference inside LMDB.
dependencies
- wincode/serde - serialize/deserialize
- lmdb-rs - database bindings
- ndarray - numpy equivalent
- ort/onnx - embeddings
getting started
NOTE: ensure you have the development packages below (e.g. for Fedora)
sudo dnf install openssl-develsudo dnf install gcc-c++
git clone https://github.com/kn0sys/valentinus && cd valentinus
optional environment variables
| var | usage | default |
|---|---|---|
LMDB_USER |
working directory of the user for database | $USER |
LMDB_MAP_SIZE |
Sets max environment size, i.e. size in memory/disk of all data | 20% of available memory |
ONNX_PARALLEL_THREADS |
parallel execution mode for this session | 1 |
VALENTINUS_CUSTOM_DIM |
embeddings dimensions for custom models | all-mini-lm-6 -> 384 |
VALENTINUS_LMDB_ENV |
environment for the database (i.e. test, prod) | test |
tests
- Note: all tests currently require the
all-MiniLM-L6-v2_onnxdirectory - Get the model.onnx and tokenizer.json from huggingface or build them
mkdir all-MiniLM-L6-v2_onnx \
&& cd all-MiniLM-L6-v2_onnx \
&& wget https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2/resolve/main/config.json \
&& wget https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2/resolve/main/onnx/model.onnx \
&& wget https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2/resolve/main/special_tokens_map.json \
&& wget https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2/resolve/main/tokenizer_config.json \
&& wget https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2/resolve/main/tokenizer.json \
&& wget https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2/resolve/main/vocab.txt
cargo test
examples
see examples
reference
Dependencies
~31MB
~538K SLoC