Costs
Nebius AI Cloud charges for the following resources used in this tutorial:- Object Storage: storage consumed by LanceDB files written to your bucket.
Prerequisites
- Make sure you are in a group that has at least the
editorrole within your tenant; for example, the defaulteditorsgroup. You can check this in the Administration → IAM section of the web console. - Install and configure the Nebius AI Cloud CLI.
- Create resources in a project in one of the available regions, such as
eu-north1. - Python 3.9 or later installed locally or a running JupyterLab® instance.
Steps
Create an Object Storage bucket
-
In the web console, go to
Object Storage and click Create bucket.
-
Enter a name for the bucket, for example
lancedb-data. -
Select Enhanced Throughput for the storage class.
You can use the Standard storage class instead, but Enhanced Throughput works better for this workflow. For a comparison, see Storage classes in Object Storage.
- Click Create bucket.
Create a service account and grant it access to the bucket
LanceDB needs credentials to read and write objects. Create a dedicated service account, put it in its own group and grant that group access to the bucket you created.-
Create a service account:
-
Create a group for the service account and add the account to it:
-
Look up the bucket ID and grant the group read and write access scoped to the bucket:
The
storage.editorrole in this bucket policy lets the service account read and write objects in this bucket only. -
Create an access key and save the credentials:
Save the values of
AWS_ACCESS_KEY_IDandAWS_SECRET_ACCESS_KEYsomewhere secure — the secret is shown only once.
Install LanceDB
Install LanceDB dependencies for your platform of choice:- Python
- TypeScript
Connect LanceDB to Object Storage
Open a script or notebook and connect LanceDB to your bucket. The endpoint follows the patternhttps://storage.<region_ID>.nebius.cloud. Replace <bucket_name>, <region_ID>, <access_key_ID> and <secret_access_key> with your values.
- Python
- TypeScript
You can supply credentials via environment variables instead of
storage_options. If AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_DEFAULT_REGION and AWS_ENDPOINT are set in your shell, you can call lancedb.connect("s3://<bucket_name>/lancedb") with no additional options.Create a table and insert vectors
Create a table with a vector column and a metadata column, then insert a few rows. In this tutorial, random vectors are used to keep the example self-contained.- Python
- TypeScript
s3://<bucket_name>/lancedb/documents.lance/. You can verify this in the web console under Object Storage → your bucket.
Run a similarity search
Query the table for the rows nearest to a query vector:- Python
- TypeScript
_distance score. Because the data in this example is random, the distances have no semantic meaning — in a real application, vectors would come from an embedding model and low distances would indicate semantic similarity.
Reconnect to an existing table
LanceDB tables persist in Object Storage. To reopen a table in a later session, reconnect with the same credentials and callopen_table:
- Python
- TypeScript
How to delete the created resources
Object Storage is a chargeable resource. If you no longer need the data, delete the bucket to stop incurring charges.See also
- LanceDB storage configuration
- Object Storage overview
- Amazon S3 API Compatibility Reference
- Serverless AI — use Nebius-hosted embedding models to generate vectors for your LanceDB tables
“Jupyter” and the Jupyter logos are trademarks or registered trademarks of LF Charities, used by Nebius B.V. with permission.