Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 26 additions & 4 deletions proto/collections.proto
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
syntax = "proto3";
package qdrant;

option csharp_namespace = "Qdrant.Client.Grpc";

import "json_with_int.proto";
import "qdrant_common.proto";

option csharp_namespace = "Qdrant.Client.Grpc";

enum Datatype {
Default = 0;
Float32 = 1;
Expand Down Expand Up @@ -361,11 +361,24 @@ message BinaryQuantization {
optional BinaryQuantizationQueryEncoding query_encoding = 3;
}

message TurboQuantization{
optional bool always_ram = 1;
optional TurboQuantBitSize bits = 2;
}

enum TurboQuantBitSize{
Bits1 = 0;
Bits1_5 = 1;
Bits2 = 2;
Bits4 = 3;
}

message QuantizationConfig {
oneof quantization {
ScalarQuantization scalar = 1;
ProductQuantization product = 2;
BinaryQuantization binary = 3;
TurboQuantization turboquant = 4;
}
}

Expand All @@ -377,6 +390,7 @@ message QuantizationConfigDiff {
ProductQuantization product = 2;
Disabled disabled = 3;
BinaryQuantization binary = 4;
TurboQuantization turboquant = 5;
}
}

Expand Down Expand Up @@ -406,6 +420,8 @@ message StrictModeConfig {
optional float search_max_oversampling = 8;
// Max batchsize when upserting
optional uint64 upsert_max_batchsize = 9;
// Max batchsize when searching
optional uint64 search_max_batchsize = 20;
// Max size of a collections vector storage in bytes, ignoring replicas.
optional uint64 max_collection_vector_size_bytes = 10;
// Max number of read operations per minute per replica
Expand All @@ -426,6 +442,9 @@ message StrictModeConfig {
optional uint64 max_points_count = 18;
// Max number of payload indexes in a collection
optional uint64 max_payload_index_count = 19;
// Reject memory-consuming update operations when process resident memory exceeds this percentage of total RAM (cgroup-aware, 1-100).
// Delete-style operations are still allowed so memory can be freed.
optional uint32 max_resident_memory_percent = 21;
}

message StrictModeSparseConfig {
Expand Down Expand Up @@ -749,8 +768,11 @@ message PayloadSchemaInfo {
}

message UpdateQueueInfo {
// Number of elements in the queue
uint64 length = 1;
// Number of elements in the queue
uint64 length = 1;

// Number of points that are deferred (i.e hidden from search as they're not yet optimized).
optional uint64 deferred_points = 2;
}

message CollectionInfo {
Expand Down
60 changes: 58 additions & 2 deletions proto/points.proto
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,62 @@ message DeleteFieldIndexCollection {
optional uint64 timeout = 5;
}

// Dense vector creation parameters.
// Only includes immutable properties that define the vector space.
// Storage type, index, and quantization are configured separately.
message DenseVectorCreationConfig {
// Size/dimensionality of the vectors
uint64 size = 1;
// Distance function used for comparing vectors
Distance distance = 2;
// Configuration for multi-vector search (e.g., ColBERT)
optional MultiVectorConfig multivector_config = 3;
// Data type of the vectors (Float32, Float16, Uint8)
optional Datatype datatype = 4;
}

// Sparse vector creation parameters.
// Only includes immutable properties that define the vector space.
message SparseVectorCreationConfig {
// If set - apply modifier to the vector values (e.g., IDF)
optional Modifier modifier = 1;
// Data type used to store weights in the index
optional Datatype datatype = 2;
}

message CreateVectorNameRequest {
// Name of the collection
string collection_name = 1;
// Wait until the changes have been applied?
optional bool wait = 2;
// Name of the new vector
string vector_name = 3;
// Configuration for the new vector - either dense or sparse
oneof vector_config {
// Dense vector parameters
DenseVectorCreationConfig dense_config = 4;
// Sparse vector parameters
SparseVectorCreationConfig sparse_config = 5;
}
// If set, overrides global timeout setting for this request. Unit is seconds.
optional uint64 timeout = 6;
// Write ordering guarantees
optional WriteOrdering ordering = 7;
}

message DeleteVectorNameRequest {
// Name of the collection
string collection_name = 1;
// Wait until the changes have been applied?
optional bool wait = 2;
// Name of the vector to delete
string vector_name = 3;
// If set, overrides global timeout setting for this request. Unit is seconds.
optional uint64 timeout = 4;
// Write ordering guarantees
optional WriteOrdering ordering = 5;
}

message PayloadIncludeSelector {
// List of payload keys to include into result
repeated string fields = 1;
Expand Down Expand Up @@ -417,11 +473,11 @@ message QuantizationSearchParams {

// Oversampling factor for quantization.
//
// Defines how many extra vectors should be pre-selected using quantized index,
// Defines how many extra vectors should be preselected using quantized index,
// and then re-scored using original vectors.
//
// For example, if `oversampling` is 2.4 and `limit` is 100,
// then 240 vectors will be pre-selected using quantized index,
// then 240 vectors will be preselected using quantized index,
// and then top-100 will be returned after re-scoring.
optional double oversampling = 3;
}
Expand Down
4 changes: 4 additions & 0 deletions proto/points_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ service Points {
// Delete field index for collection
rpc DeleteFieldIndex(DeleteFieldIndexCollection)
returns (PointsOperationResponse) {}
// Create a new named vector on the collection
rpc CreateVectorName(CreateVectorNameRequest) returns (PointsOperationResponse) {}
// Delete a named vector from the collection
rpc DeleteVectorName(DeleteVectorNameRequest) returns (PointsOperationResponse) {}
// Retrieve closest points based on vector similarity and given filtering
// conditions
rpc Search(SearchPoints) returns (SearchResponse) {}
Expand Down
59 changes: 52 additions & 7 deletions src/builder_ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ use crate::qdrant::update_collection_cluster_setup_request::Operation;
use crate::qdrant::{
shard_key, AbortShardTransferBuilder, BinaryQuantizationBuilder, ClearPayloadPointsBuilder,
ContextExamplePair, CountPointsBuilder, CreateAliasBuilder, CreateCollectionBuilder,
CreateFieldIndexCollectionBuilder, CreateShardKeyRequestBuilder, DeleteCollectionBuilder,
DeleteFieldIndexCollectionBuilder, DeletePayloadPointsBuilder, DeletePointVectorsBuilder,
DeletePointsBuilder, DeleteShardKey, DeleteShardKeyRequestBuilder,
DeleteSnapshotRequestBuilder, DiscoverBatchPointsBuilder, DiscoverPoints,
CreateFieldIndexCollectionBuilder, CreateShardKeyRequestBuilder,
CreateVectorNameRequestBuilder, DeleteCollectionBuilder, DeleteFieldIndexCollectionBuilder,
DeletePayloadPointsBuilder, DeletePointVectorsBuilder, DeletePointsBuilder, DeleteShardKey,
DeleteShardKeyRequestBuilder, DeleteSnapshotRequestBuilder, DeleteVectorNameRequestBuilder,
DenseVectorCreationConfigBuilder, DiscoverBatchPointsBuilder, DiscoverPoints,
DiscoverPointsBuilder, Distance, FacetCountsBuilder, FieldType, GetPointsBuilder,
LookupLocationBuilder, MoveShardBuilder, PayloadExcludeSelector, PayloadIncludeSelector,
PointId, PointStruct, PointVectors, PointsUpdateOperation, ProductQuantizationBuilder,
Expand All @@ -16,9 +17,10 @@ use crate::qdrant::{
RecommendPoints, RecommendPointsBuilder, RenameAliasBuilder, ReplicaBuilder,
ReplicateShardBuilder, ScalarQuantizationBuilder, ScrollPointsBuilder,
SearchBatchPointsBuilder, SearchMatrixPointsBuilder, SearchPointGroupsBuilder, SearchPoints,
SearchPointsBuilder, SetPayloadPointsBuilder, ShardKey, UpdateBatchPointsBuilder,
UpdateCollectionBuilder, UpdateCollectionClusterSetupRequestBuilder, UpdatePointVectorsBuilder,
UpsertPointsBuilder, Value, VectorParamsBuilder, VectorsSelector, WithLookupBuilder,
SearchPointsBuilder, SetPayloadPointsBuilder, ShardKey, SparseVectorCreationConfigBuilder,
TurboQuantizationBuilder, UpdateBatchPointsBuilder, UpdateCollectionBuilder,
UpdateCollectionClusterSetupRequestBuilder, UpdatePointVectorsBuilder, UpsertPointsBuilder,
Value, VectorParamsBuilder, VectorsSelector, WithLookupBuilder,
};

impl VectorParamsBuilder {
Expand Down Expand Up @@ -54,6 +56,12 @@ impl BinaryQuantizationBuilder {
}
}

impl TurboQuantizationBuilder {
pub fn new() -> Self {
Self::empty()
}
}

impl SearchPointsBuilder {
pub fn new(
collection_name: impl Into<String>,
Expand Down Expand Up @@ -307,6 +315,43 @@ impl DeleteFieldIndexCollectionBuilder {
}
}

impl DenseVectorCreationConfigBuilder {
pub fn new(size: u64, distance: Distance) -> Self {
let mut builder = Self::empty();
builder.size = Some(size);
builder.distance = Some(distance.into());
builder
}
}

impl SparseVectorCreationConfigBuilder {
pub fn new() -> Self {
Self::empty()
}
}

impl CreateVectorNameRequestBuilder {
pub fn new(
collection_name: impl Into<String>,
vector_name: impl Into<String>,
vector_config: impl Into<crate::qdrant::create_vector_name_request::VectorConfig>,
) -> Self {
let mut builder = Self::empty();
builder.collection_name = Some(collection_name.into());
builder.vector_name = Some(vector_name.into());
builder.vector_config(vector_config)
}
}

impl DeleteVectorNameRequestBuilder {
pub fn new(collection_name: impl Into<String>, vector_name: impl Into<String>) -> Self {
let mut builder = Self::empty();
builder.collection_name = Some(collection_name.into());
builder.vector_name = Some(vector_name.into());
builder
}
}

impl UpdateCollectionClusterSetupRequestBuilder {
pub fn new(collection_name: impl Into<String>, operation: impl Into<Operation>) -> Self {
let mut builder = Self::empty();
Expand Down
Loading
Loading