How to create an endpoint
To deploy an AI model, create an endpoint. Serverless AI endpoints are based on containers over virtual machines (VMs) in Compute. Your model runs in a container over VM, and you can access the model by using the endpoint.- CLI
To create an endpoint, run the following command:
In the command, specify the following parameters:
Endpoint creation example
Endpoint creation example
-
Endpoint characteristics:
-
--name: Endpoint name.
-
--image: Container image in the<registry>/<image>:<tag>format. Use an image from a public registry or your authenticated private registry. -
--registry-username,--registry-password(optional): If you pull an image from a private registry, specify your credentials for this registry:--registry-username: Username.--registry-password: Personal access token, password or an API key. Depends on where your registry is hosted. It can be Docker Hub, Microsoft Azure, GitHub, NVIDIA or a custom registry.
-
--container-command(optional): Entrypoint command for the container. -
--args(optional): Arguments fordocker runto pass to the entrypoint command. -
--env(optional): Environment variables for the container. Set them in thekey=valueformat where thekeyis the environment variable and thevalueis the value of this variable. If you need to set several variables, list thekey=valuepairs separated by commas.
-
--container-port(optional): Port that the endpoint exposes. -
--auth(optional): Authentication method. If the parameter isn’t set (default), no authentication is required. Useful when you want to create an endpoint prototype and test it. If you set--auth token, you enable authentication. Useful for production purposes. When you call the endpoint, specify the token in the"Authorization: Bearer <token>"HTTP header. -
--token(optional): Token for authentication. To get the token, runopenssl rand -hex 32. -
--volume(optional): Bucket or shared filesystem to mount to the endpoint container. You can use volumes to store model files and other endpoint artifacts. Specify the value in thesource:container_pathorsource:container_path:modeformat. The supported modes arero, read only, andrw, read-write (default). Repeat for multiple volumes. For example:
source, you can specify either the volume ID or its name. -
-
Underlying container over VM characteristics:
-
--subnet-id: Subnet ID. Required if the project has multiple subnets. -
--platform: VM platform. See available platforms in Types of virtual machines and GPUs in Nebius AI Cloud. -
--preset: Number of GPUs, vCPUs and RAM allocated to the container. The preset must match the selected platform. See available presets in Presets for GPU platforms. -
--disk-size: Disk size of the container over VM. Specify the value such as100Gi,500Gior1Ti. The default value is250Gi. See how disk performance depends on disk size. -
--shm-size(optional): Shared memory size of/dev/shm. Specify the value such as64Mi,128Mior1Gi. The default value is16Gi. -
--ssh-key(optional): SSH key to access the container over VM by SSH. When you add an SSH key, a public dynamic IP address is assigned. Before you add the key, check the quota on the number of public IP addresses in the web console.
--public(optional): Assigns a public IP address to the container over VM.
-
How to call an endpoint
You can call an endpoint when you want to interact with an AI model hosted in this endpoint; for example, when you want to chat with the model. To call the endpoint, do the following:- CLI
-
To get the endpoint ID, list all endpoints:
In the output, copy the ID of the required endpoint.
-
Get the endpoint IP address:
-
Call the endpoint:
In the command, specify the following parameters:
<endpoint_IP_address>: IP address that you copied earlier.<token>: Authentication token that you specified when you created the endpoint. If you didn’t specify any token, don’t use theAuthorizationHTTP header.model: AI model that is hosted in the endpoint and that you chat with.content: Message that you want to send to the model.
How to stop or start an endpoint
If you don’t currently need your endpoint but you want to preserve it, you can stop the endpoint and then start it later. Computing resources of stopped endpoints aren’t charged. However, if you mounted a volume to the endpoint, you are charged for the volume even if the endpoint is stopped.- CLI
-
To get the endpoint ID, list all endpoints:
In the output, copy the ID of the required endpoint.
-
To stop an endpoint, run the following command:
-
To start an endpoint, run the following command:
How to delete an endpoint
If you no longer need the endpoint, delete it:- CLI
-
To get the endpoint ID, list all endpoints:
In the output, copy the ID of the required endpoint.
-
Delete the endpoint:
If a static IP address is assigned to the endpoint, the prompt asks to confirm the address release. Enter
yto confirm ornto keep the address allocated in a pool.