StorageConfig
TheStorageConfig class specifies the backing store for an index’s keystores. It is immutable and is built via static factory methods. A single StorageConfig is shared across all per-index keystores and is passed to the Client constructor.
CyborgDB supports three backing stores: memory, disk, and s3.
Factories
| Factory | Description |
|---|---|
memory() | Ephemeral in-memory store with no persistence. Use for tests and benchmarking. |
disk(path, ...) | Local persistent store backed by RocksDB. Optional cache_* flags keep vectors / metadata / IDs in memory for faster reads. |
s3(bucket, ...) | S3 or S3-compatible object store. Set endpoint for non-AWS providers (path-style addressing is auto-selected). Omit credentials to use the AWS default credential provider chain. |
Example Usage
S3Credentials
Explicit credentials for theStorageConfig.s3(...) factory. Omit credentials= on .s3() to use the AWS default credential provider chain (environment variables, ~/.aws/credentials, EC2 instance profile, EKS IRSA).
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
access_key | str | - | S3 access key ID. |
secret_key | str | - | S3 secret access key. |
session_token | str | None | None | (Optional) Temporary session token (for STS / assumed roles). |
Example Usage
Storage Precision
storage_precision controls the on-disk dtype of the rerank vectors for a DiskIVF index, set at create_index time.
| Value | Description |
|---|---|
numpy.float32 (default) | Full-precision rerank vectors. |
numpy.float16 | Halves the on-disk footprint with a slight precision loss. |
"float32" and "float16" are also accepted.
GPUConfig
TheGPUConfig class configures which operations should use GPU acceleration. GPU acceleration requires CUDA support.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
upsert | bool | False | (Optional) Enable GPU for upsert operations |
train | bool | False | (Optional) Enable GPU for training operations |
Properties (Read-Only)
| Property | Type | Description |
|---|---|---|
upsert | bool | Whether GPU is enabled for upsert operations |
train | bool | Whether GPU is enabled for training operations |
query | bool | Whether GPU is enabled for query operations |
all | bool | Whether all GPU operations are enabled |
none | bool | Whether no GPU operations are enabled |
Example Usage
DistanceMetric
DistanceMetric is a string representing the distance metric used for the index. Options include:
"cosine": Cosine similarity."euclidean": Euclidean distance."squared_euclidean": Squared Euclidean distance.
KMSBlob
KMSBlob describes a per-index envelope recording how the index KEK is wrapped by an external KMS. It is used with the module-level KMS functions (create_index_kms, push_index_kms, get_index_kms, delete_index_kms). This is an advanced, optional surface primarily for the service layer; embedded SDK users supplying their own KEK can ignore it or use provider="none".
Fields
| Field | Type | Description |
|---|---|---|
kms_name | str | Human-readable name of the KMS configuration. |
provider | str | KMS provider: "aws", "aws-kms", or "none". |
key_id | str | Identifier of the wrapping key within the KMS. |
region | str | Region of the KMS / key. |
wrapped_kek | bytes | The wrapped index KEK. |
version | int | Envelope version. |
created_at | int | Creation timestamp (unix epoch seconds). |