> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nebius.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Getting started with Serverless AI Devlabs: Deploy JupyterLab®

Serverless AI Devlabs provide an interactive environment for coding and prototyping, without the need to manage infrastructure. This quickstart shows how to create a Devlab from the JupyterLab® template and open it in your browser.

## Prerequisites

> [tab] Web console
>
> * Make sure you are in a [group](https://docs.nebius.com/iam/authorization/groups/index.md) that has at least the `editor` role within your tenant or project; for example, the default `editors` group. You can check this in the [Administration → IAM](https://console.nebius.com/iam) section of the web console.
>
> * In the [Administration → Limits → Quotas](https://console.nebius.com/quota) section, check the following quotas:
>
>   * **Number of virtual machines** (VMs) under **Compute**: Make sure that at least one VM is available.
>   * **Allocations** under **Virtual Networks**: Make sure that at least one allocation is available.
>
>   If necessary, [increase the quotas](https://docs.nebius.com/overview/quotas.md#change-quotas-web-console).

> [tab] CLI
>
> * [Install and configure](https://docs.nebius.com/cli/install.md) the Nebius AI Cloud CLI.
>
>   Check that your project ID is saved in the Nebius AI Cloud CLI profile configuration:
>
>   ```bash theme={null}
>   cat ~/.nebius/config.yaml
>   ```
>
> * Make sure that you or the service account that you use is in a [group](https://docs.nebius.com/iam/authorization/groups/index.md) that has at least the `editor` role within your tenant or project; for example, the default `editors` group. You can check this in the [Administration → IAM](https://console.nebius.com/iam) section of the web console.
>
> * In the [Administration → Limits → Quotas](https://console.nebius.com/quota) section, check the following quotas:
>
>   * **Number of virtual machines** (VMs) under **Compute**: Make sure that at least one VM is available.
>   * **Allocations** under **Virtual Networks**: Make sure that at least one allocation is available.
>
>   If necessary, [increase the quotas](https://docs.nebius.com/overview/quotas.md#change-quotas).

> [tab] Go SDK
>
> * [Install and initialize the Nebius SDK for Go](https://docs.nebius.com/sdk/go/install-auth.md).
>
> * Make sure that you or the service account that you use is in a [group](https://docs.nebius.com/iam/authorization/groups/index.md) that has at least the `editor` role within your tenant or project; for example, the default `editors` group. You can check this in the [Administration → IAM](https://console.nebius.com/iam) section of the web console.
>
> * In the [Administration → Limits → Quotas](https://console.nebius.com/quota) section, check the following quotas:
>
>   * **Number of virtual machines** (VMs) under **Compute**: Make sure that at least one VM is available.
>   * **Allocations** under **Virtual Networks**: Make sure that at least one allocation is available.
>
>   If necessary, [increase the quotas](https://docs.nebius.com/overview/quotas.md#change-quotas).

> [tab] Python SDK
>
> * [Install and initialize the Nebius SDK for Python](https://docs.nebius.com/sdk/python/install-auth.md).
>
> * Make sure that you or the service account that you use is in a [group](https://docs.nebius.com/iam/authorization/groups/index.md) that has at least the `editor` role within your tenant or project; for example, the default `editors` group. You can check this in the [Administration → IAM](https://console.nebius.com/iam) section of the web console.
>
> * In the [Administration → Limits → Quotas](https://console.nebius.com/quota) section, check the following quotas:
>
>   * **Number of virtual machines** (VMs) under **Compute**: Make sure that at least one VM is available.
>   * **Allocations** under **Virtual Networks**: Make sure that at least one allocation is available.
>
>   If necessary, [increase the quotas](https://docs.nebius.com/overview/quotas.md#change-quotas).

> [tab] JavaScript SDK
>
> * [Install and initialize the Nebius SDK for JavaScript](https://docs.nebius.com/sdk/javascript/install-auth.md).
>
> * Make sure that you or the service account that you use is in a [group](https://docs.nebius.com/iam/authorization/groups/index.md) that has at least the `editor` role within your tenant or project; for example, the default `editors` group. You can check this in the [Administration → IAM](https://console.nebius.com/iam) section of the web console.
>
> * In the [Administration → Limits → Quotas](https://console.nebius.com/quota) section, check the following quotas:
>
>   * **Number of virtual machines** (VMs) under **Compute**: Make sure that at least one VM is available.
>   * **Allocations** under **Virtual Networks**: Make sure that at least one allocation is available.
>
>   If necessary, [increase the quotas](https://docs.nebius.com/overview/quotas.md#change-quotas).

## Steps

### Create a Devlab

> [tab] Web console
>
> 1. In the sidebar, go to  **Serverless AI** → **Devlabs**.
> 2. Click  **Create Devlab**, choose **Template**, and select **JupyterLab**.
> 3. Review the prefilled Devlab settings. The console generates the Jupyter token automatically. Copy and save the token securely.
> 4. Click **Create Devlab**.

> [tab] CLI
>
> 1. Create a random Jupyter token of exactly 16 alphanumeric characters. For example:
>
>    ```bash theme={null}
>    export JUPYTER_TOKEN=$(openssl rand -hex 8)
>    ```
>
> 2. Create a Devlab from the JupyterLab template:
>
>    ```bash theme={null}
>    nebius ai devlab create \
>      --name my-jupyter \
>      --template jupyter \
>      --input jupyter_token=$JUPYTER_TOKEN
>    ```
>
>    The command uses the following parameters:
>
>    * `--name`: Devlab name.
>    * `--template`: Template to use. In this quickstart, use `jupyter` for the JupyterLab template.
>    * `--input jupyter_token=<token>`: Jupyter token that you provide. The token must consist of 16 alphanumeric characters.
>
>    `--platform`, `--preset` and `--disk-size` are optional. If you omit them, the CLI selects the default GPU platform, the smallest suitable preset and a 250 GiB disk.

> [tab] Go SDK
>
> 1. Generate a random Jupyter token of exactly 16 alphanumeric characters:
>
>    ```go theme={null}
>    tokenBytes := make([]byte, 8)
>    if _, err := rand.Read(tokenBytes); err != nil {
>        return fmt.Errorf("generate Jupyter token: %w", err)
>    }
>    jupyterToken = hex.EncodeToString(tokenBytes)
>    ```
>
>    Save the value of `jupyterToken` securely. You need the token to sign in to JupyterLab.
>
> 2. Create a Devlab from the JupyterLab template:
>
>    ```go theme={null}
>    createSpec := &ai.DevlabSpec{
>        Template: &ai.DevlabSpec_Template{
>            Id: "vmapptemplate-g00devlab-jupyter",
>            InputFieldValues: map[string]*structpb.Value{
>                "jupyter_token": structpb.NewStringValue(
>                    "<jupyter_token>",
>                ),
>            },
>        },
>        Platform: "<platform_ID>",
>        Preset:   "<preset>",
>        Disk: &ai.DevlabSpec_DiskSpec{
>            Type:      compute.DiskSpec_NETWORK_SSD,
>            SizeBytes: 268435456000,
>        },
>        Workspace: &ai.DevlabSpec_Workspace{},
>    }
>    createService := sdk.Services().Ai().V1().Devlab()
>    createOperation, err := createService.Create(
>        ctx,
>        &ai.CreateDevlabRequest{
>            Metadata: &common.ResourceMetadata{
>                ParentId: "<project_ID>",
>                Name:     "my-jupyter",
>            },
>            Spec: createSpec,
>        },
>    )
>    if err != nil {
>        return fmt.Errorf("create devlab: %w", err)
>    }
>    if _, err = createOperation.Wait(ctx); err != nil {
>        return fmt.Errorf("wait for devlab creation: %w", err)
>    }
>    ```
>
>    In the request, set:
>
>    * `Metadata.ParentId`: [Project ID](https://docs.nebius.com/iam/manage-projects.md#go-sdk-3).
>    * `Spec.Template.InputFieldValues["jupyter_token"]`: Token that you generated in the previous step.
>    * `Spec.Platform`: [VM platform](https://docs.nebius.com/compute/virtual-machines/types.md). Choose a platform supported by the JupyterLab template.
>    * `Spec.Preset`: Number of GPUs, vCPUs, and RAM allocated to the Devlab. Choose a preset available on the selected platform.
>    * `Spec.Disk.SizeBytes`: Disk size in bytes. The sample uses `268435456000` (250 GiB).

> [tab] Python SDK
>
> 1. Generate a random Jupyter token of exactly 16 alphanumeric characters:
>
>    ```python theme={null}
>    jupyter_token = secrets.token_hex(8)
>    ```
>
>    Save the value of `jupyter_token` securely. You need the token to sign in to JupyterLab.
>
> 2. Create a Devlab from the JupyterLab template:
>
>    ```python theme={null}
>    create_spec = DevlabSpec(
>        template=DevlabSpec__Template(
>            id="vmapptemplate-g00devlab-jupyter",
>            input_field_values={
>                "jupyter_token": Value(
>                    string_value="<jupyter_token>",
>                ),
>            },
>        ),
>        platform="<platform_ID>",
>        preset="<preset>",
>        disk=DevlabSpec__DiskSpec(
>            type=DiskSpec__DiskType.NETWORK_SSD,
>            size_bytes=268435456000,
>        ),
>        workspace=DevlabSpec__Workspace(),
>    )
>    create_service = DevlabServiceClient(sdk)
>    create_operation = await create_service.create(
>        CreateDevlabRequest(
>            metadata=ResourceMetadata(
>                parent_id="<project_ID>",
>                name="my-jupyter",
>            ),
>            spec=create_spec,
>        ),
>    )
>    await create_operation.wait()
>    ```
>
>    In the request, set:
>
>    * `metadata.parent_id`: [Project ID](https://docs.nebius.com/iam/manage-projects.md#python-sdk-3).
>    * `spec.template.input_field_values["jupyter_token"]`: Token that you generated in the previous step.
>    * `spec.platform`: [VM platform](https://docs.nebius.com/compute/virtual-machines/types.md). Choose a platform supported by the JupyterLab template.
>    * `spec.preset`: Number of GPUs, vCPUs, and RAM allocated to the Devlab. Choose a preset available on the selected platform.
>    * `spec.disk.size_bytes`: Disk size in bytes. The sample uses `268435456000` (250 GiB).

> [tab] JavaScript SDK
>
> 1. Generate a random Jupyter token of exactly 16 alphanumeric characters:
>
>    ```ts theme={null}
>    jupyterToken = randomBytes(8).toString("hex");
>    ```
>
>    Save the value of `jupyterToken` securely. You need the token to sign in to JupyterLab.
>
> 2. Create a Devlab from the JupyterLab template:
>
>    ```ts theme={null}
>    const createSpec = DevlabSpec.create({
>      template: {
>        id: "vmapptemplate-g00devlab-jupyter",
>        inputFieldValues: {
>          jupyter_token: "<jupyter_token>",
>        },
>      },
>      platform: "<platform_ID>",
>      preset: "<preset>",
>      disk: {
>        type: DiskSpec_DiskType.NETWORK_SSD,
>        sizeBytes: 268435456000,
>      },
>      workspace: {},
>    });
>    const createService = new DevlabService(sdk);
>    const createOperation = await createService.create(
>      CreateDevlabRequest.create({
>        metadata: {
>          parentId: "<project_ID>",
>          name: "my-jupyter",
>        },
>        spec: createSpec,
>      }),
>    ).result;
>    await createOperation.wait();
>    ```
>
>    In the request, set:
>
>    * `metadata.parentId`: [Project ID](https://docs.nebius.com/iam/manage-projects.md#javascript-sdk-3).
>    * `spec.template.inputFieldValues.jupyter_token`: Token that you generated in the previous step.
>    * `spec.platform`: [VM platform](https://docs.nebius.com/compute/virtual-machines/types.md). Choose a platform supported by the JupyterLab template.
>    * `spec.preset`: Number of GPUs, vCPUs, and RAM allocated to the Devlab. Choose a preset available on the selected platform.
>    * `spec.disk.sizeBytes`: Disk size in bytes. The sample uses `268435456000` (250 GiB).

Wait for the Devlab to start running.

### Open JupyterLab

When the Devlab is running, open its managed HTTPS URL in a browser. A public IP address isn't required.

> [tab] Web console
>
> 1. In the sidebar, go to  **Serverless AI** → **Devlabs**.
> 2. Open the page of the required Devlab.
> 3. Wait until the Devlab is running. Then, in the **Network** section, copy the public Devlab address from the **Public Devlabs** field.
> 4. In a browser, open the URL and enter the Jupyter token in the JupyterLab password field. Use the token that the console generated when you created the Devlab.

> [tab] CLI
>
> 1. List Devlabs and find the Devlab that you created (`my-jupyter`):
>
>    ```bash theme={null}
>    nebius ai devlab list
>    ```
>
> 2. Save the Devlab ID to an environment variable:
>
>    ```bash theme={null}
>    export DEVLAB_ID=$(nebius ai devlab get-by-name \
>      --name my-jupyter \
>      --format jsonpath='{.metadata.id}')
>    ```
>
> 3. Get the Devlab details and copy the HTTPS URL from the output:
>
>    ```bash theme={null}
>    nebius ai devlab get "$DEVLAB_ID"
>    ```
>
> 4. In a browser, open the HTTPS URL and enter the Jupyter token in the JupyterLab password field. Use the `$JUPYTER_TOKEN` value that you set at create time.

> [tab] Go SDK
>
> 1. List Devlabs and find the Devlab that you created (`my-jupyter`):
>
>    ```go theme={null}
>    listDevlabService := sdk.Services().Ai().V1().Devlab()
>    listDevlabsRequest := &ai.ListDevlabsRequest{
>        ParentId: "<project_ID>",
>    }
>    for {
>        devlabs, err := listDevlabService.List(
>            ctx, listDevlabsRequest,
>        )
>        if err != nil {
>            return fmt.Errorf("list devlabs: %w", err)
>        }
>        fmt.Println(devlabs)
>        if devlabs.GetNextPageToken() == "" {
>            break
>        }
>        listDevlabsRequest.PageToken = devlabs.GetNextPageToken()
>    }
>    ```
>
>    In `ai.ListDevlabsRequest`, set `ParentId` to the [project ID](https://docs.nebius.com/iam/manage-projects.md#go-sdk-3). In the response, copy the `Metadata.Id` of `my-jupyter`.
>
> 2. Get the Devlab details:
>
>    ```go theme={null}
>    getDevlabService := sdk.Services().Ai().V1().Devlab()
>    devlab, err := getDevlabService.Get(
>        ctx,
>        &ai.GetDevlabRequest{Id: "<devlab_ID>"},
>    )
>    if err != nil {
>        return fmt.Errorf("get devlab: %w", err)
>    }
>    fmt.Println(devlab)
>    ```
>
>    In `ai.GetDevlabRequest`, set `Id` to the Devlab ID that you copied. Copy the HTTPS URL from `Status.PublicEndpoints` in the response.
>
> 3. In a browser, open the HTTPS URL and enter the token saved in `jupyterToken` in the JupyterLab password field.

> [tab] Python SDK
>
> 1. List Devlabs and find the Devlab that you created (`my-jupyter`):
>
>    ```python theme={null}
>    list_devlab_service = DevlabServiceClient(sdk)
>    list_devlabs_request = ListDevlabsRequest(
>        parent_id="<project_ID>",
>    )
>    while True:
>        devlabs = await list_devlab_service.list(
>            list_devlabs_request,
>        )
>        print(devlabs)
>        if not devlabs.next_page_token:
>            break
>        list_devlabs_request.page_token = devlabs.next_page_token
>    ```
>
>    In `ListDevlabsRequest`, set `parent_id` to the [project ID](https://docs.nebius.com/iam/manage-projects.md#python-sdk-3). In the response, copy the `metadata.id` of `my-jupyter`.
>
> 2. Get the Devlab details:
>
>    ```python theme={null}
>    get_devlab_service = DevlabServiceClient(sdk)
>    devlab = await get_devlab_service.get(
>        GetDevlabRequest(id="<devlab_ID>"),
>    )
>    print(devlab)
>    ```
>
>    In `GetDevlabRequest`, set `id` to the Devlab ID that you copied. Copy the HTTPS URL from `status.public_endpoints` in the response.
>
> 3. In a browser, open the HTTPS URL and enter the token saved in `jupyter_token` in the JupyterLab password field.

> [tab] JavaScript SDK
>
> 1. List Devlabs and find the Devlab that you created (`my-jupyter`):
>
>    ```ts theme={null}
>    const listDevlabService = new DevlabService(sdk);
>    const listDevlabsRequest = ListDevlabsRequest.create({
>      parentId: "<project_ID>",
>    });
>    while (true) {
>      const devlabs = await listDevlabService.list(
>        listDevlabsRequest,
>      );
>      console.log(devlabs);
>      if (!devlabs.nextPageToken) {
>        break;
>      }
>      listDevlabsRequest.pageToken = devlabs.nextPageToken;
>    }
>    ```
>
>    In `ListDevlabsRequest`, set `parentId` to the [project ID](https://docs.nebius.com/iam/manage-projects.md#javascript-sdk-3). In the response, copy the `metadata.id` of `my-jupyter`.
>
> 2. Get the Devlab details:
>
>    ```ts theme={null}
>    const getDevlabService = new DevlabService(sdk);
>    const devlab = await getDevlabService.get(
>      GetDevlabRequest.create({ id: "<devlab_ID>" }),
>    );
>    console.log(devlab);
>    ```
>
>    In `GetDevlabRequest`, set `id` to the Devlab ID that you copied. Copy the HTTPS URL from `status.publicEndpoints` in the response.
>
> 3. In a browser, open the HTTPS URL and enter the token saved in `jupyterToken` in the JupyterLab password field.

### View logs

> [tab] Web console
>
> 1. In the sidebar, go to  **Serverless AI** → **Devlabs**.
> 2. In the Devlab list, next to the Devlab, click **View logs**. Alternatively, click  → **View logs**.

> [tab] CLI
>
> View Devlab logs:
>
> ```bash theme={null}
> nebius ai devlab logs "$DEVLAB_ID" --follow
> ```

## Expected results

* The JupyterLab Devlab reaches the **Running** status.
* You can open JupyterLab from the managed HTTPS URL and sign in with the Jupyter token in the password field.
* You can view Devlab logs.

## Delete the Devlab

If you no longer need the Devlab, delete it. Once you delete the Devlab, you will not be charged for its computing resources or container disk.

> [tab] Web console
>
> 1. In the sidebar, go to  **Serverless AI** → **Devlabs**.
> 2. In the Devlab list, find the Devlab and click  → **Delete**.
> 3. Confirm the Devlab deletion.

> [tab] CLI
>
> ```bash theme={null}
> nebius ai devlab delete "$DEVLAB_ID"
> ```

> [tab] Go SDK
>
> ```go theme={null}
> deleteDevlabService := sdk.Services().Ai().V1().Devlab()
> deleteDevlabOperation, err := deleteDevlabService.Delete(
>     ctx,
>     &ai.DeleteDevlabRequest{Id: "<devlab_ID>"},
> )
> if err != nil {
>     return fmt.Errorf("delete devlab: %w", err)
> }
> if _, err = deleteDevlabOperation.Wait(ctx); err != nil {
>     return fmt.Errorf("wait for devlab delete: %w", err)
> }
> ```
>
> In `ai.DeleteDevlabRequest`, set `Id` to the Devlab ID that you copied when you opened JupyterLab. The sample waits for deletion to complete.

> [tab] Python SDK
>
> ```python theme={null}
> delete_devlab_service = DevlabServiceClient(sdk)
> delete_devlab_operation = await delete_devlab_service.delete(
>     DeleteDevlabRequest(id="<devlab_ID>"),
> )
> await delete_devlab_operation.wait()
> ```
>
> In `DeleteDevlabRequest`, set `id` to the Devlab ID that you copied when you opened JupyterLab. The sample waits for deletion to complete.

> [tab] JavaScript SDK
>
> ```ts theme={null}
> const deleteDevlabService = new DevlabService(sdk);
> const deleteDevlabOperation = await deleteDevlabService.delete(
>   DeleteDevlabRequest.create({ id: "<devlab_ID>" }),
> ).result;
> await deleteDevlabOperation.wait();
> ```
>
> In `DeleteDevlabRequest`, set `id` to the Devlab ID that you copied when you opened JupyterLab. The sample waits for deletion to complete.

## See also

* [Managing Devlabs in Serverless AI](https://docs.nebius.com/serverless/devlabs/manage.md)
* [About Serverless AI](https://docs.nebius.com/serverless/overview.md)

*"Jupyter" and the Jupyter logos are trademarks or registered trademarks of LF Charities, used by Nebius B.V. with permission.*
