> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.ovalbee.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.ovalbee.com/_mcp/server.

# Import model

> Download a model checkpoint from Supervisely Team Files and register it as an OvalBee model. The checkpoint is stored as it is and never opened; framework, task type and class names come from experiment_info.json and model_meta.json.

Dockerfile

> **Note**
>
> First run can take longer while the worker pulls the configured Docker image.

## Overview

Registers a model trained in Supervisely as an OvalBee model asset.

The node pulls the checkpoint from [Supervisely Team Files](https://docs.supervisely.com/data-organization/team-files) and reads the experiment files next to it, so the framework, task type, and class names come across without you retyping them.

```mermaid
flowchart LR
  n1["Import model"] --> n2["Predict DEIM"] --> n3["Evaluate object detection"]
```

## Prerequisites

| Requirement                    | What you need                                                                                                                                 |
| ------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------- |
| **Supervisely credentials**    | An existing `supervisely` secret with read access to the team files.                                                                          |
| **Supervisely experiment**     | A finished training experiment whose checkpoint sits in a `checkpoints` folder inside the experiment folder.                                  |
| **Class names in Supervisely** | The class names the model predicts, recorded in `model_meta.json` or in `experiment_info.json`. The checkpoint itself is never read for them. |

## How it works

Reads `experiment_info.json` from the experiment folder, two levels above the checkpoint path, and stops there when it names no model, framework or task type — nothing is downloaded.

Collects the class names from `model_meta.json`, and fails when it names none — the checkpoint is never opened to make up for a missing list.

Downloads the checkpoint, and the `config.json` beside it when the checkpoint is a `.safetensors` file, together with the experiment info and the training config when one is present.

Stores the files unchanged as a model asset, then registers it under the framework, task type, model name and classes it found so the pickers can find it.

## FAQ

#### Which path goes into Checkpoint Path?

The full Team Files path of the checkpoint, for example `/experiments/12_animals/checkpoints/best.pth`. The experiment folder is taken two levels above that path, so a checkpoint stored anywhere else means the experiment files are not found.

#### Where do the class names come from?

Two sources, in order: `model_meta.json` in the experiment folder, then the path `experiment_info.json` points at. The run fails when neither yields class names: a model without classes cannot be applied, and reading them out of the checkpoint would mean loading a file that runs code.

#### What happens when experiment_info.json is missing?

The run fails: the framework, task type and model name are what the model is registered under, and none of them can be guessed from a checkpoint file. Export the experiment from Supervisely with its info file.

#### Which framework and task type does the model end up with?

OvalBee's own keys, not Supervisely's wording: `YOLOv8` is registered as `yolo` and `object detection` as `object_detection`, because the model pickers of the predict, train and export nodes match those keys exactly. A task Supervisely trains but OvalBee has no node for, such as pose estimation, fails the run instead of being imported unusable.

#### Which files end up in the model asset?

The checkpoint, marked as the one to load, plus `experiment_info.json` when it exists and the training config when one of `training_config.yaml`, `model_config.yml`, or `custom_config.yml` is found next to it. A `.safetensors` checkpoint with a `config.json` beside it is stored as a model version, `config.json` and `model.safetensors`.

#### Can I import several checkpoints from one experiment?

Run the node once per checkpoint. Each run imports the single file named in **Checkpoint Path** and registers it as its own model asset.

#### How do I tell imported models apart later?

An imported model is marked `imported` in the registry, and the version records the Supervisely path it came from next to the framework, task type and model name that were detected.

#### Is the checkpoint opened during the import?

No. Loading a `.pth` file runs the code inside it, so the import stores what it downloaded and takes everything it records from the experiment's own files. The node that later loads the version is where the file is judged: with the safe-weights policy on it accepts only safetensors and ONNX, and a pickle is converted first.

## Inputs

**`Supervisely credentials`** `secret` — required

Your Supervisely server address and API token, stored as a secret. Allowed credential types: `supervisely`. Key: `SLY_SECRET`.

---

**`Supervisely team ID`** `integer` — required

Supervisely team whose Team Files hold the checkpoint, as a numeric ID. Key: `SLY_TEAM_ID`.

---

**`Checkpoint path`** `string` — required

Path to the checkpoint file in Supervisely Team Files (e.g. /experiments/.../checkpoints/best.pth). The experiment directory is inferred automatically. A .safetensors checkpoint with a config.json beside it is imported with that config. Key: `CKPT_PATH`.

---

## Outputs

**`Model`** `model`

Reference to the registry version created for the imported checkpoint, as `&lt;model id&gt;@&lt;version id&gt;`. It wires into the Model input of a predict, serve or evaluate node and pins it to exactly these weights, and the nodes that take a checkpoint asset - Export, Apply model - accept it too. Shown as an artifact. Key: `MODEL`.

---

## JSON config

Machine-readable node interface for automation and advanced usage.

#### Show JSON

```json
{
  "name": "Import model",
  "description": "Download a model checkpoint from Supervisely Team Files and register it as an OvalBee model. The checkpoint is stored as it is and never opened; framework, task type and class names come from experiment_info.json and model_meta.json.",
  "category": "Supervisely",
  "namespace": "supervisely",
  "templateKey": "supervisely/import_model",
  "version": "v1",
  "inputs": [
    {
      "key": "SLY_SECRET",
      "label": "Supervisely credentials",
      "type": "secret",
      "description": "Your Supervisely server address and API token, stored as a secret.",
      "required": true,
      "default": null,
      "visibleWhen": null,
      "options": {
        "types": [
          "supervisely"
        ]
      }
    },
    {
      "key": "SLY_TEAM_ID",
      "label": "Supervisely team ID",
      "type": "number",
      "description": "Supervisely team whose Team Files hold the checkpoint, as a numeric ID.",
      "required": true,
      "default": null,
      "visibleWhen": null,
      "options": {
        "type": "integer"
      }
    },
    {
      "key": "CKPT_PATH",
      "label": "Checkpoint path",
      "type": "string",
      "description": "Path to the checkpoint file in Supervisely Team Files (e.g. /experiments/.../checkpoints/best.pth). The experiment directory is inferred automatically. A .safetensors checkpoint with a config.json beside it is imported with that config.",
      "required": true,
      "default": null,
      "visibleWhen": null
    }
  ],
  "outputs": [
    {
      "key": "MODEL",
      "label": "Model",
      "type": "model",
      "description": "Reference to the registry version created for the imported checkpoint, as `<model id>@<version id>`. It wires into the Model input of a predict, serve or evaluate node and pins it to exactly these weights, and the nodes that take a checkpoint asset - Export, Apply model - accept it too.\n",
      "artifact": true,
      "badge": false,
      "badgeOpens": null,
      "hidden": false
    }
  ],
  "runtime": {
    "type": "docker",
    "devices": [
      "cpu"
    ],
    "dockerImage": "ovalbee/node-deim:0.0.40"
  }
}
```