Skip to main content

VantaDB × OpenAI

PyO3 cdylib that exposes a VantaDBOpenAI class — wraps OpenAI's embedding API with VantaDB for local vector storage and hybrid search.

Install

Not on PyPI yet. The vantadb-openai wheel builds on all release platforms; it goes live with the first providers-v* tag release. Until then, build from a repo checkout.

From PyPI (after the first release)

pip install vantadb-openai

The OpenAI SDK is installed automatically (openai>=1.0,<2).

From source

Requires Python 3.11+ and the OpenAI SDK. Build the extension with maturin:

pip install openai
maturin develop --release

Quickstart

from vantadb_openai import VantaDBOpenAI

store = VantaDBOpenAI("/tmp/vantadb-openai", api_key="sk-...")
emb = store.embed(["hello world"])
rid = store.store("hello world", emb[0], metadata={"lang": "en"})
results = store.search("openai_store", emb[0], top_k=5)
print(rid, results)

API

Method Signature Description
embed embed(texts) -> list[list[float]] Generate embeddings via OpenAI's API.
store store(text, embedding, metadata=None, key=None) -> str Store a record; returns "<namespace>:<key>". key upserts at a deterministic key, else auto-generated. Metadata values must be str/bool/int/float.
search search(namespace, query_embedding, text_query=None, filters=None, distance_metric=None, top_k=10) -> list[dict] Hybrid vector + BM25 search (distance_metric: "cosine" or "euclidean"/"l2"). Returns full records plus score.
get get(namespace, key) -> dict | None Retrieve a single record, or None if not found.
list list(namespace, limit=100, cursor=None) -> dict Paginated listing: {"records": [...], "next_cursor": int | None}.
delete delete(key, namespace=None) -> bool Delete a record by key; defaults to the instance namespace.
list_namespaces list_namespaces() -> list[str] All namespaces containing at least one record.

Constructor options: VantaDBOpenAI(db_path, api_key, model="text-embedding-3-small", namespace="openai_store", timeout=None).

Metadata

Release files for vantadb-openai 0.8.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for vantadb-openai 0.8.0
File
vantadb_openai-0.8.0-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details
vantadb_openai-0.8.0-cp311-abi3-manylinux_2_28_x86_64.whl CPython 3.11 abi3 Linux glibc 2.28+ x86-64 Details
vantadb_openai-0.8.0-cp311-abi3-manylinux_2_28_aarch64.whl CPython 3.11 abi3 Linux glibc 2.28+ ARM64 Details
vantadb_openai-0.8.0-cp311-abi3-macosx_11_0_arm64.whl CPython 3.11 abi3 macOS 11.0+ ARM64 Details

Total release size: 7.3 MB

Release files / vantadb_openai-0.8.0-cp311-abi3-win_amd64.whl

Download URL vantadb_openai-0.8.0-cp311-abi3-win_amd64.whl
Size 1.6 MB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
9170fefb2b4d80766c578b7cff628eb3c67c31cb8e3354326f04331049024253
BLAKE2b-256 checksum
How to use checksums
de2d6f9ceb0158138be92cb5f5b18c08d689d7b9dc590da3c2d2729325c5a6de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / vantadb_openai-0.8.0-cp311-abi3-manylinux_2_28_x86_64.whl

Download URL vantadb_openai-0.8.0-cp311-abi3-manylinux_2_28_x86_64.whl
Size 2.0 MB
Tags CPython 3.11 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
81771fff03e9a83669d44521621d9b63dc3f2e103262db8177f44ef07e4c2c00
BLAKE2b-256 checksum
How to use checksums
168b7809e5bb9481e38adda91dfbe23c993522bb5140a976cd2ba13a16a97e7d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / vantadb_openai-0.8.0-cp311-abi3-manylinux_2_28_aarch64.whl

Download URL vantadb_openai-0.8.0-cp311-abi3-manylinux_2_28_aarch64.whl
Size 1.9 MB
Tags CPython 3.11 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
3dfaa5f971db84b93b1df3c4078ad4727c81e1b29ab6857a49e0b93ffd9a1a1a
BLAKE2b-256 checksum
How to use checksums
1e2364c0fdf5b312d4285acc43bdb63efa01bbeb3f4e215565d7884ca82ac8a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / vantadb_openai-0.8.0-cp311-abi3-macosx_11_0_arm64.whl

Download URL vantadb_openai-0.8.0-cp311-abi3-macosx_11_0_arm64.whl
Size 1.8 MB
Tags CPython 3.11 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
51d6ee4acd85c400a139c68f3be3a433b175c9fddc68940c1cddbbaaafc89a25
BLAKE2b-256 checksum
How to use checksums
20f88054339aa6be60540a73bc3c3310fdf870210fdb2a26eb69cce5ef970932
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

This release

0.8.0 This release

4 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page