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

# Serve YOLO

> Loads a YOLO checkpoint once and keeps answering prediction requests until the deployment is stopped. Holds its machine for its whole lifetime. Runs on a GPU when the machine has one, and on the CPU otherwise.

Runs on: gpu, cpu  Dockerfile

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

## Overview

Answers object detection requests over HTTP from a YOLO model that stays loaded in memory. Start it from the **Deployments** page or place it on the canvas as a [deploy node](/concepts/deployments#deploy-nodes-in-a-flow). It keeps running until you stop it, and every call reuses the weights read at startup instead of loading them again.

Calls go to `POST /predict` and name images that already live in your workspace. Each image comes back with a detection annotation, so the endpoint is the way to get YOLO predictions from your own code, a script, or another service.

**Model** decides what the deployment serves. To try the endpoint before you have trained anything, copy a pretrained detector from the catalog into the workspace and pick it.

## Prerequisites

| Requirement                 | What you need                                                                                                                                             |
| --------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Machine**                 | A machine class with a GPU for real traffic. A class without one works too, far slower.                                                                   |
| **Trained model**           | A YOLO detection model, for example one produced by [Train YOLO](/node-library/nodes/models-yolo-train-yolo) or a pretrained one copied from the catalog. |
| **Images in the workspace** | The images you want detections for, already uploaded. Calls name assets by id, so images are never sent in the request body.                              |
| **API token**               | A personal token created under **Settings → Developer**. Every call carries it.                                                                           |

## How it works

Reads the selected model once at startup and keeps its weights in memory, on the GPU when the machine has one and on the CPU otherwise.

Reports itself as not ready until the weights are in memory, then starts accepting calls.

Downloads the images named in a request and runs detection over them in one batch.

Answers with one result per requested image, carrying its detection annotation and the number of objects found.

## FAQ

#### How do I call the endpoint?

Open the deployment on the **Deployments** page. It shows the base URL of that deployment and a ready-made command for each route it serves. Calls go through OvalBee, which checks your API token and forwards them to the container, so you never address the container directly.

#### What goes into a request?

A list of image asset ids, and an optional block of settings. The settings replace the matching values in **Config** for that one call, so you can tighten or loosen the confidence threshold per request without restarting the deployment. One call takes at most 128 ids, so split larger sets across several calls. An empty list is accepted and comes back with no results.

#### What comes back?

One result per requested image, in the order you sent them. Each carries the asset id, a detection annotation with one box and one class per detected object, and how many objects were found. The class names come from the model, falling back to the names stored with the weights when the model records none. A setting outside **Config**'s keys is refused with a 400.

#### Are the predictions saved anywhere?

No. The annotations exist only in the response, and nothing is written to the images or to a dataset. Store what you need on your side, or use [Predict YOLO](/node-library/nodes/models-yolo-predict-yolo) when you want the predictions written into a new dataset instead.

#### Which checkpoint does it load?

The weights recorded on the selected model: a model in OvalBee's layout is built from the Ultralytics model definition of its architecture, an ONNX file runs on ONNX Runtime, and an Ultralytics `.pt` loads only while the safe-weights policy is off. A catalog model whose weights OvalBee does not host is downloaded from the checkpoint its catalog entry names, checked against its SHA-256. Weights are read only at startup, so switching to another model means stopping this deployment and starting one with the new model selected.

#### Why are my calls answered as unavailable?

Either the deployment is not running yet, or it is still loading the model. The first start is the slow one, because the worker pulls the image and, for a catalog model, downloads the weights before the model is ready.

#### Why is a request rejected?

Usually one of the asset ids does not resolve to an image in the workspace: it names nothing, or it names another kind of asset, such as an annotation file of the dataset. The error names those ids, with the kind of each that is not an image, and the whole call is refused before any image is downloaded rather than partly answered. An image asset whose file cannot be decoded as an image is refused the same way, by id and file name, before the model sees the batch.

#### What does this node not support?

Images only, and object detection only: no video, no segmentation masks, and no uploading an image with the request. Calls are served one at a time on the single GPU behind the model, so overlapping requests wait their turn. Settings that would redirect where the model reads from or writes to are ignored.

## Inputs

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

Model the deployment loads and keeps in memory, trained in this workspace or installed from the zoo. Key: `MODEL`.

---

**`Config`** `yaml` — required

YAML defaults passed to YOLO predict - image size, confidence and IoU thresholds, maximum detections, batch size, half precision, test-time augmentation, class-agnostic NMS, class indices and verbose logging. Any other key is refused. A request may override any of these per call. Key: `CONFIG`.

---

## Runtime

The deployment runs in its own container on the machine class picked in the deploy dialog, on an image that ships Ultralytics YOLO. It holds that machine from the moment it starts until you stop it, idle or not, so stop a deployment you are done with.

## JSON config

Machine-readable node interface for automation and advanced usage.

#### Show JSON

```json
{
  "name": "Serve YOLO",
  "description": "Loads a YOLO checkpoint once and keeps answering prediction requests until the deployment is stopped. Holds its machine for its whole lifetime. Runs on a GPU when the machine has one, and on the CPU otherwise.\n",
  "category": "Models",
  "namespace": "ovalbee",
  "templateKey": "models/yolo/serve_yolo",
  "version": "v1",
  "inputs": [
    {
      "key": "MODEL",
      "label": "Model",
      "type": "model",
      "description": "Model the deployment loads and keeps in memory, trained in this workspace or installed from the zoo.\n",
      "required": true,
      "default": null,
      "visibleWhen": null,
      "options": {
        "framework": "yolo",
        "task_type": "object_detection"
      }
    },
    {
      "key": "CONFIG",
      "label": "Config",
      "type": "yaml",
      "description": "YAML defaults passed to YOLO predict - image size, confidence and IoU thresholds, maximum detections, batch size, half precision, test-time augmentation, class-agnostic NMS, class indices and verbose logging. Any other key is refused. A request may override any of these per call.\n",
      "required": true,
      "default": "imgsz: 640\nconf: 0.25\niou: 0.7\nmax_det: 300\nverbose: false\n",
      "visibleWhen": null
    }
  ],
  "outputs": [],
  "runtime": {
    "type": "docker",
    "devices": [
      "gpu",
      "cpu"
    ],
    "dockerImage": "ovalbee/node-yolo:0.0.39"
  }
}
```

## References

#### Sources and related pages

* [Predict YOLO](/node-library/nodes/models-yolo-predict-yolo)
* [Ultralytics repository at v8.4.33](https://github.com/ultralytics/ultralytics/tree/v8.4.33)
* [Prediction mode documentation at v8.4.33](https://github.com/ultralytics/ultralytics/blob/v8.4.33/docs/en/modes/predict.md)
* [Configuration documentation at v8.4.33](https://github.com/ultralytics/ultralytics/blob/v8.4.33/docs/en/usage/cfg.md)