from cyborgdb import Client, IndexIVF, generate_key
# Create a client
client = Client('http://localhost:8000', 'your-api-key')
# Create an IVF index config (can also be IVFFlat/IVFPQ)
# Using an example vector dimension of 768, and number of lists of 1024
index_config = IndexIVF(
type='ivf',
dimension=768,
n_lists=1024,
metric='cosine'
)
# Generate an encryption key for the index
index_key = generate_key() # Returns 32-byte key as bytes
# Create an encrypted index
index = client.create_index("my_index", index_key, index_config)