lance-bundle - Portable Embeddings
Embed Once, Query Forever
lance-bundle packages embedding vectors and the model that produced them into a single portable file - load it
and query it anywhere, with no server, no database to run, and no re-embedding your data on a new machine. Built on
LanceDB and ONNX for a minimal dependency footprint, it's equally at home embedded in an app, on the edge, or in a
local script.
Usage
Loading Bundles
Install: pip install lance-bundle
If loading bundles from Hugging Face: pip install lance-bundle[hub]
Import and load locally or from readily available embedding datasets (huggingface.co/lance-bundle):
from lance_bundle import load_dataset
bundle = load_dataset("lance-bundle/berkshire-hathaway-letters")
bundle.search("What does Warren Buffett think of Coca-Cola and car insurance?")
Exporting Bundles
Install: pip install lance-bundle[export]
Export documents and embeddings to a local archive file (zip), then load as needed for queries:
from lance_bundle import load, save, ExportDataset
from sentence_transformers import SentenceTransformer
documents = [
"Quantum mechanics is the foundation of modern physics.",
"Photosynthesis allows plants to convert sunlight into food.",
"I love eating pepperoni pizza on Fridays.",
]
model = SentenceTransformer("sentence-transformers/all-MiniLM-L6-v2")
save(model, ExportDataset(texts=documents, vectors=model.encode(documents)), "bundle.zip")
# ...
bundle = load("bundle.zip")
bundle.search("I'm hungry for some science")
Local RAG Example
Add RAG to a local LLM by loading a precomputed bundled embedding dataset (huggingface.co/lance-bundle). Example using Ollama:
from lance_bundle import load_dataset
import ollama
bundle = load_dataset("lance-bundle/paul-graham-essays")
prompt = "You are a Silicon Valley angel investor and venture capitalist. Provide advice and answers based ONLY on the provided context. If the answer cannot be found in the context, say 'I don't know'. Context: {context} Question: {query}"
while True:
print("> ", end="")
query = input()
context = bundle.search(query, limit=1)[0]['text']
response = ollama.chat(
model='llama3.2:1b',
messages=[{'role': 'user', 'content': prompt.format(context=context, query=query)}]
)
print(response.message.content)
CLI
# Download a bundle from the Hugging Face dataset registry
lance-bundle download lance-bundle/berkshire-hathaway-letters -o berkshire.zip
# Inspect a bundle's metadata (model, dataset, provenance)
lance-bundle inspect berkshire.zip
# Search a bundle without writing any Python
lance-bundle search berkshire.zip "What does Buffett think of Coca-Cola?" --limit 10 --json
Design
Goals
- Portability: you own your data and embeddings; store and search them forever into the future
- Reusability: stop re-embedding the internet; a shared dataset registry allows compressed and indexed knowledge to be used interchangeably
- Provenance: each self-contained bundle contains metadata, lineage, and the exact model artifact used for generating the data
Implementation
The initial version of lance-bundle is limited to support for SentenceTransformer embedding models and embedding
vectors stored in LanceDB. While these underlying technologies may change in the future, the aim will always be to
preserve the spirit of the portable, forwards-compatible design of lance-bundle and allow for supporting new and
different ways of computing, storing, and searching embeddings.
Sentence Transformer
By design, the Sentence Transformers models from Hugging Face are exported to ONNX with only the transformers modules. The
pooling and normalization modules are not included in the export, and thus need to be applied as a post-processing step;
lance-bundle ensures that the post-processing pooling and normalization steps are also included as part of the
portable package.
See:
- https://github.com/huggingface/sentence-transformers/issues/3258
- https://sbert.net/docs/sentence_transformer/usage/efficiency.html#onnx
License
MIT
Metadata
Release files for lance-bundle 0.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| lance_bundle-0.0.4.tar.gz | 16.9 kB | With provenance | Details for lance_bundle-0.0.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| lance_bundle-0.0.4-py3-none-any.whl | Python 3 | none | any | Details for lance_bundle-0.0.4-py3-none-any.whl |
Total release size: 30.0 kB
Release files / lance_bundle-0.0.4.tar.gz
| Download URL | lance_bundle-0.0.4.tar.gz |
|---|---|
| Size | 16.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f6b4f41ba02ecfa4bde07d7eeb489a82bad4e77a70ded3aa749e3d1cf2e507c6
|
|
BLAKE2b-256 checksum How to use checksums |
a7fa4ed66ed0e544e14151fc5882ea8841989287fe42fde20e8688a876140cc4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Aug 11, 2026.
Transparency logRelease files / lance_bundle-0.0.4-py3-none-any.whl
| Download URL | lance_bundle-0.0.4-py3-none-any.whl |
|---|---|
| Size | 13.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
378191d398bf61977bea0dc6a7ef7c52317e706a6ee9e845be84a4e2b772799b
|
|
BLAKE2b-256 checksum How to use checksums |
05b2affd0f28b0d17795e892519d306d20ba4e9330aa870c1de9c047f39f5b98
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Aug 11, 2026.
Transparency logSecurity for lance-bundle 0.0.4
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 2 files in this release have been uploaded with provenance metadata.
Attestation for lance_bundle-0.0.4.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 Aug 11, 2026.
Transparency logA 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.