> ## 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.

# How to create a Devlab

> Create Devlabs from templates or custom container images.

*Serverless AI Devlabs* run container images as interactive development environments. They are suitable for coding, prototyping, and debugging in the browser, including template-based setups such as code-server, JupyterLab®, or ComfyUI. Each Devlab runs on a Compute virtual machine (VM) managed by Serverless AI.

## Prerequisites

> [tab] Web console
>
> Make sure that you are in a [group](https://docs.nebius.com/iam/authorization/groups/index.md) that has the
> role within your
> .
> You can check this in the [Administration → IAM](https://console.nebius.com/iam) section of the 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 the
>   role within your
>   .
>   You can check this in the [Administration → IAM](https://console.nebius.com/iam) section of the web console.

> [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 the
>   role within your
>   .
>   You can check this in the [Administration → IAM](https://console.nebius.com/iam) section of the web console.

> [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 the
>   role within your
>   .
>   You can check this in the [Administration → IAM](https://console.nebius.com/iam) section of the web console.

> [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 the
>   role within your
>   .
>   You can check this in the [Administration → IAM](https://console.nebius.com/iam) section of the web console.

## Steps

To create an interactive development environment, create a Devlab:

> [tab] Web console
>
> > [!TIP]
> >
> > If you want to create a Devlab based on an existing one, find the Devlab on the **Serverless AI** → **Devlabs** page and click  → **Clone**. On the creation page that opens, review the prefilled settings, modify them if needed, and click **Create Devlab**.
>
> 1. In the sidebar, go to  **Serverless AI** → **Devlabs**.
>
> 2. Click  **Create Devlab**.
>
> 3. Specify the Devlab name.
>
> 4. Configure **Devlab settings**:
>
>    1. Select **Custom** to provide your own container image, or **Template** to start from a template.
>
>    2. If you selected **Custom**, in **Image path**, set the path to the container image.
>
>    3. If you use a private registry, click  **Add registry** and provide the details for your registry.
>
>    4. In **Ports**, set the container ports for the Devlab. For each port, select **HTTP** or **TCP**. You can add multiple ports. The primary web UI port gets the Devlab's managed HTTPS URL; other ports are shown in the Devlab status but aren't publicly routed.
>
>    5. (Optional) In **Entrypoint command**, specify the entrypoint command for the container.
>
>       If you need to pass container arguments, specify them in this field as well.
>
>    6. (Optional) In **Environment variables**, specify environment variables in key-value pairs.
>
>    7. (Optional) In **Secret environment variables**, click  **Create secret** to store a sensitive value in [SecretStash](https://docs.nebius.com/secretstash/overview.md) and inject it as an environment variable. In the window that opens, specify the **Key** (environment variable name) and **Value** (secret data), then click **Create**.
>
>    8. (Optional) Enable **Bearer token authentication** if you want to protect the Devlab web UI with a token.
>
>       1. Under **Token**, click  **Create**.
>       2. In the **Create secret with token** window, specify the secret **Name** and, optionally, a **Description**.
>       3. In **Token**, enter a token or click **Generate**. Copy and save the token securely before proceeding. The token is saved as the first value in a [SecretStash](https://docs.nebius.com/secretstash/overview.md) secret.
>       4. Click **Create secret**.
>
>       If token authentication is disabled, anyone with the Devlab URL can access the service.
>
> 5. (Optional) In **Platform**, select **With GPUs** or **Without GPUs**, then select the [platform](https://docs.nebius.com/compute/virtual-machines/types.md).
>
> 6. (Optional) In **Settings**, select the [preset](https://docs.nebius.com/compute/virtual-machines/types.md). The preset must match the selected platform.
>
> 7. (Optional) Configure **Storage** settings:
>
>    * Under **Container disk size**, specify at least 50 GiB for GPU workloads or 20 GiB for CPU-only workloads. If the container image requires a bigger disk size, set at least the minimum required value for the image. Otherwise, the workloads won't be able to launch. For more information, see how [disk performance depends on disk size](https://docs.nebius.com/compute/storage/types.md#disk-performance).
>
>      Data under the workspace path on this disk persists across stop and restart. The workspace is a path on the container disk (`/workspace` by default, or the path declared by the template). Its size is limited only by the disk size. While the Devlab is stopped, the entire container disk continues to be billed.
>
>    * Under **Mounted volumes**, click **Attach volume** to attach a bucket or a filesystem. You can create a bucket or filesystem, or use an existing one. To create a new bucket, see [Bucket parameters](https://docs.nebius.com/object-storage/buckets/manage.md#bucket-parameters-web-console). To create a new filesystem, see [Volume parameters](https://docs.nebius.com/compute/storage/manage.md#volume-parameters).
>
> 8. (Optional) In **Files**, upload files or create text files to inject into the container. The maximum file size is 64 KB.
>
> 9. Configure the **Network** section:
>
>    * Select a network and a subnet, or create a new subnet.
>    * Select the IP address type: **Auto dynamic IP** or **Private IP**.
>
>      A public IP address isn't required to open the Devlab web UI over the managed HTTPS URL. If you add an SSH key, make sure that network access allows SSH so you can connect to the VM.
>
> 10. Click **Create Devlab**.

> [tab] CLI
>
> 1. If you want to create a Devlab from a template, list the available templates and choose one:
>
>    ```bash theme={null}
>    nebius ai devlab template list
>    ```
>
> 2. Create the Devlab. Use either a template or a container image:
>
>    * From a template:
>
>      ```bash theme={null}
>      nebius ai devlab create \
>        --name <devlab_name> \
>        --template <template> \
>        --input <key>=<value> \
>        --env <key>=<value> \
>        --env-secret <key>=<secret_selector> \
>        --container-port <port> \
>        --workspace-path <absolute_path> \
>        --volume <source:container_path[:mode]|s3://bucket:/container_path[:mode[:profile]]> \
>        --inject-file "<local_path>:<absolute_container_path>" \
>        --platform <platform_ID> \
>        --preset <preset> \
>        --disk-size <size> \
>        --shm-size <size> \
>        --ssh-key <SSH_public_key> \
>        --public
>      ```
>
>    > [accordion] Example: Create a Devlab from the JupyterLab template
>    >
>    > ```bash theme={null}
>    > nebius ai devlab create \
>    >   --name my-jupyter \
>    >   --template jupyter \
>    >   --input jupyter_token=A1b2C3d4E5f6G7h8
>    > ```
>    >
>    > Provide your own random Jupyter token as `--input jupyter_token=<token>`. The token must contain exactly 16 alphanumeric characters. For example, you can generate one with `openssl rand -hex 8`.
>
>    * From a container image:
>
>      ```bash theme={null}
>      nebius ai devlab create \
>        --name <devlab_name> \
>        --image <image> \
>        --registry-secret <secret_selector> \
>        --container-command "<command>" \
>        --args "<arguments>" \
>        --working-dir <absolute_path> \
>        --primary-route-port <port> \
>        --env <key>=<value> \
>        --env-secret <key>=<secret_selector> \
>        --container-port <port> \
>        --workspace-path <absolute_path> \
>        --volume <source:container_path[:mode]|s3://bucket:/container_path[:mode[:profile]]> \
>        --inject-file "<local_path>:<absolute_container_path>" \
>        --platform <platform_ID> \
>        --preset <preset> \
>        --disk-size <size> \
>        --shm-size <size> \
>        --ssh-key <SSH_public_key> \
>        --public
>      ```
>
>    > [accordion] Example: Create a Devlab from a container image
>    >
>    > ```bash theme={null}
>    > nebius ai devlab create \
>    >   --name nginx-devlab \
>    >   --image docker.io/library/nginx:1.27-alpine \
>    >   --platform cpu-e2 \
>    >   --primary-route-port 80
>    > ```
>
> In the command, specify the following parameters:
>
> * **Devlab settings:**
>
>   * `--name`: Devlab name.
>
>   * `--template` or `--image`: How to define the container. Specify one of these parameters:
>
>     * `--template`: Template to use, for example, `jupyter`. Mutually exclusive with `--image`. The template declares the container image, entrypoint command, arguments, working directory, ports, primary web route, and the default workspace path. Don't set `--image`, `--container-command`, `--args`, `--working-dir`, or `--primary-route-port` with `--template`. To see available templates, run `nebius ai devlab template list`.
>     * `--image`: Container image reference in the `registry/path:tag` or `registry/path@digest` format. Mutually exclusive with `--template`. Required unless you set `--template`.
>
>   * `--input` (optional for some templates; required for JupyterLab): Template input in the `key=value` format. Requires `--template`. To set several inputs, repeat the parameter.
>
>     For the JupyterLab template, set `--input jupyter_token=<token>`, where `<token>` is a random string of exactly 16 alphanumeric characters that you provide.
>
>   * `--registry-secret` (optional): [SecretStash](https://docs.nebius.com/secretstash/overview.md) secret selector with `REGISTRY_USERNAME` and `REGISTRY_PASSWORD` payload keys. You can specify a secret name, secret ID, version ID, or a combined secret/version selector such as `mbsec-e00***@mbsecver-e00***`. Use when you pull an image from a private registry. Applies only with `--image`.
>
>   * `--container-command` (optional): Entrypoint command for the container. Applies only with `--image`. Declared by the template when you use `--template`.
>
>   * `--args` (optional): Arguments for the entrypoint command. Applies only with `--image`. Declared by the template when you use `--template`.
>
>   * `--working-dir` (optional): Working directory (absolute path). Applies only with `--image`. Declared by the template when you use `--template`.
>
>   * `--primary-route-port`: Container port for the primary web UI behind the managed HTTPS URL. Required with `--image`. Declared by the template when you use `--template`. Must match an HTTP port from `--container-port`.
>
>   * `--env` (optional): Environment variables for the container in the `key=value` format. To set several variables, repeat the parameter. With `--template`, these variables extend the template-declared ones.
>
>   * `--env-secret` (optional): Environment variables loaded from a [SecretStash](https://docs.nebius.com/secretstash/overview.md) secret in the `key=secret_selector` format. The value can be a secret name, secret ID, version ID, or a combined secret/version selector such as `mbsec-e00***@mbsecver-e00***`. To set several variables, repeat the parameter.
>
>   * `--container-port` (optional): Port to expose from the container, for example, `8080/http` or `9000/tcp`. Supported protocols are `http`, `tcp`, and `udp`. To expose several ports, repeat the parameter. With `--template`, these ports extend the template-declared ones. Additional ports appear in the Devlab status but aren't publicly routed unless they are the primary web route.
>
>   * `--workspace-path` (optional): Absolute path of the workspace on the container disk. Data under this path persists across stop and restart. The default is `/workspace`. With `--template`, the template can declare a different path. You can set this path in the CLI or API; the web console does not expose it. The path must not overlap mounted volume paths. The workspace size is limited only by the container disk size (`--disk-size`).
>
>   * `--volume` (optional): [Bucket](https://docs.nebius.com/object-storage/overview.md#buckets) or [shared filesystem](https://docs.nebius.com/compute/storage/types.md#shared-filesystems) to mount to the Devlab container. Volume mount paths must not overlap the workspace path.
>
>     Specify the value in either format:
>
>     * `source:container_path[:mode]` for mounting an Object Storage bucket or a shared filesystem by ID. To get an ID, run `nebius storage bucket get-by-name --name <bucket_name>` or `nebius compute filesystem get-by-name --name <filesystem_name>`.
>     * `s3://bucket:/container_path[:mode[:profile]]` for mounting an Object Storage bucket with AWS profile credentials or S3 credentials stored in SecretStash. The `profile` is the AWS credentials profile to use. If you manage your credentials with [SecretStash](https://docs.nebius.com/secretstash/overview.md), use `profile@<secret_selector>`, where `<secret_selector>` is a secret name, secret ID, version ID, or a combined secret/version selector such as `mbsec-e00***@mbsecver-e00***`.
>
>     The supported modes are `ro`, read only, and `rw`, read-write (default). Repeat for multiple volumes. For example:
>
>     ```bash theme={null}
>     --volume 'computefilesystem-e***:/input:ro' \
>     --volume 'storagebucket-e***:/output:rw' \
>     --volume 's3://training-results:/output:rw:default'
>     ```
>
>   * `--inject-file` (optional): Mount a local file into the Devlab container at launch. Use the format `<local_path>:<absolute_container_path>`. To inject multiple files, repeat the parameter. The mounted file is read-only and limited to 64 KiB.
> * **Underlying VM characteristics:**
>
>   * `--platform` (optional): VM platform. If you omit the parameter, the CLI selects the default GPU platform. For CPU-only templates, such as Open WebUI, specify a CPU platform explicitly. See available platforms in [Types of virtual machines and GPUs in Nebius AI Cloud](https://docs.nebius.com/compute/virtual-machines/types.md).
>
>   * `--preset` (optional): Number of GPUs, vCPUs, and RAM allocated to the container. If you omit the parameter, the CLI selects the smallest suitable preset for the platform. The preset must match the selected platform. See available presets in [Presets for GPU platforms](https://docs.nebius.com/compute/virtual-machines/types.md#presets-for-gpu-platforms).
>
>   * `--disk-size` (optional): Disk size of the underlying VM, for example, `100Gi`, `500Gi`, or `1Ti`. If you omit the parameter, the default value `250Gi` applies.
>
>     Set at least 50 GiB for GPU workloads or 20 GiB for CPU-only workloads. If the container image requires a bigger disk size, set at least the minimum required value for the image. Otherwise, the workloads won't be able to launch.
>
>     For more information, see how [disk performance depends on disk size](https://docs.nebius.com/compute/storage/types.md#disk-performance).
>
>   * `--shm-size` (optional): Shared memory size of `/dev/shm`, for example, `64Mi`, `128Mi` or `1Gi`. With `--template`, you can set this only when the template leaves shared memory unset.
>
>   * `--ssh-key` (optional): SSH public key to access the underlying VM by SSH. When you add an SSH key, a public dynamic IP address is assigned. Before you add the key, check the **Public IPv4 addresses** (Quota ID: `vpc.ipv4-address.public.count`) quota.
>
>   * `--public` (optional): Assigns a [public IP address](https://docs.nebius.com/compute/virtual-machines/network.md#public-ip-addresses) to the underlying VM. Not required to open the Devlab web UI over the managed HTTPS URL.

> [tab] Go SDK
>
> 1. If you want to create a Devlab from a template, list the templates and copy the required template's `Metadata.Id`:
>
>    ```go theme={null}
>    listTemplateService := sdk.Services().Applications().
>        V1Alpha1().VmAppTemplate()
>    listTemplatesRequest := &apps.ListVmAppTemplatesRequest{
>        GlobalOnly: true,
>        Kind:       "devlab",
>    }
>    for {
>        templates, err := listTemplateService.List(
>            ctx, listTemplatesRequest,
>        )
>        if err != nil {
>            return fmt.Errorf("list devlab templates: %w", err)
>        }
>        fmt.Println(templates)
>        if templates.GetNextPageToken() == "" {
>            break
>        }
>        listTemplatesRequest.PageToken =
>            templates.GetNextPageToken()
>    }
>    ```
>
> 2. Create the Devlab. Use either a template or a container image:
>
>    * From a template:
>
>      ```go theme={null}
>      templateFile, err := os.ReadFile("<local_path>")
>      if err != nil {
>          return fmt.Errorf("read injected file: %w", err)
>      }
>      templateSpec := &ai.DevlabSpec{
>          Template: &ai.DevlabSpec_Template{
>              Id: "<template_ID>",
>              InputFieldValues: map[string]*structpb.Value{
>                  "jupyter_token": structpb.NewStringValue(
>                      "<jupyter_token>",
>                  ),
>              },
>          },
>          EnvironmentVariables: []*ai.DevlabSpec_EnvironmentVariable{
>              {
>                  Name: "DEVLAB_ENV",
>                  ValueSource: &ai.DevlabSpec_EnvironmentVariable_Value{
>                      Value: "<value>",
>                  },
>              },
>          },
>          Ports: []*ai.DevlabSpec_Port{
>              {
>                  ContainerPort: <port>,
>                  Protocol:      ai.DevlabSpec_Port_HTTP,
>              },
>          },
>          Volumes: []*ai.DevlabSpec_VolumeMount{
>              {
>                  Source:        "<bucket_ID>",
>                  ContainerPath: "<container_path>",
>                  Mode:          ai.DevlabSpec_VolumeMount_READ_WRITE,
>              },
>          },
>          InjectedFiles: []*ai.DevlabSpec_FileInjection{
>              {
>                  ContainerPath: "<absolute_container_path>",
>                  Content:       templateFile,
>              },
>          },
>          SshAuthorizedKeys: []string{
>              "<SSH_public_key>",
>          },
>          PublicIp: true,
>          Platform: "<platform_ID>",
>          Preset:   "<preset>",
>          Disk: &ai.DevlabSpec_DiskSpec{
>              Type:      compute.DiskSpec_NETWORK_SSD,
>              SizeBytes: <disk_size_in_bytes>,
>          },
>          Workspace: &ai.DevlabSpec_Workspace{
>              ContainerPath: "<absolute_path>",
>          },
>      }
>      templateSecretID := "<secret_ID>"
>      if templateSecretID != "" {
>          templateSecret :=
>              &ai.DevlabSpec_EnvironmentVariable_MysteryboxSecret{
>                  MysteryboxSecret: &ai.DevlabSpec_MysteryBoxSecretRef{
>                      SecretId: templateSecretID,
>                  },
>              }
>          templateSpec.EnvironmentVariables = append(
>              templateSpec.EnvironmentVariables,
>              &ai.DevlabSpec_EnvironmentVariable{
>                  Name:        "DEVLAB_SECRET",
>                  ValueSource: templateSecret,
>              },
>          )
>      }
>      templateService := sdk.Services().Ai().V1().Devlab()
>      templateOperation, err := templateService.Create(
>          ctx,
>          &ai.CreateDevlabRequest{
>              Metadata: &common.ResourceMetadata{
>                  ParentId: "<project_ID>",
>                  Name:     "<devlab_name>",
>              },
>              Spec: templateSpec,
>          },
>      )
>      if err != nil {
>          return fmt.Errorf("create devlab: %w", err)
>      }
>      if _, err = templateOperation.Wait(ctx); err != nil {
>          return fmt.Errorf("wait for devlab creation: %w", err)
>      }
>      ```
>
>      > [accordion] Example: Create a Devlab from the JupyterLab template
>      >
>      > ```go theme={null}
>      > jupyterSpec := &ai.DevlabSpec{
>      >     Template: &ai.DevlabSpec_Template{
>      >         Id: "vmapptemplate-g00devlab-jupyter",
>      >         InputFieldValues: map[string]*structpb.Value{
>      >             "jupyter_token": structpb.NewStringValue(
>      >                 "A1b2C3d4E5f6G7h8",
>      >             ),
>      >         },
>      >     },
>      >     Platform: "<platform_ID>",
>      >     Preset:   "<preset>",
>      >     Disk: &ai.DevlabSpec_DiskSpec{
>      >         Type:      compute.DiskSpec_NETWORK_SSD,
>      >         SizeBytes: 268435456000,
>      >     },
>      >     Workspace: &ai.DevlabSpec_Workspace{},
>      > }
>      > jupyterService := sdk.Services().Ai().V1().Devlab()
>      > jupyterOperation, err := jupyterService.Create(
>      >     ctx,
>      >     &ai.CreateDevlabRequest{
>      >         Metadata: &common.ResourceMetadata{
>      >             ParentId: "<project_ID>",
>      >             Name:     "my-jupyter",
>      >         },
>      >         Spec: jupyterSpec,
>      >     },
>      > )
>      > if err != nil {
>      >     return fmt.Errorf("create devlab: %w", err)
>      > }
>      > if _, err = jupyterOperation.Wait(ctx); err != nil {
>      >     return fmt.Errorf("wait for devlab creation: %w", err)
>      > }
>      > ```
>      >
>      > Replace the sample Jupyter token with your own random token of exactly 16 alphanumeric characters. Save the token securely to sign in to JupyterLab.
>
>    * From a container image:
>
>      ```go theme={null}
>      imageFile, err := os.ReadFile("<local_path>")
>      if err != nil {
>          return fmt.Errorf("read injected file: %w", err)
>      }
>      imageSpec := &ai.DevlabSpec{
>          Image: "<image>",
>          PrimaryRoute: &ai.DevlabSpec_PrimaryRoute{
>              ContainerPort: <port>,
>          },
>          Ports: []*ai.DevlabSpec_Port{
>              {
>                  ContainerPort: <port>,
>                  Protocol:      ai.DevlabSpec_Port_HTTP,
>              },
>          },
>          ContainerCommand: "<command>",
>          Args:             "<arguments>",
>          WorkingDir:       "<absolute_path>",
>          ShmSizeBytes:     <shared_memory_size_in_bytes>,
>          EnvironmentVariables: []*ai.DevlabSpec_EnvironmentVariable{
>              {
>                  Name: "DEVLAB_ENV",
>                  ValueSource: &ai.DevlabSpec_EnvironmentVariable_Value{
>                      Value: "<value>",
>                  },
>              },
>          },
>          Volumes: []*ai.DevlabSpec_VolumeMount{
>              {
>                  Source:        "<bucket_ID>",
>                  ContainerPath: "<container_path>",
>                  Mode:          ai.DevlabSpec_VolumeMount_READ_WRITE,
>              },
>          },
>          InjectedFiles: []*ai.DevlabSpec_FileInjection{
>              {
>                  ContainerPath: "<absolute_container_path>",
>                  Content:       imageFile,
>              },
>          },
>          SshAuthorizedKeys: []string{
>              "<SSH_public_key>",
>          },
>          PublicIp: true,
>          Platform: "<platform_ID>",
>          Preset:   "<preset>",
>          Disk: &ai.DevlabSpec_DiskSpec{
>              Type:      compute.DiskSpec_NETWORK_SSD,
>              SizeBytes: <disk_size_in_bytes>,
>          },
>          Workspace: &ai.DevlabSpec_Workspace{
>              ContainerPath: "<absolute_path>",
>          },
>      }
>      imageSecretID := "<secret_ID>"
>      if imageSecretID != "" {
>          imageSecret :=
>              &ai.DevlabSpec_EnvironmentVariable_MysteryboxSecret{
>                  MysteryboxSecret: &ai.DevlabSpec_MysteryBoxSecretRef{
>                      SecretId: imageSecretID,
>                  },
>              }
>          imageSpec.EnvironmentVariables = append(
>              imageSpec.EnvironmentVariables,
>              &ai.DevlabSpec_EnvironmentVariable{
>                  Name:        "DEVLAB_SECRET",
>                  ValueSource: imageSecret,
>              },
>          )
>      }
>      imageRegistryVersion := "<secret_version_ID>"
>      if imageRegistryVersion != "" {
>          imageSpec.RegistryCredentials =
>              &ai.DevlabSpec_RegistryCredentials{
>                  MysteryboxSecretVersion: imageRegistryVersion,
>              }
>      }
>      imageService := sdk.Services().Ai().V1().Devlab()
>      imageOperation, err := imageService.Create(
>          ctx,
>          &ai.CreateDevlabRequest{
>              Metadata: &common.ResourceMetadata{
>                  ParentId: "<project_ID>",
>                  Name:     "<devlab_name>",
>              },
>              Spec: imageSpec,
>          },
>      )
>      if err != nil {
>          return fmt.Errorf("create devlab: %w", err)
>      }
>      if _, err = imageOperation.Wait(ctx); err != nil {
>          return fmt.Errorf("wait for devlab creation: %w", err)
>      }
>      ```
>
>      > [accordion] Example: Create a Devlab from a container image
>      >
>      > ```go theme={null}
>      > nginxSpec := &ai.DevlabSpec{
>      >     Image: "docker.io/library/nginx:1.27-alpine",
>      >     PrimaryRoute: &ai.DevlabSpec_PrimaryRoute{
>      >         ContainerPort: 80,
>      >     },
>      >     Ports: []*ai.DevlabSpec_Port{
>      >         {
>      >             ContainerPort: 80,
>      >             Protocol:      ai.DevlabSpec_Port_HTTP,
>      >         },
>      >     },
>      >     Platform: "cpu-e2",
>      >     Preset:   "2vcpu-8gb",
>      >     Disk: &ai.DevlabSpec_DiskSpec{
>      >         Type:      compute.DiskSpec_NETWORK_SSD,
>      >         SizeBytes: 268435456000,
>      >     },
>      >     Workspace: &ai.DevlabSpec_Workspace{
>      >         ContainerPath: "/workspace",
>      >     },
>      > }
>      > nginxService := sdk.Services().Ai().V1().Devlab()
>      > nginxOperation, err := nginxService.Create(
>      >     ctx,
>      >     &ai.CreateDevlabRequest{
>      >         Metadata: &common.ResourceMetadata{
>      >             ParentId: "<project_ID>",
>      >             Name:     "nginx-devlab",
>      >         },
>      >         Spec: nginxSpec,
>      >     },
>      > )
>      > if err != nil {
>      >     return fmt.Errorf("create devlab: %w", err)
>      > }
>      > if _, err = nginxOperation.Wait(ctx); err != nil {
>      >     return fmt.Errorf("wait for devlab creation: %w", err)
>      > }
>      > ```
>
>    In the request, specify the following parameters:
>
>    * **Devlab settings:**
>
>      * `Metadata.ParentId`: [Project ID](https://docs.nebius.com/iam/manage-projects.md#go-sdk-3).
>
>      * `Metadata.Name`: Devlab name.
>
>      * `Spec.Template.Id` or `Spec.Image`: How to define the container. Specify one of these parameters:
>
>        * `Spec.Template.Id`: Template ID. Copy its `Metadata.Id` from the template list. Mutually exclusive with `Spec.Image`. The template declares the container image, entrypoint command, arguments, working directory, ports, primary web route, and the default workspace path. Don't set `Spec.Image`, `Spec.ContainerCommand`, `Spec.Args`, `Spec.WorkingDir`, or `Spec.PrimaryRoute` with `Spec.Template`.
>        * `Spec.Image`: Container image reference in the `registry/path:tag` or `registry/path@digest` format. Mutually exclusive with `Spec.Template`. Required unless you set `Spec.Template`.
>
>      * `Spec.Template.InputFieldValues` (optional for some templates; required for JupyterLab): Template inputs as key-value pairs. Requires `Spec.Template`. To set several inputs, add an entry for each input.
>
>        For the JupyterLab template, set `Spec.Template.InputFieldValues["jupyter_token"]` to a random token of exactly 16 alphanumeric characters that you provide. Save the token securely to sign in later.
>
>      * `Spec.RegistryCredentials.MysteryboxSecretVersion` (optional): [SecretStash](https://docs.nebius.com/secretstash/overview.md) secret version ID with the `REGISTRY_USERNAME` and `REGISTRY_PASSWORD` payload keys. Use when you pull an image from a private registry. Applies only with `Spec.Image`.
>
>      * `Spec.ContainerCommand` (optional): Entrypoint command for the container. Applies only with `Spec.Image`. Declared by the template when you use `Spec.Template`.
>
>      * `Spec.Args` (optional): Arguments for the entrypoint command. Applies only with `Spec.Image`. Declared by the template when you use `Spec.Template`.
>
>      * `Spec.WorkingDir` (optional): Working directory (absolute path). Applies only with `Spec.Image`. Declared by the template when you use `Spec.Template`.
>
>      * `Spec.PrimaryRoute.ContainerPort`: Container port for the primary web UI behind the managed HTTPS URL. Required with `Spec.Image`. Declared by the template when you use `Spec.Template`. Must match an HTTP port from `Spec.Ports`.
>
>      * `Spec.EnvironmentVariables` (optional): Environment variables for the container. Set each variable's `Name` and `ValueSource`. To set several variables, add an entry for each variable. With `Spec.Template`, these variables extend the template-declared ones.
>
>        The samples set `DEVLAB_ENV` to `<value>` and optionally load `DEVLAB_SECRET` from a [SecretStash](https://docs.nebius.com/secretstash/overview.md) secret. For the secret, set `SecretId` in `ai.DevlabSpec_MysteryBoxSecretRef` to the secret ID.
>
>      * `Spec.Ports` (optional with `Spec.Template`; required with `Spec.Image`): Ports to expose from the container. Set each port's `ContainerPort` and `Protocol`. Supported protocols are HTTP, TCP, and UDP; the samples use `ai.DevlabSpec_Port_HTTP`. To expose several ports, add an entry for each port. With `Spec.Template`, these ports extend the template-declared ones. Additional ports appear in the Devlab status but aren't publicly routed unless they are the primary web route.
>
>      * `Spec.Workspace.ContainerPath`: Absolute path of the workspace on the container disk. Data under this path persists across stop and restart. Required with `Spec.Image`, for example, `/workspace`. With `Spec.Template`, the template declares a default path, which you can override. The path must not overlap mounted volume paths. The workspace size is limited only by the container disk size (`Spec.Disk.SizeBytes`).
>
>      * `Spec.Volumes` (optional): [Bucket](https://docs.nebius.com/object-storage/overview.md#buckets) or [shared filesystem](https://docs.nebius.com/compute/storage/types.md#shared-filesystems) to mount to the Devlab container. Set `Source` to the bucket or filesystem ID, and `ContainerPath` to the destination directory in the container. Volume mount paths must not overlap the workspace path. Set `Mode` to `ai.DevlabSpec_VolumeMount_READ_ONLY` for read-only access or `ai.DevlabSpec_VolumeMount_READ_WRITE` for read-write access. To mount several volumes, add an entry for each volume.
>
>      * `Spec.InjectedFiles` (optional): Mount local files into the Devlab container at launch. Set each file's `ContainerPath` to its absolute destination path and `Content` to the file's bytes. Replace `<local_path>` in `os.ReadFile` with the source file's local path. To inject multiple files, add an entry for each file. Each mounted file is read-only and limited to 64 KiB.
>    * **Underlying VM characteristics:**
>
>      * `Spec.Platform`: VM platform. Choose a platform supported by the template or image. For CPU-only templates, such as Open WebUI, specify a CPU platform. See available platforms in [Types of virtual machines and GPUs in Nebius AI Cloud](https://docs.nebius.com/compute/virtual-machines/types.md).
>
>      * `Spec.Preset`: Number of GPUs, vCPUs, and RAM allocated to the container. Choose a preset that matches the selected platform. See available presets in [Presets for GPU platforms](https://docs.nebius.com/compute/virtual-machines/types.md#presets-for-gpu-platforms).
>
>      * `Spec.Disk.SizeBytes`: Disk size of the underlying VM in bytes, for example, `96636764160` for 90 GiB.
>
>        Set at least 50 GiB for GPU workloads or 20 GiB for CPU-only workloads. If the container image requires a bigger disk size, set at least the minimum required value for the image. Otherwise, the workloads won't be able to launch.
>
>        For more information, see how [disk performance depends on disk size](https://docs.nebius.com/compute/storage/types.md#disk-performance).
>
>      * `Spec.ShmSizeBytes` (optional): Shared memory size of `/dev/shm` in bytes, for example, `67108864` for 64 MiB. With `Spec.Template`, you can set this only when the template leaves shared memory unset.
>
>      * `Spec.SshAuthorizedKeys` (optional): SSH public keys to access the underlying VM by SSH. To assign a public IP address, also set `Spec.PublicIp` to `true`. Before you add the keys, check the **Public IPv4 addresses** (Quota ID: `vpc.ipv4-address.public.count`) quota.
>
>      * `Spec.PublicIp` (optional): Set to `true` to assign a [public IP address](https://docs.nebius.com/compute/virtual-machines/network.md#public-ip-addresses) to the underlying VM. Not required to open the Devlab web UI over the managed HTTPS URL.
>
>    For optional secret parameters that you don't use, replace `<secret_ID>` or `<secret_version_ID>` with an empty string (`""`). The samples use a secret ID for `DEVLAB_SECRET` and a secret version ID for private-registry credentials.

> [tab] Python SDK
>
> 1. If you want to create a Devlab from a template, list the templates and copy the required template's `metadata.id`:
>
>    ```python theme={null}
>    template_service = VmAppTemplateServiceClient(sdk)
>    list_templates_request = ListVmAppTemplatesRequest(
>        global_only=True,
>        kind="devlab",
>    )
>    while True:
>        templates = await template_service.list(
>            list_templates_request,
>        )
>        print(templates)
>        if not templates.next_page_token:
>            break
>        list_templates_request.page_token = templates.next_page_token
>    ```
>
> 2. Create the Devlab. Use either a template or a container image:
>
>    * From a template:
>
>      ```python theme={null}
>      template_spec = DevlabSpec(
>          template=DevlabSpec__Template(
>              id="<template_ID>",
>              input_field_values={
>                  "jupyter_token": Value(
>                      string_value="<jupyter_token>",
>                  ),
>              },
>          ),
>          environment_variables=[
>              DevlabSpec__EnvironmentVariable(
>                  name="DEVLAB_ENV",
>                  value="<value>",
>              ),
>          ],
>          ports=[
>              DevlabSpec__Port(
>                  container_port=<port>,
>                  protocol=DevlabSpec__Port__Protocol.HTTP,
>              ),
>          ],
>          volumes=[
>              DevlabSpec__VolumeMount(
>                  source="<bucket_ID>",
>                  container_path="<container_path>",
>                  mode=DevlabSpec__VolumeMount__Mode.READ_WRITE,
>              ),
>          ],
>          injected_files=[
>              DevlabSpec__FileInjection(
>                  container_path="<absolute_container_path>",
>                  content=Path("<local_path>").read_bytes(),
>              ),
>          ],
>          ssh_authorized_keys=[
>              "<SSH_public_key>",
>          ],
>          public_ip=True,
>          platform="<platform_ID>",
>          preset="<preset>",
>          disk=DevlabSpec__DiskSpec(
>              type=DiskSpec__DiskType.NETWORK_SSD,
>              size_bytes=<disk_size_in_bytes>,
>          ),
>          workspace=DevlabSpec__Workspace(
>              container_path="<absolute_path>",
>          ),
>      )
>      template_secret_id = "<secret_ID>"
>      if template_secret_id:
>          template_spec.environment_variables.append(
>              DevlabSpec__EnvironmentVariable(
>                  name="DEVLAB_SECRET",
>                  mysterybox_secret=DevlabSpec__MysteryBoxSecretRef(
>                      secret_id=template_secret_id,
>                  ),
>              ),
>          )
>      template_service = DevlabServiceClient(sdk)
>      template_operation = await template_service.create(
>          CreateDevlabRequest(
>              metadata=ResourceMetadata(
>                  parent_id="<project_ID>",
>                  name="<devlab_name>",
>              ),
>              spec=template_spec,
>          ),
>      )
>      await template_operation.wait()
>      ```
>
>      > [accordion] Example: Create a Devlab from the JupyterLab template
>      >
>      > ```python theme={null}
>      > jupyter_spec = DevlabSpec(
>      >     template=DevlabSpec__Template(
>      >         id="vmapptemplate-g00devlab-jupyter",
>      >         input_field_values={
>      >             "jupyter_token": Value(
>      >                 string_value="A1b2C3d4E5f6G7h8",
>      >             ),
>      >         },
>      >     ),
>      >     platform="<platform_ID>",
>      >     preset="<preset>",
>      >     disk=DevlabSpec__DiskSpec(
>      >         type=DiskSpec__DiskType.NETWORK_SSD,
>      >         size_bytes=268435456000,
>      >     ),
>      >     workspace=DevlabSpec__Workspace(),
>      > )
>      > jupyter_service = DevlabServiceClient(sdk)
>      > jupyter_operation = await jupyter_service.create(
>      >     CreateDevlabRequest(
>      >         metadata=ResourceMetadata(
>      >             parent_id="<project_ID>",
>      >             name="my-jupyter",
>      >         ),
>      >         spec=jupyter_spec,
>      >     ),
>      > )
>      > await jupyter_operation.wait()
>      > ```
>      >
>      > Replace the sample Jupyter token with your own random token of exactly 16 alphanumeric characters. Save the token securely to sign in to JupyterLab.
>
>    * From a container image:
>
>      ```python theme={null}
>      image_spec = DevlabSpec(
>          image="<image>",
>          primary_route=DevlabSpec__PrimaryRoute(
>              container_port=<port>,
>          ),
>          ports=[
>              DevlabSpec__Port(
>                  container_port=<port>,
>                  protocol=DevlabSpec__Port__Protocol.HTTP,
>              ),
>          ],
>          container_command="<command>",
>          args="<arguments>",
>          working_dir="<absolute_path>",
>          shm_size_bytes=<shared_memory_size_in_bytes>,
>          environment_variables=[
>              DevlabSpec__EnvironmentVariable(
>                  name="DEVLAB_ENV",
>                  value="<value>",
>              ),
>          ],
>          volumes=[
>              DevlabSpec__VolumeMount(
>                  source="<bucket_ID>",
>                  container_path="<container_path>",
>                  mode=DevlabSpec__VolumeMount__Mode.READ_WRITE,
>              ),
>          ],
>          injected_files=[
>              DevlabSpec__FileInjection(
>                  container_path="<absolute_container_path>",
>                  content=Path("<local_path>").read_bytes(),
>              ),
>          ],
>          ssh_authorized_keys=[
>              "<SSH_public_key>",
>          ],
>          public_ip=True,
>          platform="<platform_ID>",
>          preset="<preset>",
>          disk=DevlabSpec__DiskSpec(
>              type=DiskSpec__DiskType.NETWORK_SSD,
>              size_bytes=<disk_size_in_bytes>,
>          ),
>          workspace=DevlabSpec__Workspace(
>              container_path="<absolute_path>",
>          ),
>      )
>      image_secret_id = "<secret_ID>"
>      if image_secret_id:
>          image_spec.environment_variables.append(
>              DevlabSpec__EnvironmentVariable(
>                  name="DEVLAB_SECRET",
>                  mysterybox_secret=DevlabSpec__MysteryBoxSecretRef(
>                      secret_id=image_secret_id,
>                  ),
>              ),
>          )
>      image_registry_version = "<secret_version_ID>"
>      if image_registry_version:
>          image_spec.registry_credentials = DevlabSpec__RegistryCredentials(
>              mysterybox_secret_version=image_registry_version,
>          )
>      image_service = DevlabServiceClient(sdk)
>      image_operation = await image_service.create(
>          CreateDevlabRequest(
>              metadata=ResourceMetadata(
>                  parent_id="<project_ID>",
>                  name="<devlab_name>",
>              ),
>              spec=image_spec,
>          ),
>      )
>      await image_operation.wait()
>      ```
>
>      > [accordion] Example: Create a Devlab from a container image
>      >
>      > ```python theme={null}
>      > nginx_spec = DevlabSpec(
>      >     image="docker.io/library/nginx:1.27-alpine",
>      >     primary_route=DevlabSpec__PrimaryRoute(
>      >         container_port=80,
>      >     ),
>      >     ports=[
>      >         DevlabSpec__Port(
>      >             container_port=80,
>      >             protocol=DevlabSpec__Port__Protocol.HTTP,
>      >         ),
>      >     ],
>      >     platform="cpu-e2",
>      >     preset="2vcpu-8gb",
>      >     disk=DevlabSpec__DiskSpec(
>      >         type=DiskSpec__DiskType.NETWORK_SSD,
>      >         size_bytes=268435456000,
>      >     ),
>      >     workspace=DevlabSpec__Workspace(
>      >         container_path="/workspace",
>      >     ),
>      > )
>      > nginx_service = DevlabServiceClient(sdk)
>      > nginx_operation = await nginx_service.create(
>      >     CreateDevlabRequest(
>      >         metadata=ResourceMetadata(
>      >             parent_id="<project_ID>",
>      >             name="nginx-devlab",
>      >         ),
>      >         spec=nginx_spec,
>      >     ),
>      > )
>      > await nginx_operation.wait()
>      > ```
>
>    In the request, specify the following parameters:
>
>    * **Devlab settings:**
>
>      * `metadata.parent_id`: [Project ID](https://docs.nebius.com/iam/manage-projects.md#python-sdk-3).
>
>      * `metadata.name`: Devlab name.
>
>      * `spec.template.id` or `spec.image`: How to define the container. Specify one of these parameters:
>
>        * `spec.template.id`: Template ID. Copy its `metadata.id` from the template list. Mutually exclusive with `spec.image`. The template declares the container image, entrypoint command, arguments, working directory, ports, primary web route, and the default workspace path. Don't set `spec.image`, `spec.container_command`, `spec.args`, `spec.working_dir`, or `spec.primary_route` with `spec.template`.
>        * `spec.image`: Container image reference in the `registry/path:tag` or `registry/path@digest` format. Mutually exclusive with `spec.template`. Required unless you set `spec.template`.
>
>      * `spec.template.input_field_values` (optional for some templates; required for JupyterLab): Template inputs as key-value pairs. Requires `spec.template`. To set several inputs, add an entry for each input.
>
>        For the JupyterLab template, set `spec.template.input_field_values["jupyter_token"]` to a random token of exactly 16 alphanumeric characters that you provide. Save the token securely to sign in later.
>
>      * `spec.registry_credentials.mysterybox_secret_version` (optional): [SecretStash](https://docs.nebius.com/secretstash/overview.md) secret version ID with the `REGISTRY_USERNAME` and `REGISTRY_PASSWORD` payload keys. Use when you pull an image from a private registry. Applies only with `spec.image`.
>
>      * `spec.container_command` (optional): Entrypoint command for the container. Applies only with `spec.image`. Declared by the template when you use `spec.template`.
>
>      * `spec.args` (optional): Arguments for the entrypoint command. Applies only with `spec.image`. Declared by the template when you use `spec.template`.
>
>      * `spec.working_dir` (optional): Working directory (absolute path). Applies only with `spec.image`. Declared by the template when you use `spec.template`.
>
>      * `spec.primary_route.container_port`: Container port for the primary web UI behind the managed HTTPS URL. Required with `spec.image`. Declared by the template when you use `spec.template`. Must match an HTTP port from `spec.ports`.
>
>      * `spec.environment_variables` (optional): Environment variables for the container. Set each variable's `name` and `value`. To set several variables, add an entry for each variable. With `spec.template`, these variables extend the template-declared ones.
>
>        The samples set `DEVLAB_ENV` to `<value>` and optionally load `DEVLAB_SECRET` from a [SecretStash](https://docs.nebius.com/secretstash/overview.md) secret. For the secret, set `secret_id` in `DevlabSpec__MysteryBoxSecretRef` to the secret ID.
>
>      * `spec.ports` (optional with `spec.template`; required with `spec.image`): Ports to expose from the container. Set each port's `container_port` and `protocol`. Supported protocols are HTTP, TCP, and UDP; the samples use `DevlabSpec__Port__Protocol.HTTP`. To expose several ports, add an entry for each port. With `spec.template`, these ports extend the template-declared ones. Additional ports appear in the Devlab status but aren't publicly routed unless they are the primary web route.
>
>      * `spec.workspace.container_path`: Absolute path of the workspace on the container disk. Data under this path persists across stop and restart. Required with `spec.image`, for example, `/workspace`. With `spec.template`, the template declares a default path, which you can override. The path must not overlap mounted volume paths. The workspace size is limited only by the container disk size (`spec.disk.size_bytes`).
>
>      * `spec.volumes` (optional): [Bucket](https://docs.nebius.com/object-storage/overview.md#buckets) or [shared filesystem](https://docs.nebius.com/compute/storage/types.md#shared-filesystems) to mount to the Devlab container. Set `source` to the bucket or filesystem ID, and `container_path` to the destination directory in the container. Volume mount paths must not overlap the workspace path. Set `mode` to `DevlabSpec__VolumeMount__Mode.READ_ONLY` for read-only access or `DevlabSpec__VolumeMount__Mode.READ_WRITE` for read-write access. To mount several volumes, add an entry for each volume.
>
>      * `spec.injected_files` (optional): Mount local files into the Devlab container at launch. Set each file's `container_path` to its absolute destination path and `content` to the file's bytes. Replace `<local_path>` in `Path(...).read_bytes()` with the source file's local path. To inject multiple files, add an entry for each file. Each mounted file is read-only and limited to 64 KiB.
>    * **Underlying VM characteristics:**
>
>      * `spec.platform`: VM platform. Choose a platform supported by the template or image. For CPU-only templates, such as Open WebUI, specify a CPU platform. See available platforms in [Types of virtual machines and GPUs in Nebius AI Cloud](https://docs.nebius.com/compute/virtual-machines/types.md).
>
>      * `spec.preset`: Number of GPUs, vCPUs, and RAM allocated to the container. Choose a preset that matches the selected platform. See available presets in [Presets for GPU platforms](https://docs.nebius.com/compute/virtual-machines/types.md#presets-for-gpu-platforms).
>
>      * `spec.disk.size_bytes`: Disk size of the underlying VM in bytes, for example, `96636764160` for 90 GiB.
>
>        Set at least 50 GiB for GPU workloads or 20 GiB for CPU-only workloads. If the container image requires a bigger disk size, set at least the minimum required value for the image. Otherwise, the workloads won't be able to launch.
>
>        For more information, see how [disk performance depends on disk size](https://docs.nebius.com/compute/storage/types.md#disk-performance).
>
>      * `spec.shm_size_bytes` (optional): Shared memory size of `/dev/shm` in bytes, for example, `67108864` for 64 MiB. With `spec.template`, you can set this only when the template leaves shared memory unset.
>
>      * `spec.ssh_authorized_keys` (optional): SSH public keys to access the underlying VM by SSH. To assign a public IP address, also set `spec.public_ip` to `True`. Before you add the keys, check the **Public IPv4 addresses** (Quota ID: `vpc.ipv4-address.public.count`) quota.
>
>      * `spec.public_ip` (optional): Set to `True` to assign a [public IP address](https://docs.nebius.com/compute/virtual-machines/network.md#public-ip-addresses) to the underlying VM. Not required to open the Devlab web UI over the managed HTTPS URL.
>
>    For optional secret parameters that you don't use, replace `<secret_ID>` or `<secret_version_ID>` with an empty string (`""`). The samples use a secret ID for `DEVLAB_SECRET` and a secret version ID for private-registry credentials.

> [tab] JavaScript SDK
>
> 1. If you want to create a Devlab from a template, list the templates and copy the required template's `metadata.id`:
>
>    ```ts theme={null}
>    const listTemplateService = new VmAppTemplateService(sdk);
>    const listTemplatesRequest = ListVmAppTemplatesRequest.create({
>      globalOnly: true,
>      kind: "devlab",
>    });
>    while (true) {
>      const templates = await listTemplateService.list(
>        listTemplatesRequest,
>      );
>      console.log(templates);
>      if (!templates.nextPageToken) {
>        break;
>      }
>      listTemplatesRequest.pageToken = templates.nextPageToken;
>    }
>    ```
>
> 2. Create the Devlab. Use either a template or a container image:
>
>    * From a template:
>
>      ```ts theme={null}
>      const templateSpec = DevlabSpec.create({
>        template: {
>          id: "<template_ID>",
>          inputFieldValues: {
>            jupyter_token: "<jupyter_token>",
>          },
>        },
>        environmentVariables: [
>          {
>            name: "DEVLAB_ENV",
>            valueSource: {
>              $case: "value",
>              value: "<value>",
>            },
>          },
>        ],
>        ports: [
>          {
>            containerPort: <port>,
>            protocol: DevlabSpec_Port_Protocol.HTTP,
>          },
>        ],
>        volumes: [
>          {
>            source: "<bucket_ID>",
>            containerPath: "<container_path>",
>            mode: DevlabSpec_VolumeMount_Mode.READ_WRITE,
>          },
>        ],
>        injectedFiles: [
>          {
>            containerPath: "<absolute_container_path>",
>            content: await readFile("<local_path>"),
>          },
>        ],
>        sshAuthorizedKeys: [
>          "<SSH_public_key>",
>        ],
>        publicIp: true,
>        platform: "<platform_ID>",
>        preset: "<preset>",
>        disk: {
>          type: DiskSpec_DiskType.NETWORK_SSD,
>          sizeBytes: <disk_size_in_bytes>,
>        },
>        workspace: {
>          containerPath: "<absolute_path>",
>        },
>      });
>      const templateSecretId = "<secret_ID>";
>      if (templateSecretId) {
>        templateSpec.environmentVariables.push(
>          DevlabSpec_EnvironmentVariable.create({
>            name: "DEVLAB_SECRET",
>            valueSource: {
>              $case: "mysteryboxSecret",
>              mysteryboxSecret: { secretId: templateSecretId },
>            },
>          }),
>        );
>      }
>      const templateService = new DevlabService(sdk);
>      const templateOperation = await templateService.create(
>        CreateDevlabRequest.create({
>          metadata: {
>            parentId: "<project_ID>",
>            name: "<devlab_name>",
>          },
>          spec: templateSpec,
>        }),
>      ).result;
>      await templateOperation.wait();
>      ```
>
>      > [accordion] Example: Create a Devlab from the JupyterLab template
>      >
>      > ```ts theme={null}
>      > const jupyterSpec = DevlabSpec.create({
>      >   template: {
>      >     id: "vmapptemplate-g00devlab-jupyter",
>      >     inputFieldValues: {
>      >       jupyter_token: "A1b2C3d4E5f6G7h8",
>      >     },
>      >   },
>      >   platform: "<platform_ID>",
>      >   preset: "<preset>",
>      >   disk: {
>      >     type: DiskSpec_DiskType.NETWORK_SSD,
>      >     sizeBytes: 268435456000,
>      >   },
>      >   workspace: {},
>      > });
>      > const jupyterService = new DevlabService(sdk);
>      > const jupyterOperation = await jupyterService.create(
>      >   CreateDevlabRequest.create({
>      >     metadata: {
>      >       parentId: "<project_ID>",
>      >       name: "my-jupyter",
>      >     },
>      >     spec: jupyterSpec,
>      >   }),
>      > ).result;
>      > await jupyterOperation.wait();
>      > ```
>      >
>      > Replace the sample Jupyter token with your own random token of exactly 16 alphanumeric characters. Save the token securely to sign in to JupyterLab.
>
>    * From a container image:
>
>      ```ts theme={null}
>      const imageSpec = DevlabSpec.create({
>        image: "<image>",
>        primaryRoute: {
>          containerPort: <port>,
>        },
>        ports: [
>          {
>            containerPort: <port>,
>            protocol: DevlabSpec_Port_Protocol.HTTP,
>          },
>        ],
>        containerCommand: "<command>",
>        args: "<arguments>",
>        workingDir: "<absolute_path>",
>        shmSizeBytes: <shared_memory_size_in_bytes>,
>        environmentVariables: [
>          {
>            name: "DEVLAB_ENV",
>            valueSource: {
>              $case: "value",
>              value: "<value>",
>            },
>          },
>        ],
>        volumes: [
>          {
>            source: "<bucket_ID>",
>            containerPath: "<container_path>",
>            mode: DevlabSpec_VolumeMount_Mode.READ_WRITE,
>          },
>        ],
>        injectedFiles: [
>          {
>            containerPath: "<absolute_container_path>",
>            content: await readFile("<local_path>"),
>          },
>        ],
>        sshAuthorizedKeys: [
>          "<SSH_public_key>",
>        ],
>        publicIp: true,
>        platform: "<platform_ID>",
>        preset: "<preset>",
>        disk: {
>          type: DiskSpec_DiskType.NETWORK_SSD,
>          sizeBytes: <disk_size_in_bytes>,
>        },
>        workspace: {
>          containerPath: "<absolute_path>",
>        },
>      });
>      const imageSecretId = "<secret_ID>";
>      if (imageSecretId) {
>        imageSpec.environmentVariables.push(
>          DevlabSpec_EnvironmentVariable.create({
>            name: "DEVLAB_SECRET",
>            valueSource: {
>              $case: "mysteryboxSecret",
>              mysteryboxSecret: { secretId: imageSecretId },
>            },
>          }),
>        );
>      }
>      const imageRegistryVersion = "<secret_version_ID>";
>      if (imageRegistryVersion) {
>        imageSpec.registryCredentials =
>          DevlabSpec_RegistryCredentials.create({
>            mysteryboxSecretVersion: imageRegistryVersion,
>          });
>      }
>      const imageService = new DevlabService(sdk);
>      const imageOperation = await imageService.create(
>        CreateDevlabRequest.create({
>          metadata: {
>            parentId: "<project_ID>",
>            name: "<devlab_name>",
>          },
>          spec: imageSpec,
>        }),
>      ).result;
>      await imageOperation.wait();
>      ```
>
>      > [accordion] Example: Create a Devlab from a container image
>      >
>      > ```ts theme={null}
>      > const nginxSpec = DevlabSpec.create({
>      >   image: "docker.io/library/nginx:1.27-alpine",
>      >   primaryRoute: {
>      >     containerPort: 80,
>      >   },
>      >   ports: [
>      >     {
>      >       containerPort: 80,
>      >       protocol: DevlabSpec_Port_Protocol.HTTP,
>      >     },
>      >   ],
>      >   platform: "cpu-e2",
>      >   preset: "2vcpu-8gb",
>      >   disk: {
>      >     type: DiskSpec_DiskType.NETWORK_SSD,
>      >     sizeBytes: 268435456000,
>      >   },
>      >   workspace: {
>      >     containerPath: "/workspace",
>      >   },
>      > });
>      > const nginxService = new DevlabService(sdk);
>      > const nginxOperation = await nginxService.create(
>      >   CreateDevlabRequest.create({
>      >     metadata: {
>      >       parentId: "<project_ID>",
>      >       name: "nginx-devlab",
>      >     },
>      >     spec: nginxSpec,
>      >   }),
>      > ).result;
>      > await nginxOperation.wait();
>      > ```
>
>    In the request, specify the following parameters:
>
>    * **Devlab settings:**
>
>      * `metadata.parentId`: [Project ID](https://docs.nebius.com/iam/manage-projects.md#javascript-sdk-3).
>
>      * `metadata.name`: Devlab name.
>
>      * `spec.template.id` or `spec.image`: How to define the container. Specify one of these parameters:
>
>        * `spec.template.id`: Template ID. Copy its `metadata.id` from the template list. Mutually exclusive with `spec.image`. The template declares the container image, entrypoint command, arguments, working directory, ports, primary web route, and the default workspace path. Don't set `spec.image`, `spec.containerCommand`, `spec.args`, `spec.workingDir`, or `spec.primaryRoute` with `spec.template`.
>        * `spec.image`: Container image reference in the `registry/path:tag` or `registry/path@digest` format. Mutually exclusive with `spec.template`. Required unless you set `spec.template`.
>
>      * `spec.template.inputFieldValues` (optional for some templates; required for JupyterLab): Template inputs as key-value pairs. Requires `spec.template`. To set several inputs, add an entry for each input.
>
>        For the JupyterLab template, set `spec.template.inputFieldValues.jupyter_token` to a random token of exactly 16 alphanumeric characters that you provide. Save the token securely to sign in later.
>
>      * `spec.registryCredentials.mysteryboxSecretVersion` (optional): [SecretStash](https://docs.nebius.com/secretstash/overview.md) secret version ID with the `REGISTRY_USERNAME` and `REGISTRY_PASSWORD` payload keys. Use when you pull an image from a private registry. Applies only with `spec.image`.
>
>      * `spec.containerCommand` (optional): Entrypoint command for the container. Applies only with `spec.image`. Declared by the template when you use `spec.template`.
>
>      * `spec.args` (optional): Arguments for the entrypoint command. Applies only with `spec.image`. Declared by the template when you use `spec.template`.
>
>      * `spec.workingDir` (optional): Working directory (absolute path). Applies only with `spec.image`. Declared by the template when you use `spec.template`.
>
>      * `spec.primaryRoute.containerPort`: Container port for the primary web UI behind the managed HTTPS URL. Required with `spec.image`. Declared by the template when you use `spec.template`. Must match an HTTP port from `spec.ports`.
>
>      * `spec.environmentVariables` (optional): Environment variables for the container. Set each variable's `name` and `valueSource`. To set several variables, add an entry for each variable. With `spec.template`, these variables extend the template-declared ones.
>
>        The samples set `DEVLAB_ENV` to `<value>` and optionally load `DEVLAB_SECRET` from a [SecretStash](https://docs.nebius.com/secretstash/overview.md) secret. For the secret, set `valueSource.mysteryboxSecret.secretId` to the secret ID and `valueSource.$case` to `"mysteryboxSecret"`.
>
>      * `spec.ports` (optional with `spec.template`; required with `spec.image`): Ports to expose from the container. Set each port's `containerPort` and `protocol`. Supported protocols are HTTP, TCP, and UDP; the samples use `DevlabSpec_Port_Protocol.HTTP`. To expose several ports, add an entry for each port. With `spec.template`, these ports extend the template-declared ones. Additional ports appear in the Devlab status but aren't publicly routed unless they are the primary web route.
>
>      * `spec.workspace.containerPath`: Absolute path of the workspace on the container disk. Data under this path persists across stop and restart. Required with `spec.image`, for example, `/workspace`. With `spec.template`, the template declares a default path, which you can override. The path must not overlap mounted volume paths. The workspace size is limited only by the container disk size (`spec.disk.sizeBytes`).
>
>      * `spec.volumes` (optional): [Bucket](https://docs.nebius.com/object-storage/overview.md#buckets) or [shared filesystem](https://docs.nebius.com/compute/storage/types.md#shared-filesystems) to mount to the Devlab container. Set `source` to the bucket or filesystem ID, and `containerPath` to the destination directory in the container. Volume mount paths must not overlap the workspace path. Set `mode` to `DevlabSpec_VolumeMount_Mode.READ_ONLY` for read-only access or `DevlabSpec_VolumeMount_Mode.READ_WRITE` for read-write access. To mount several volumes, add an entry for each volume.
>
>      * `spec.injectedFiles` (optional): Mount local files into the Devlab container at launch. Set each file's `containerPath` to its absolute destination path and `content` to the file's bytes. Replace `<local_path>` in `readFile` from `node:fs/promises` with the source file's local path. To inject multiple files, add an entry for each file. Each mounted file is read-only and limited to 64 KiB.
>    * **Underlying VM characteristics:**
>
>      * `spec.platform`: VM platform. Choose a platform supported by the template or image. For CPU-only templates, such as Open WebUI, specify a CPU platform. See available platforms in [Types of virtual machines and GPUs in Nebius AI Cloud](https://docs.nebius.com/compute/virtual-machines/types.md).
>
>      * `spec.preset`: Number of GPUs, vCPUs, and RAM allocated to the container. Choose a preset that matches the selected platform. See available presets in [Presets for GPU platforms](https://docs.nebius.com/compute/virtual-machines/types.md#presets-for-gpu-platforms).
>
>      * `spec.disk.sizeBytes`: Disk size of the underlying VM in bytes, for example, `96636764160` for 90 GiB.
>
>        Set at least 50 GiB for GPU workloads or 20 GiB for CPU-only workloads. If the container image requires a bigger disk size, set at least the minimum required value for the image. Otherwise, the workloads won't be able to launch.
>
>        For more information, see how [disk performance depends on disk size](https://docs.nebius.com/compute/storage/types.md#disk-performance).
>
>      * `spec.shmSizeBytes` (optional): Shared memory size of `/dev/shm` in bytes, for example, `67108864` for 64 MiB. With `spec.template`, you can set this only when the template leaves shared memory unset.
>
>      * `spec.sshAuthorizedKeys` (optional): SSH public keys to access the underlying VM by SSH. To assign a public IP address, also set `spec.publicIp` to `true`. Before you add the keys, check the **Public IPv4 addresses** (Quota ID: `vpc.ipv4-address.public.count`) quota.
>
>      * `spec.publicIp` (optional): Set to `true` to assign a [public IP address](https://docs.nebius.com/compute/virtual-machines/network.md#public-ip-addresses) to the underlying VM. Not required to open the Devlab web UI over the managed HTTPS URL.
>
>    For optional secret parameters that you don't use, replace `<secret_ID>` or `<secret_version_ID>` with an empty string (`""`). The samples use a secret ID for `DEVLAB_SECRET` and a secret version ID for private-registry credentials.

Devlab creation usually takes a few minutes. When the Devlab is running, you can open its web UI and view logs.

***

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