Skip to content

feat: Add support for Qdrant Serverless - #164

Open
anush008 wants to merge 3 commits into
masterfrom
feat/serverlessa
Open

anush008 wants to merge 3 commits into
masterfrom
feat/serverlessa

Conversation

@anush008

Copy link
Copy Markdown
Member

The CI credentials are set for the integration tests.

@anush008
anush008 marked this pull request as draft October 12, 2026 10:03
@anush008
anush008 marked this pull request as ready for review October 12, 2026 14:22
@anush008
anush008 force-pushed the feat/serverlessa branch 2 times, most recently from 19d8c0e to 8bb99ea Compare October 13, 2026 08:32

@generall generall left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I compared a minimal program (connect → create collection → upsert → search) written against QdrantClient and against QdrantServerlessClient. Search is identical, but the other steps diverge more than they need to:

1. Connect

// regular
new QdrantClient(QdrantGrpcClient.newBuilder(host, 6334, true).withApiKey(apiKey).build());
// serverless
new QdrantServerlessClient(QdrantServerlessClient.newGrpcClientBuilder(host).withApiKey(apiKey).build());

QdrantServerlessClient.newGrpcClientBuilder

vs

QdrantGrpcClient.newBuilder

Why not same naming pattern?

2. Create collection

// regular
client.createCollectionAsync("docs",
    VectorParams.newBuilder().setSize(4).setDistance(Distance.Cosine).build()).get();
// serverless
client.createCollectionAsync("docs",
    CollectionConfig.newBuilder()
        .putDenseVectors("", DenseVectorConfig.newBuilder()
            .setSize(4).setDistance(Distance.COSINE).build())
        .build()).get();

.putDenseVectors("", DenseVectorConfig.newBuilder()

does default vector require explicit "" name? With the regular client, the common single-vector case doesn't need any name.

3. Upsert

// regular
client.upsertAsync("docs", List.of(point)).get();   // wait=true is set for you
// serverless
client.upsertAsync(UpsertPoints.newBuilder()
    .setCollectionName("docs")
    .setWait(true)                                   // easy to forget, defaults to false
    .addPoints(point)
    .build()).get();

upsertAsync

should be same, why it is not the same for serverless? The (collectionName, points) overload is missing here, so code can't be moved between the two clients without rewriting it, and forgetting setWait(true) silently changes behaviour.

Written with Overlord from https://overlord.qdrant.tech/r/997/t/6611

@anush008

anush008 commented Nov 24, 2026 •

Copy link
Copy Markdown
Member Author

I have added createCollectionAsync(name, DenseVectorConfig), so the single-vector case works like createCollectionAsync(name, VectorParams) on the regular client.

The serverless client now also has all the QdrantClient point overloads, and they just call QdrantClient under the hood. So upsertAsync(collectionName, points) works the same and waits by default.

On the builder name: QdrantGrpcClient.newBuilder(String host) already exists and means port 6334 with the version check on, so the serverless defaults (443, TLS, no version check) can't use that name. Without the helper you'd write QdrantGrpcClient.newBuilder(host, 443, true, false).

@anush008
anush008 requested a review from generall November 24, 2026 20:24

@generall generall left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Creating a collection with the unnamed default vector should not require users to know the "" key convention.

The new createCollectionAsync(name, DenseVectorConfig) overload hides it only when the collection has no payload indexes. Serverless has no separate createPayloadIndexAsync: indexes can only be declared in CollectionConfig.payload_indexes. So the most common real setup, a default vector plus a couple of indexes, still needs:

CollectionConfig.newBuilder()
    .putDenseVectors("", DenseVectorConfig.newBuilder()...build())
    .putPayloadIndexes("color", ServerlessPayloadIndexFactory.keyword())
    .build()

The PR's own test does this (QdrantServerlessClientTest.java:167).

Please provide a first-class way to set the default vector that composes with payload indexes and sparse vectors. For example:

  • an overload createCollectionAsync(name, DenseVectorConfig, Map<String, PayloadIndexConfig>) (plus the timeout variant), and/or
  • a factory such as ServerlessCollectionConfigFactory.defaultVector(DenseVectorConfig) that returns a CollectionConfig.Builder, so callers can chain .putPayloadIndexes(...) / .putSparseVectors(...).

With either, user code never has to spell out "".

Written with Overlord from https://overlord.qdrant.tech/r/997/t/6611

public ListenableFuture<CreateCollectionResponse> createCollectionAsync(
String collectionName, DenseVectorConfig vector, @Nullable Duration timeout) {
return createCollectionAsync(
collectionName, CollectionConfig.newBuilder().putDenseVectors("", vector).build(), timeout);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This hides "" only when there are no payload indexes. As soon as an index is needed, which on serverless can only be declared at creation time, users are back to putDenseVectors("", ...) by hand. Could the default-vector path also accept payload indexes, or could a config builder/factory with the default vector already set be exposed?

Written with Overlord from https://overlord.qdrant.tech/r/997/t/6611

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants