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.0b2

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.0b2
File Size Uploaded Provenance Actions
kv0-0.1.0b2.tar.gz 162.1 kB With provenance Details for kv0-0.1.0b2.tar.gz

Built distributions (wheels)

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

Total release size: 413.5 MB

Release files / kv0-0.1.0b2.tar.gz

Download URL kv0-0.1.0b2.tar.gz
Size 162.1 kB
Tags Source
SHA-256 checksum
How to use checksums
80b5a2ac64e4cfbc33c21bb0527ee17cf9d205acda5fa94a293cb7048c273149
BLAKE2b-256 checksum
How to use checksums
9d2925cb7e0074fb9b5eb8cfa4675cbea163b98061fba2bce72fd18b120497c9
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 15, 2026.

Transparency log

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

Download URL kv0-0.1.0b2-cp311-abi3-musllinux_1_2_x86_64.whl
Size 86.8 MB
Tags CPython 3.11 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
35538a63c05a66b9de974272878268b06032e7191a4b0046e3c35e28f48d3180
BLAKE2b-256 checksum
How to use checksums
b60557a87cf88b1731e7862f899ab36dbb3375f9152dbf6a9d09361a5e3f2c7f
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 15, 2026.

Transparency log

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

Download URL kv0-0.1.0b2-cp311-abi3-manylinux_2_28_x86_64.whl
Size 85.9 MB
Tags CPython 3.11 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
594ae34dbd4b863066d939d942028bc8265b71d5ae7e34dd0bc3a0ac067898b1
BLAKE2b-256 checksum
How to use checksums
95e8f57240ce11e1b47318ba0c446eb51066bd52c95bc6cf95c1e62f0d45bf75
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 15, 2026.

Transparency log

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

Download URL kv0-0.1.0b2-cp311-abi3-manylinux_2_28_aarch64.whl
Size 82.4 MB
Tags CPython 3.11 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
4991955cbce2b784608b542e1863802bda7532d2be51fb4e52b543397ab8e6c6
BLAKE2b-256 checksum
How to use checksums
ff3983dbcd9875994839b1f7f6f74cf4ea3d2ca2cced5eccb044de573b8f34bb
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 15, 2026.

Transparency log

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

Download URL kv0-0.1.0b2-cp311-abi3-macosx_11_0_arm64.whl
Size 76.5 MB
Tags CPython 3.11 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
430fb86c112757482139335ede20fde4cb4104add75e0c4d385ecd9e77268540
BLAKE2b-256 checksum
How to use checksums
d2b6012150c663c3aea11aad2d3b63131931ada50551378f476065a4397dc788
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 15, 2026.

Transparency log

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

Download URL kv0-0.1.0b2-cp311-abi3-macosx_10_12_x86_64.whl
Size 81.8 MB
Tags CPython 3.11 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
184427e3655e1a02830a5359b7a281198013ef0cd50ea02063b96f02a6067b1c
BLAKE2b-256 checksum
How to use checksums
aa1d4b622dc718706ed7c200bc9b85bb04227cccd3ae5d1a6461e3574d6020ae
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 15, 2026.

Transparency log

Security for kv0 0.1.0b2

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.0b2.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 15, 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