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

# Export GTR

> Attach a trained GTR checkpoint to the model it came from as a PyTorch export. GTR has no ONNX or TensorRT export yet.

Runs on: gpu, cpu  Dockerfile

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

## Overview

Attaches a trained GTR checkpoint to the model version it came from as a PyTorch export, together with its class list. The model page lists the export for download, and a checkpoint already exported is reused instead of uploaded again.

GTR has no ONNX or TensorRT export yet. Its backbone's gated linear attention leaves an ONNX graph as a custom operator that only GTR's own TensorRT plugin runs, and an engine built with that plugin did not reproduce the PyTorch model, so this node does not offer it.

```mermaid
flowchart LR
  n1["Train GTR"] --> n2["Export GTR"] --> n3["Exported model files"]
```

## Prerequisites

| Requirement        | What you need                                                                                                                                                                                                               |
| ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **GTR checkpoint** | A GTR model version with weights of its own, e.g. one from [Train GTR](/node-library/nodes/models-gtr-train-gtr). A model copied from the catalog has no file to export, because its public weights are downloaded by name. |

## How it works

Checks the exports already on the model version and stops early when this checkpoint is already attached as a PyTorch export.

Downloads the checkpoint and takes the class names from the version, or from the checkpoint when the version records none.

Attaches the checkpoint and a `classes.txt` to the source model version.

## FAQ

#### Does the export replace the trained model?

No. The export is another file on the version it came from, and the weights stay untouched.

#### Why is there no ONNX or TensorRT export?

GTR's attention runs as a custom operator in ONNX, which ONNX Runtime cannot execute and which TensorRT runs only through GTR's own FP16 plugin. An engine built that way returned invalid values for a trained GTR-S checkpoint, so the node exports PyTorch only.

#### What does the export folder contain besides the model file?

A `classes.txt` listing one class per line, so line N names the class the model reports as index N. It is copied from the version, which is the index space the model was trained on, and the checkpoint answers only when the version records none.

## Inputs

**`Model`** `model` — required

Model whose weights are exported, e.g. a version trained in this workspace. A model copied from the catalog hosts no weights of its own and has nothing to export, so train from it first. Key: `MODEL`.

---

## Outputs

**`Exported formats`** `string`

Format keys this run produced, comma separated. Read by the download widget. Hidden from the flow editor. Key: `EXPORT_FORMATS`.

---

**`Model`** `model`

The model that was exported, as `&lt;model id&gt;@&lt;version id&gt;` - the same reference this node was given. An export is another file on that version, not a version of its own, so this output wires on to anything the input accepts. Shown as an artifact. Key: `MODEL`.

---

## Widgets

The model download widget downloads the exported checkpoint. The model version page lists the same files one by one.

## Runtime

The export runs in the GTR Docker image. It only downloads and uploads files, so it needs no GPU.

## JSON config

Machine-readable node interface for automation and advanced usage.

#### Show JSON

```json
{
  "name": "Export GTR",
  "description": "Attach a trained GTR checkpoint to the model it came from as a PyTorch export. GTR has no ONNX or TensorRT export yet.",
  "category": "Models",
  "namespace": "ovalbee",
  "templateKey": "models/gtr/export_gtr",
  "version": "v1",
  "inputs": [
    {
      "key": "MODEL",
      "label": "Model",
      "type": "model",
      "description": "Model whose weights are exported, e.g. a version trained in this workspace. A model copied from the catalog hosts no weights of its own and has nothing to export, so train from it first.\n",
      "required": true,
      "default": null,
      "visibleWhen": null,
      "options": {
        "framework": "gtr",
        "task_type": "object_detection"
      }
    }
  ],
  "outputs": [
    {
      "key": "EXPORT_FORMATS",
      "label": "Exported formats",
      "type": "string",
      "description": "Format keys this run produced, comma separated. Read by the download widget.",
      "artifact": false,
      "badge": false,
      "badgeOpens": null,
      "hidden": true
    },
    {
      "key": "MODEL",
      "label": "Model",
      "type": "model",
      "description": "The model that was exported, as `<model id>@<version id>` - the same reference this node was given. An export is another file on that version, not a version of its own, so this output wires on to anything the input accepts.\n",
      "artifact": true,
      "badge": false,
      "badgeOpens": null,
      "hidden": false
    }
  ],
  "runtime": {
    "type": "docker",
    "devices": [
      "gpu",
      "cpu"
    ],
    "dockerImage": "ovalbee/node-gtr:0.0.14"
  },
  "widgets": {
    "widget": {
      "id": "model-download",
      "settings": {
        "assetId": {
          "type": "variable",
          "value": "self.outputs.MODEL"
        },
        "format": {
          "type": "variable",
          "value": "self.outputs.EXPORT_FORMATS"
        }
      }
    }
  }
}
```