Costs
Nebius AI Cloud charges you for the following billing items:- Compute resources used by Serverless AI: a Devlab with JupyterLab and an endpoint
- Managed Service for PostgreSQL cluster
Prerequisites
- Make sure you are in a group that has at least the
editorrole within your tenant or project; for example, the defaulteditorsgroup. You can check this in the Administration → IAM section of the web console. - Create resources in a project in a region where Serverless AI and Managed Service for PostgreSQL are available, for example
eu-north1,eu-west1orus-central1. - In the web console, go to Administration → Limits and make sure that you have at least one NVIDIA® Hopper® H200 for regular VMs without reservations and one virtual machine under Compute, and one allocation under Virtual Networks in the region that you use. Increase quotas if needed.
Steps
Create a Managed Service for PostgreSQL cluster
- In the web console, go to Managed Service for PostgreSQL.
-
Click Create cluster and configure the cluster:
- Enter a name.
- In Access, select Public and private so that JupyterLab can connect to the cluster from the internet.
- In Resources, choose a preset (for example,
4 vCPUs – 16 GiB RAM) and set the storage size. - In Database, set the database name, username and password. For example: database
rag-example, userrag_example_userand a strong password.
- Click Create cluster and wait until it is ready.
- Open the cluster page. On Cluster overview, click Copy endpoint URL and select Public RW endpoint URL to copy the connection host. In the General block you can copy Bootstrap database and Username if needed. You will need the endpoint host, database name, username and password in the notebook.
Create a JupyterLab Devlab
-
Create a Devlab from the JupyterLab template:
- In the web console, go to Serverless AI → Devlabs.
- Click Create Devlab.
- Under Devlab settings, choose Template and select JupyterLab.
- Review the prefilled Devlab settings. The console generates the Jupyter token automatically. Copy and save the token securely.
- Click Create Devlab and wait until the Devlab is running.
-
Open the Devlab UI:
- On the Devlab page, click the web UI link to connect to JupyterLab. Enter the token if prompted.
- Open a new notebook. You will run all the code below in this notebook.
Prepare the knowledge base in JupyterLab
-
In JupyterLab, open a terminal and install dependencies:
-
Create three Markdown files in the notebook’s working directory:
laptop_catalog.md,headphones_catalog.md, andreturn_policy.md. Use sections separated by##headers. Full example contents:laptop_catalog.md
headphones_catalog.md
return_policy.md
-
In the notebook, run the following in order:
-
Connect to the database and create the table.
Replace
<host>,<dbname>,<user>and<password>with your Managed Service for PostgreSQL cluster connection details: use Public RW endpoint URL as the hostname and the Bootstrap database, Username and password from the General block. Theall-MiniLM-L6-v2model produces 384-dimensional vectors. If you use another model, changevector(384)in the table definition. -
Load the embedding model and define helpers.
-
Ingest the documents:
-
Define retrieval and prompt building:
-
Connect to the database and create the table.
Replace
Deploy a serverless LLM endpoint
The endpoint exposes an OpenAI-compatible API that you will call from your JupyterLab notebook.- In the web console, go to Serverless AI → Endpoints and click Create endpoint.
-
Under Endpoint settings → Image path, enter
vllm/vllm-openai:latest. -
Under Ports, set the container port to
8000. -
Under Entrypoint command, specify the following value:
-
Under Computing resources, choose With GPU, then select a platform (for example,
NVIDIA® H200 NVLink) and a preset (for example,1 GPU — 16 vCPUs — 200 GiB RAM). -
Click Create and wait until the endpoint status is
Running. It may take five minutes. -
Open the endpoint. In the Network section, copy the value of a public endpoint in the
http://<IP_address>:8000format.
Call the LLM from the notebook
-
Add the following code to your JupyterLab notebook to call the deployed endpoint. Replace
<ENDPOINT_IP>with the endpoint address from Deploy a serverless LLM endpoint. -
Run a RAG query:
Example
Example
Your question: What laptop and headphones should I buy with a budget of 1000 USD?Answer: The laptop to buy is the Sony WH-1000XM5, and the headphones are the JBL Tune 510BT. Both products are within the 1000 USD budget.
How to delete the created resources
Some of the created resources are chargeable. If you don’t need them, delete these resources so Nebius AI Cloud doesn’t charge for them:- JupyterLab Devlab: In the web console, go to Serverless AI → Devlabs, open the Devlab and delete it.
- Serverless AI endpoint: In the web console, go to Serverless AI → Endpoints. Open the endpoint, stop it if it is running, and then delete it.
- Managed Service for PostgreSQL cluster: Follow the instructions.
Postgres, PostgreSQL and the Slonik Logo are trademarks or registered trademarks of the PostgreSQL Community Association of Canada, and used with their permission.