DuckDB 集成需 v0.7+,否则可能 segfault;生产数据应写入稳定的 data_storage_version,next 别名仅用于实验;对象存储需按 URI scheme 配置对应凭据
lance
lance-formatApache-2.0活跃维护面向多模态 AI 的开放湖仓数据格式,两行代码即可从 Parquet 转换,实现百倍随机访问加速、向量索引和数据版本管理,兼容 Pandas、DuckDB、PyTorch 等生态。
Open Lakehouse Format for Multimodal AI. Convert from Parquet in 2 lines of code for 100x faster random access, vector index, and data versioning. Compatible with Pandas, DuckDB, Polars, Pyarrow, and PyTorch with more integrations coming..
pip install pylanceREADME 未说明显存或 GPU 要求;基准测试在 2023 款 m2 MacBook Air 上完成,说明可在普通笔记本上运行
面向多模态 AI 的开源湖仓格式,用两行代码从 Parquet 转换,解决随机访问慢和向量检索问题
面向多模态 AI 的开放湖仓数据格式,两行代码即可从 Parquet 转换,实现百倍随机访问加速、向量索引和数据版本管理,兼容 Pandas、DuckDB、PyTorch 等生态。
核心能力
- 用 IVF_PQ 索引在数据集上做向量相似度检索
- 混合向量检索、BM25 全文检索与 SQL 分析
- 随机访问比 Parquet 和 Iceberg 快 100 倍
- 统一存储图像、视频、音频、文本与向量并支持懒加载
- 零拷贝版本管理,支持 ACID、时间旅行、标签与分支
容易踩的坑
- v15.0.0-beta.15pre-release最新正式版2026-11-09 · 2026-11-09 17:56 UTC
What's Changed
Bug Fixes 🐛
- fix(ci): use a larger runner for java release builds by @BubbleCal in https://github.com/lance-format/lance/pull/10835
- fix(table): copy metadata size in DataReplacement by @geruh in https://github.com/lance-format/lance/pull/10842
Performance Improvements 🚀
- perf(rowids): compact and reuse prepared row id lookups by @BubbleCal in https://github.com/lance-format/lance/pull/10799
- perf(index): overlap native RaBitQ plane prewarm by @BubbleCal in https://github.com/lance-format/lance/pull/10843
- perf: load deletion vectors concurrently when computing row offsets by @LuciferYang in https://github.com/lance-format/lance/pull/10864
- perf: apply the MapIndexExec deletion mask without copying it by @LuciferYang in https://github.com/lance-format/lance/pull/10865
Other Changes
- refactor(index): make coverage provenance pure and unit-testable by @wjones127 in https://github.com/lance-format/lance/pull/10819
- feat: plan expressions against a caller's DataFusion session by @wkalt in https://github.com/lance-format/lance/pull/10869
Full Changelog: https://github.com/lance-format/lance/compare/v15.0.0-beta.14...v15.0.0-beta.15
- v15.0.0-beta.14pre-release2026-11-08 · 2026-11-08 03:07 UTC
查看更新说明
What's Changed
New Features 🎉
- feat(index): change JSON scalar index to row-address domain by @westonpace in https://github.com/lance-format/lance/pull/9856
- feat: expose a public plan for rewriting batches with Blob v2 columns by @LuQQiu in https://github.com/lance-format/lance/pull/10724
Bug Fixes 🐛
- fix(merge-insert): detect concurrent fixed-size binary inserts by @app/lance-gatefixer in https://github.com/lance-format/lance/pull/10813
- fix(index): reuse JSON target state across request stores by @BubbleCal in https://github.com/lance-format/lance/pull/10831
Performance Improvements 🚀
- perf(fts): limit tail decode batches and stream matching counts by @BubbleCal in https://github.com/lance-format/lance/pull/10812
Full Changelog: https://github.com/lance-format/lance/compare/v15.0.0-beta.13...v15.0.0-beta.14
- v15.0.0-beta.13pre-release2026-11-06 · 2026-11-06 22:54 UTC
查看更新说明
What's Changed
Bug Fixes 🐛
- fix(exec): keep the planner's field metadata in top-k late materialization by @vivek-bharathan in https://github.com/lance-format/lance/pull/10804
Performance Improvements 🚀
- perf(io): single-flight concurrent builds of the same object store key by @luma-shangma in https://github.com/lance-format/lance/pull/10770
- perf(select): avoid redundant scalar prefilter mask work by @BubbleCal in https://github.com/lance-format/lance/pull/10798
Full Changelog: https://github.com/lance-format/lance/compare/v15.0.0-beta.12...v15.0.0-beta.13
- v15.0.0-beta.12pre-release2026-11-06 · 2026-11-06 05:08 UTC
查看更新说明
What's Changed
Breaking Changes 🛠
- refactor!: move the R-tree geo index from lance-index into lance-geo by @wombatu-kun in https://github.com/lance-format/lance/pull/10579
New Features 🎉
- feat(datafusion): support FLOOR, CEIL, and SQL-standard SUBSTRING filters by @notAarushi019 in https://github.com/lance-format/lance/pull/9584
- feat(dataset): expose file reader defaults by @BubbleCal in https://github.com/lance-format/lance/pull/10786
Bug Fixes 🐛
- fix(rowids): move the row id index to the index cache by @BubbleCal in https://github.com/lance-format/lance/pull/10772
Performance Improvements 🚀
- perf(index): keep the scalar index for an OR when a branch needs a refine by @jackylee-ch in https://github.com/lance-format/lance/pull/10583
Full Changelog: https://github.com/lance-format/lance/compare/v15.0.0-beta.11...v15.0.0-beta.12
- v15.0.0-beta.11pre-release2026-11-05 · 2026-11-05 18:44 UTC
查看更新说明
What's Changed
Breaking Changes 🛠
- feat(io): let callers supply the HTTP connector native cloud stores use by @schmidt-jake in https://github.com/lance-format/lance/pull/10471
- feat(index)!: add IVF_HNSW_RQ vector index by @cwj0bzxg in https://github.com/lance-format/lance/pull/10522
- fix(compaction): skip byte-full files by default with a configurable threshold by @majin1102 in https://github.com/lance-format/lance/pull/10681
- fix(dataset): reject deleted branch writes and checkouts by @app/lance-gatefixer in https://github.com/lance-format/lance/pull/10736
- feat(java)!: support bounded vector index consolidation by @ddupg in https://github.com/lance-format/lance/pull/10755
- perf(scan): skip element payloads for list length expressions by @BubbleCal in https://github.com/lance-format/lance/pull/10759
- fix(scan)!: preserve list structure reads across plan transport by @BubbleCal in https://github.com/lance-format/lance/pull/10766
Critical Fixes ‼️
- fix(dataset): reject orphaned versions during branch creation by @app/lance-gatefixer in https://github.com/lance-format/lance/pull/10737
New Features 🎉
- feat(index): add ordered search to the B-tree index by @Ali2Arslan in https://github.com/lance-format/lance/pull/10346
- feat(python): bind parameters in dataset SQL queries by @app/lance-gatefixer in https://github.com/lance-format/lance/pull/10439
- feat: opt-in process memory metrics with index build peaks by @wombatu-kun in https://github.com/lance-format/lance/pull/10451
- feat(search): calibrate recall targets by metric and k by @BubbleCal in https://github.com/lance-format/lance/pull/10695
Bug Fixes 🐛
- fix(fts): score phrase queries against the whole corpus by @jackylee-ch in https://github.com/lance-format/lance/pull/10547
- fix: count deleted rows when making a column non-nullable by @LuciferYang in https://github.com/lance-format/lance/pull/10557
- fix: refuse to commit data overlay files a build cannot read back by @LuciferYang in https://github.com/lance-format/lance/pull/10560
- fix(index): reject with_position for ngram FTS indexes at creation by @LuciferYang in https://github.com/lance-format/lance/pull/10575
- fix: stop opening a damaged manifest as an empty dataset by @wombatu-kun in https://github.com/lance-format/lance/pull/10585
- fix: tolerate concurrent branch deletes in listing and cleanup by @app/lance-gatefixer in https://github.com/lance-format/lance/pull/10735
- fix(index): search the RTree when its stored bounding box cannot be parsed by @LuciferYang in https://github.com/lance-format/lance/pull/10747
Documentation 📚
- docs(python): clarify asof fallback after version cleanup by @app/lance-gatefixer in https://github.com/lance-format/lance/pull/10500
Performance Improvements 🚀
- perf: cache the address-based deletion mask per dataset version by @HeartLinked in https://github.com/lance-format/lance/pull/10404
- perf(cache): reuse prepared keys and immediate reads by @BubbleCal in https://github.com/lance-format/lance/pull/10419
- perf(encoding): avoid redundant batch copies in variable-width full-zip decoding by @zhangyue19921010 in https://github.com/lance-format/lance/pull/10495
- perf(encoding): compress the values of a large page on several threads by @dshepelev15 in https://github.com/lance-format/lance/pull/10531
- perf(exec): publish the scan timers through the metrics facade by @dshepelev15 in https://github.com/lance-format/lance/pull/10539
- perf(index): answer the FTS row-order check from a cached invalid verdict by @LuciferYang in https://github.com/lance-format/lance/pull/10553
Other Changes
- refactor: split io/commit/conflict_resolver.rs into submodules by @zhangyue19921010 in https://github.com/lance-format/lance/pull/10146
- refactor(index): remove the unreachable local-IDF branch and force_global_scorer by @LuciferYang in https://github.com/lance-f
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
The Open Lakehouse Format for Multimodal AI High-performance vector search, full-text search, random access, and feature engineering capabilities for the lakehouse. Compatible with Pandas, DuckDB, Polars, PyArrow, Ray, Spark, and more integrations on the way.
Documentation • Community • Discord • Mailing List
Lance is an open lakehouse format for multimodal AI. It contains a file format, table format, and catalog spec that allows you to build a complete lakehouse on top of object storage to power your AI workflows. Lance is perfect for:
- Building search engines and feature stores with hybrid search capabilities.
- Large-scale ML training requiring high performance IO and random access.
- Storing, querying, and managing multimodal data including images, videos, audio, text, and embeddings.
The key features of Lance include:
-
Expressive hybrid search: Combine vector similarity search, full-text search (BM25), and SQL analytics on the same dataset with accelerated secondary indices.
-
Lightning-fast random access: 100x faster than Parquet or Iceberg for random access without sacrificing scan performance.
-
Native multimodal data support: Store images, videos, audio, text, and embeddings in a single unified format with efficient blob encoding and lazy loading.
-
Data evolution: Efficiently add columns with backfilled values without full table rewrites, perfect for ML feature engineering.
-
Zero-copy versioning: Automatic versioning with ACID transactions, time travel, tags, and branches—no extra infrastructure needed.
-
Rich ecosystem integrations: Apache Arrow, Pandas, Polars, DuckDB, Apache Spark, Ray, Trino, Apache Flink, and open catalogs (Apache Polaris, Unity Catalog, Apache Gravitino).
For more details, see the full Lance format specification.
[!TIP] Lance is in active development and we welcome contributions. Please see our contributing guide for more information.
File format stability
Lance releases frequently because the SDKs, integrations, and performance work are moving quickly. This does not mean the Lance file format changes incompatibly in every release. The Lance file format is identified by the data_storage_version stored in each dataset, and stable storage versions are a long-term compatibility contract.
- Once a dataset is written with a stable
data_storage_version, future Lance releases will continue to support reading that storage version. - SDK and API compatibility is separate from file format compatibility. SDK/API changes follow semantic versioning and are documented in the migration guide.
- Older Lance releases may not understand file format versions introduced later. If you run mixed Lance versions, pin
data_storage_versionfor deterministic writes. - The
nextfile format alias is unstable and should only be used for experimentation, never for production data.
For production, write data with a stable data_storage_version. See the format versioning guide for the current compatibility matrix.
Quick Start
Installation
pip install pylance
To install a preview release:
pip install --pre --extra-index-url https://pypi.fury.io/lance-format pylance
[!TIP] Preview releases are released more often than full releases and contain the latest features and bug fixes. They receive the same level of testing as full releases. We guarantee they will remain published and available for download for at least 6 months. When you want to pin to a specific version, prefer a stable release.
Converting to Lance
import lance
import pandas as pd
import pyarrow as pa
import pyarrow.dataset
df = pd.DataFrame({"a": [5], "b": [10]})
uri = "/tmp/test.parquet"
tbl = pa.Table.from_pandas(df)
pa.dataset.write_dataset(tbl, uri, format='parquet')
parquet = pa.dataset.dataset(uri, format='parquet')
lance.write_dataset(parquet, "/tmp/test.lance")
Reading Lance data
dataset = lance.dataset("/tmp/test.lance")
assert isinstance(dataset, pa.dataset.Dataset)
Pandas
df = dataset.to_table().to_pandas()
df
DuckDB
import duckdb
# If this segfaults, make sure you have duckdb v0.7+ installed
duckdb.query("SELECT * FROM dataset LIMIT 10").to_df()
Vector search
Download the sift1m subset
wget ftp://ftp.irisa.fr/local/texmex/corpus/sift.tar.gz
tar -xzf sift.tar.gz
Convert it to Lance
import lance
from lance.vector import vec_to_table
import numpy as np
import struct
nvecs = 1000000
ndims = 128
with open("sift/sift_base.fvecs", mode="rb") as fobj:
buf = fobj.read()
data = np.array(struct.unpack("<128000000f", buf[4 : 4 + 4 * nvecs * ndims])).reshape((nvecs, ndims))
dd = dict(zip(range(nvecs), data))
table = vec_to_table(dd)
uri = "vec_data.lance"
sift1m = lance.write_dataset(table, uri, max_rows_per_group=8192, max_rows_per_file=1024*1024)
Build the index
sift1m.create_index("vector",
index_type="IVF_PQ",
num_partitions=256, # IVF
num_sub_vectors=16) # PQ
Search the dataset
# Get top 10 similar vectors
import duckdb
dataset = lance.dataset(uri)
# Sample 100 query vectors. If this segfaults, make sure you have duckdb v0.7+ installed
sample = duckdb.query("SELECT vector FROM dataset USING SAMPLE 100").to_df()
query_vectors = np.array([np.array(x) for x in sample.vector])
# Get nearest neighbors for all of them
rs = [dataset.to_table(nearest={"column": "vector", "k": 10, "q": q})
for q in query_vectors]
Directory structure
| Directory | Description |
|---|---|
| rust | Core Rust implementation |
| python | Python bindings (PyO3) |
| java | Java bindings (JNI) |
| docs | Documentation source |
Benchmarks
Vector search
We used the SIFT dataset to benchmark our results with 1M vectors of 128D
- For 100 randomly sampled query vectors, we get <1ms average response time (on a 2023 m2 MacBook Air)

