SIE integration for Qdrant
Project description
sie-qdrant
SIE integration for Qdrant.
Installation
pip install sie-qdrant
Dense embeddings
from qdrant_client import QdrantClient
from qdrant_client.models import Distance, VectorParams, PointStruct
from sie_qdrant import SIEVectorizer
vectorizer = SIEVectorizer(base_url="http://localhost:8080", model="BAAI/bge-m3")
qdrant = QdrantClient("http://localhost:6333")
qdrant.create_collection(
collection_name="documents",
vectors_config=VectorParams(size=1024, distance=Distance.COSINE),
)
texts = ["first doc", "second doc"]
vectors = vectorizer.embed_documents(texts)
qdrant.upsert(
collection_name="documents",
points=[
PointStruct(id=i, vector=v, payload={"text": t})
for i, (t, v) in enumerate(zip(texts, vectors))
],
)
query_vec = vectorizer.embed_query("search text")
results = qdrant.query_points(
collection_name="documents", query=query_vec, limit=5
)
Named vectors (dense + sparse)
SIE's multi-output encode produces dense and sparse vectors in one call.
Qdrant supports sparse vectors natively via SparseVector(indices, values),
so no expansion to full vocabulary length is needed:
from qdrant_client import QdrantClient
from qdrant_client.models import (
Distance, VectorParams, PointStruct,
SparseVectorParams, SparseVector,
)
from sie_qdrant import SIENamedVectorizer
vectorizer = SIENamedVectorizer(
base_url="http://localhost:8080",
model="BAAI/bge-m3",
output_types=["dense", "sparse"],
)
qdrant = QdrantClient("http://localhost:6333")
qdrant.create_collection(
collection_name="documents",
vectors_config={"dense": VectorParams(size=1024, distance=Distance.COSINE)},
sparse_vectors_config={"sparse": SparseVectorParams()},
)
named = vectorizer.embed_documents(["hello world"])
qdrant.upsert(
collection_name="documents",
points=[
PointStruct(
id=0,
vector={
"dense": named[0]["dense"],
"sparse": SparseVector(**named[0]["sparse"]),
},
payload={"text": "hello world"},
)
],
)
Storage advantage: Unlike integrations that expand sparse vectors to full vocabulary length (~30K floats), Qdrant stores sparse vectors in their native indices+values form, making hybrid search storage-efficient.
Testing
# Unit tests (no server needed)
pytest
# Integration tests (requires SIE + Qdrant)
pytest -m integration
Project details
Release history Release notifications | RSS feed
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 sie_qdrant-0.1.10.tar.gz.
File metadata
- Download URL: sie_qdrant-0.1.10.tar.gz
- Upload date:
- Size: 10.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d9c4843e7bc4dba301ecb45765a79cb975b8a32d884dc600041e8ffc2a4949d8
|
|
| MD5 |
8e18f5d5690653f90bb054be0b3d8106
|
|
| BLAKE2b-256 |
27892b02d5427f6ca3c7e064fe52d41070973043ed25f6216d9057759da84427
|
Provenance
The following attestation bundles were made for sie_qdrant-0.1.10.tar.gz:
Publisher:
release-python.yml on superlinked/sie-internal
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sie_qdrant-0.1.10.tar.gz -
Subject digest:
d9c4843e7bc4dba301ecb45765a79cb975b8a32d884dc600041e8ffc2a4949d8 - Sigstore transparency entry: 1261918525
- Sigstore integration time:
-
Permalink:
superlinked/sie-internal@53f995076cbc369696d8f8e19df00783967e7593 -
Branch / Tag:
refs/tags/v0.1.10 - Owner: https://github.com/superlinked
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
self-hosted -
Publication workflow:
release-python.yml@53f995076cbc369696d8f8e19df00783967e7593 -
Trigger Event:
push
-
Statement type:
File details
Details for the file sie_qdrant-0.1.10-py3-none-any.whl.
File metadata
- Download URL: sie_qdrant-0.1.10-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d9d96ba2eb8c76dab0f867b9b65b824083f3b1cd148501a6194fd09b6aa2f153
|
|
| MD5 |
40092165f2a5f2b551b8fd26f6a60d5b
|
|
| BLAKE2b-256 |
c20cfc5e01de965e9a25ce1d9a2e22e7e3aa33c3e05b3b5eeb989483a5184bd7
|
Provenance
The following attestation bundles were made for sie_qdrant-0.1.10-py3-none-any.whl:
Publisher:
release-python.yml on superlinked/sie-internal
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sie_qdrant-0.1.10-py3-none-any.whl -
Subject digest:
d9d96ba2eb8c76dab0f867b9b65b824083f3b1cd148501a6194fd09b6aa2f153 - Sigstore transparency entry: 1261918538
- Sigstore integration time:
-
Permalink:
superlinked/sie-internal@53f995076cbc369696d8f8e19df00783967e7593 -
Branch / Tag:
refs/tags/v0.1.10 - Owner: https://github.com/superlinked
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
self-hosted -
Publication workflow:
release-python.yml@53f995076cbc369696d8f8e19df00783967e7593 -
Trigger Event:
push
-
Statement type: