Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

kv0: an ordered key-value store on Lance, on any object store

An ordered key-value store and experiment-tracking tables on Lance.
One embedded engine for a local disk, S3, Google Cloud Storage and Azure, from Rust and Python.

Docs · Getting started · Concepts · Benchmarks · Changelog

kv0 is in beta: the API may still change before 0.1.0.

kv0 is a library, not a server. Open a database by path or URI and you have an ordered key-value store: keys sort byte-wise, WriteBatches commit atomically, and iterators seek and seek_for_prev. Next to it, typed tables for runs, parameters and metric series hold an experiment tracker's data on the same storage.

Why kv0

  • One engine on every backend. Data is a Lance dataset, so the same code runs on a laptop and straight on a bucket. No sync daemon, no storage protocol of its own.
  • Several writers, no coordinator. Processes on one machine or many append at once; every commit is an atomic, versioned Lance commit, and any version can be opened again.
  • A write survives a killed process. It is in a local write-ahead log before the call returns, and the next open replays what was not committed yet.
  • Memory and open time stay bounded. One compact entry per key in memory, values over 4 KiB left in Lance, and a view snapshot that opens 10M keys in 0.7 s.
  • Measured, regressions included. Every number below links to its table and method.

Install

pip install kv0          # Python 3.11+; until the first release: maturin develop --release
cargo add kv0            # Rust; building needs protoc (protobuf-compiler, libprotobuf-dev)

Quickstart

import kv0

db = kv0.DB("/tmp/example_db")             # or "s3://bucket/prefix/db", storage_options={...}

batch = kv0.WriteBatch()
batch.put(b"run/7/loss/0001", b"0.31")
batch.put(b"run/7/loss/0002", b"0.25")
db.write(batch)                             # atomic; visible now, committed in the background

it = db.iteritems()
it.seek(b"run/7/")
for key, value in it:
    print(key, value)

db.close()                                  # commits what is buffered
use kv0::kv::{Db, Options, WriteBatch};

let db = Db::open("/tmp/example_db", Options::default())?;
let mut batch = WriteBatch::new();
batch.put(b"run/7/loss/0001", b"0.31").put(b"run/7/loss/0002", b"0.25");
db.write(batch)?;

let mut it = db.iter();
it.seek(b"run/7/");
for (key, value) in it {
    println!("{key:?} = {value:?}");
}
db.close()?;

Tracking tables, from Python or with an async Rust API for servers:

from kv0.tracking import Repo

repo = Repo("s3://bucket/tracking")
with repo.create_run(name="baseline", experiment="demo") as run:
    run["hparams"] = {"lr": 3e-4}
    for step in range(1000):
        run.track(1.0 / (step + 1), name="loss", context={"subset": "train"})

repo.metric(run.id, "loss", context={"subset": "train"}, start=900, stop=1000)

Benchmarks

One machine (i5-13500, NVMe), local disk, medians of five runs; a difference counts only when the ranges do not overlap and the medians differ by more than 20%.

Before the memory work Now
Reopen 1M / 10M keys 451 ms / 5.57 s 74 ms / 705 ms
Memory after reopen, 1M / 10M keys 547 MB / 3.1 GB 151 MB / 1.0 GB
100k × 16 KiB values: reopen 886 ms, 2.6 GB 20 ms, 90 MB
Seek + 100 × next, p50 25 µs 11 µs
Crash recovery, 200k unflushed puts 173 ms 218 ms (worse)

bench/MEMORY-REPORT.md has every cell; bench/REPORT.md compares kv0 with a SQLite-cache baseline on writes (51× more puts per second on the tracker workload), reads, scans, S3 requests and crash recovery, and names where kv0 is worse.

Documentation

  • Docs: getting started, concepts, guides, FAQ.
  • DESIGN.md: storage format, durability, compaction, concurrency, rejected alternatives.
  • CONTRIBUTING.md: development setup and tests.
  • brand/DESIGN.md: the mark, colours and type.

License

Apache License 2.0.

Metadata

Release files for kv0 0.1.0b1

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

Source distribution (sdist)

Source distribution for kv0 0.1.0b1
File Size Uploaded Provenance Actions
kv0-0.1.0b1.tar.gz 160.6 kB With provenance Details for kv0-0.1.0b1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for kv0 0.1.0b1
File Actions
kv0-0.1.0b1-cp311-abi3-musllinux_1_2_x86_64.whl CPython 3.11 abi3 Linux musl 1.2+ x86-64 Details for kv0-0.1.0b1-cp311-abi3-musllinux_1_2_x86_64.whl
kv0-0.1.0b1-cp311-abi3-manylinux_2_28_x86_64.whl CPython 3.11 abi3 Linux glibc 2.28+ x86-64 Details for kv0-0.1.0b1-cp311-abi3-manylinux_2_28_x86_64.whl
kv0-0.1.0b1-cp311-abi3-manylinux_2_28_aarch64.whl CPython 3.11 abi3 Linux glibc 2.28+ ARM64 Details for kv0-0.1.0b1-cp311-abi3-manylinux_2_28_aarch64.whl
kv0-0.1.0b1-cp311-abi3-macosx_11_0_arm64.whl CPython 3.11 abi3 macOS 11.0+ ARM64 Details for kv0-0.1.0b1-cp311-abi3-macosx_11_0_arm64.whl
kv0-0.1.0b1-cp311-abi3-macosx_10_12_x86_64.whl CPython 3.11 abi3 macOS 10.12+ x86-64 Details for kv0-0.1.0b1-cp311-abi3-macosx_10_12_x86_64.whl

Total release size: 437.8 MB

Release files / kv0-0.1.0b1.tar.gz

Download URL kv0-0.1.0b1.tar.gz
Size 160.6 kB
Tags Source
SHA-256 checksum
How to use checksums
78b899f989f984332530874ec209fd597e0d81ad15de06f122d6f41bb8a4f233
BLAKE2b-256 checksum
How to use checksums
999b6fb2f582981a888a32fc140030fc63af0e100589f4e6bbf9601078e4f6f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.

Transparency log

Release files / kv0-0.1.0b1-cp311-abi3-musllinux_1_2_x86_64.whl

Download URL kv0-0.1.0b1-cp311-abi3-musllinux_1_2_x86_64.whl
Size 86.7 MB
Tags CPython 3.11 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
b4c43dc1c5d6274d9a51d8cf49262601c9d19a043417285c451cf1e2fdc3b222
BLAKE2b-256 checksum
How to use checksums
524b70e3fbb3e1cc747fadee97f72204e7dcef8f102771c46ece9191938def32
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.

Transparency log

Release files / kv0-0.1.0b1-cp311-abi3-manylinux_2_28_x86_64.whl

Download URL kv0-0.1.0b1-cp311-abi3-manylinux_2_28_x86_64.whl
Size 85.8 MB
Tags CPython 3.11 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
f0a3a685ddc4c6ec5c1a95502261557d61fefcd77bf501d3697676660a2bbb4b
BLAKE2b-256 checksum
How to use checksums
8418d34b5156628479284a38aed5ad9a693faed5e230ab6c451b60647f39e5ba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.

Transparency log

Release files / kv0-0.1.0b1-cp311-abi3-manylinux_2_28_aarch64.whl

Download URL kv0-0.1.0b1-cp311-abi3-manylinux_2_28_aarch64.whl
Size 82.3 MB
Tags CPython 3.11 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
63d0caa29cc66c950f06ac5d5b563cf24ba7e44e3cd1c09b88286b12c8d11255
BLAKE2b-256 checksum
How to use checksums
82fd707c790cc7e13dd04c5e4d4e789a921d27ab39f787bb15168e56d0d800b2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.

Transparency log

Release files / kv0-0.1.0b1-cp311-abi3-macosx_11_0_arm64.whl

Download URL kv0-0.1.0b1-cp311-abi3-macosx_11_0_arm64.whl
Size 89.3 MB
Tags CPython 3.11 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
6f838436c20c6d3655d5bf1079da34d981094bdf34140ded77c2f7692f6791c8
BLAKE2b-256 checksum
How to use checksums
802397f625f2ae28c8e1f934b21719caffe3a1a1c3fe0ada41cf71a7b4ce6872
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.

Transparency log

Release files / kv0-0.1.0b1-cp311-abi3-macosx_10_12_x86_64.whl

Download URL kv0-0.1.0b1-cp311-abi3-macosx_10_12_x86_64.whl
Size 93.5 MB
Tags CPython 3.11 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
0db5423f894ca607bf37888ffa7e60366996afd2272dc15cc31d22793921ce3d
BLAKE2b-256 checksum
How to use checksums
d6d2a8579c72b40f6ac94e89e9d0fc041067d74a65b65355054babe3fb2be3e7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.

Transparency log

Security for kv0 0.1.0b1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for kv0-0.1.0b1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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