- ANNs are always a trade-off between recall and performance

Vs. parquet
We create a Lance dataset using the Oxford Pet dataset to do some preliminary performance testing of Lance as compared to Parquet and raw image/XMLs. For analytics queries, Lance is 50-100x better than reading the raw metadata. For batched random access, Lance is 100x better than both parquet and raw files.

Why Lance for AI/ML workflows?
The machine learning development cycle involves multiple stages:
graph LR
A[Collection] --> B[Exploration];
B --> C[Analytics];
C --> D[Feature Engineer];
D --> E[Training];
E --> F[Evaluation];
F --> C;
E --> G[Deployment];
G --> H[Monitoring];
H --> A;
Traditional lakehouse formats were designed for SQL analytics and struggle with AI/ML workloads that require:
- Vector search for similarity and semantic retrieval
- Fast random access for sampling and interactive exploration
- Multimodal data storage (images, videos, audio alongside embeddings)
- Data evolution for feature engineering without full table rewrites
- Hybrid search combining vectors, full-text, and SQL predicates
While existing formats (Parquet, Iceberg, Delta Lake) excel at SQL analytics, they require additional specialized systems for AI capabilities. Lance brings these AI-first features directly into the lakehouse format.
A comparison of different formats across ML development stages:
| Lance | Parquet & ORC | JSON & XML | TFRecord | Database | Warehouse | |
|---|---|---|---|---|---|---|
| Analytics | Fast | Fast | Slow | Slow | Decent | Fast |
| Feature Engineering | Fast | Fast | Decent | Slow | Decent | Good |
| Training | Fast | Decent | Slow | Fast | N/A | N/A |
| Exploration | Fast | Slow | Fast | Slow | Fast | Decent |
| Infra Support | Rich | Rich | Decent | Limited | Rich | Rich |
Supported Storage
Lance reads and writes datasets stored on local disk or in object storage. The storage backend is selected automatically by the URI scheme of the dataset path.
| Storage | URI scheme | Notes |
|---|---|---|
| Local filesystem | file:// | Default; also accepts plain paths. file+uring:// (Linux only) uses io_uring for better local I/O performance. |
| AWS S3 | s3:// | Supports S3 Express One Zone buckets. Use s3+ddb:// to version datasets with DynamoDB-managed metadata. |
| S3-compatible stores | s3:// | MinIO, Cloudflare R2, Wasabi, and other S3-compatible stores via the endpoint storage option. |
| Microsoft Azure Blob Storage | az:// | Also supports Azure Data Lake Storage Gen2 via abfss://. |
| Google Cloud Storage | gs:// | |
| Alibaba Cloud Object Storage Service | oss:// | |
| Tencent Cloud Object Storage | cos:// | |
| Volcengine Object Storage (TOS) | tos:// | |
| Hugging Face Hub | hf:// | |
| GooseFS | goosefs:// | |
| In-memory | memory:// | Intended for testing only. |
For credentials, authentication, and per-store configuration options, see the object store configuration guide.