lance-bundle
Motto: Embed Once, Query Forever
Main concrete goals:
- Portability - you own your data and embeddings; store them and use them forever into the future
- Reusability - stop embedding the internet; a shared registry allows compressed and indexed knowledge to be used interchangeably
- Provenance - metadata and lineage information to track snapshots and versioning and enable time-travel, debugging, and auditing
Other taglines:
- "stop rembedding the wheel"
Motivating Examples
Add RAG to local LLM with one-liner to load bundle as dataset from Hugging Face:
import ollama
from lance_bundle.runtime import load_dataset
bundle = load_dataset("cloudkj/lance-bundle-mvp")
prompt = "You are a helpful assistant. Answer the question 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)
Implementation Notes
By design, the Sentence Transformers models from HF 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. This is an additional benefit to using this library to import an ONNX-exported sentence transformer for embeddings.
Source pointer for pooling logic:
Discussions:
- https://github.com/huggingface/sentence-transformers/issues/3258
- https://sbert.net/docs/sentence_transformer/usage/efficiency.html#onnx
Datasets
Some datasets for which we can generate embeddings to bootstrap registry:
Ideas
- Vector DB as analytics/OLAP?
- Support operations like "how many documents are related to topic X?" - requires an operation more like
SELECT count(1) WHERE distance(document, query) < threshold - Or clustering operations? ooks like Inverted File Index (IVF) does some clustering
- What about pure aggregations like "what percent of my reviews were negative?"
- Support operations like "how many documents are related to topic X?" - requires an operation more like
- Value-adds:
- snapshot and bundle cersioning, history, provenance. need very detailed audit trail of how snaoshot waa produced to ensure reliable drozen snapshot in time and allow dor rollbacks and time travel ans introspection during tegressions ir changes in behavior
- value add with APi on top: add anayltics aggregation funtionality in top of cector db for more powerful searches, aggregations, etc
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lance_bundle-0.0.2.tar.gz.
File metadata
- Download URL: lance_bundle-0.0.2.tar.gz
- Upload date:
- Size: 15.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8ef8ad2d7df88de501820e19e9f4efd57fed5e4b2d23b346cb21d6efac1e505e
|
|
| MD5 |
67c6b6530e182dd4d0976d5a4401e21f
|
|
| BLAKE2b-256 |
719fb6abe85d525706ffdc41352132a09ab5515509041a29f257de88588c21ef
|
Provenance
The following attestation bundles were made for lance_bundle-0.0.2.tar.gz:
Publisher:
publish.yml on cloudkj/lance-bundle
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lance_bundle-0.0.2.tar.gz -
Subject digest:
8ef8ad2d7df88de501820e19e9f4efd57fed5e4b2d23b346cb21d6efac1e505e - Sigstore transparency entry: 2398340326
- Sigstore integration time:
-
Permalink:
cloudkj/lance-bundle@799145464ee237fdb7efe286ef9521331e02b351 -
Branch / Tag:
refs/tags/v0.0.2 - Owner: https://github.com/cloudkj
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@799145464ee237fdb7efe286ef9521331e02b351 -
Trigger Event:
release
-
Statement type:
File details
Details for the file lance_bundle-0.0.2-py3-none-any.whl.
File metadata
- Download URL: lance_bundle-0.0.2-py3-none-any.whl
- Upload date:
- Size: 11.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
58da122dc4f1f2b5c9bcebc4d95365c415a52e303075ef21bd3ab6169aa91e03
|
|
| MD5 |
eda2f36aaae4660957c40f8449523f42
|
|
| BLAKE2b-256 |
af3e06959fa86d43d2f0bbedeaa03c8322869dc4553cf83e66b1b0086759f6df
|
Provenance
The following attestation bundles were made for lance_bundle-0.0.2-py3-none-any.whl:
Publisher:
publish.yml on cloudkj/lance-bundle
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lance_bundle-0.0.2-py3-none-any.whl -
Subject digest:
58da122dc4f1f2b5c9bcebc4d95365c415a52e303075ef21bd3ab6169aa91e03 - Sigstore transparency entry: 2398340705
- Sigstore integration time:
-
Permalink:
cloudkj/lance-bundle@799145464ee237fdb7efe286ef9521331e02b351 -
Branch / Tag:
refs/tags/v0.0.2 - Owner: https://github.com/cloudkj
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@799145464ee237fdb7efe286ef9521331e02b351 -
Trigger Event:
release
-
Statement type: