> For the complete documentation index, see [llms.txt](https://docs.roboflow.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.roboflow.com/deploy/supported-models/yolo-world.md).

# YOLO-World

YOLO-World is an open-vocabulary object detection model that detects objects from arbitrary text class names without training. We support YOLO-World inferencing via our [Serverless Hosted API](/deploy/serverless-hosted-api-v2.md).

For more details on running YOLO-World, see the [Inference docs](https://inference.roboflow.com/).

## Code sample

Run YOLO-World through the HTTP endpoint directly with `curl`, or with the [`inference-sdk`](https://inference.roboflow.com/inference_helpers/inference_sdk/) wrapper.

{% tabs %}
{% tab title="HTTP (curl)" icon="webhook" %}
{% stepper %}
{% step %}

### Get your API Key

Create a Roboflow account, find your key on the [Roboflow API settings page](https://app.roboflow.com/settings/api) and make it available to your shell:

```bash
export ROBOFLOW_API_KEY="your-key-here"
```

{% endstep %}

{% step %}

### Run the model

Call the `/yolo_world/infer` endpoint with `curl`:

```bash
curl --location 'https://serverless.roboflow.com/yolo_world/infer' \
  --header 'Content-Type: application/json' \
  --data '{
    "api_key": "'"$ROBOFLOW_API_KEY"'",
    "image": {"type": "url", "value": "https://media.roboflow.com/quickstart/traffic.jpg"},
    "text": ["car", "truck"],
    "yolo_world_version_id": "v2-s",
    "confidence": 0.05
  }'
```

{% endstep %}
{% endstepper %}
{% endtab %}

{% tab title="SDK (Python)" icon="python" %}
{% stepper %}
{% step %}

### Get your API Key

Create a Roboflow account, find your key on the [Roboflow API settings page](https://app.roboflow.com/settings/api) and make it available to your shell:

```bash
export ROBOFLOW_API_KEY="your-key-here"
```

{% endstep %}

{% step %}

### Install the dependencies

Install the SDK and [supervision](https://supervision.roboflow.com/):

```bash
pip install inference-sdk supervision
```

{% endstep %}

{% step %}

### Run the model

Run YOLO-World with custom class names, then decode and visualize the predictions with supervision.

```python
import os
import cv2
import numpy as np
import requests
import supervision as sv
from inference_sdk import InferenceHTTPClient

content = requests.get("https://media.roboflow.com/quickstart/traffic.jpg").content
image = cv2.imdecode(np.frombuffer(content, np.uint8), cv2.IMREAD_COLOR)

client = InferenceHTTPClient(
    api_url="https://serverless.roboflow.com",
    api_key=os.environ["ROBOFLOW_API_KEY"],
)

results = client.infer_from_yolo_world(
    inference_input=image,
    class_names=["car", "truck"],
    model_version="v2-s",
    confidence=0.05,
)

detections = sv.Detections.from_inference(results[0])

labels = [
    f"{name} {conf:.2f}"
    for name, conf in zip(detections.data["class_name"], detections.confidence)
]
annotated = sv.BoxAnnotator().annotate(image.copy(), detections)
annotated = sv.LabelAnnotator().annotate(annotated, detections, labels=labels)
cv2.imwrite("annotated.png", annotated)
```

<figure><img src="/files/VzSiFyFTGQC6sGlYMR4I" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}
{% endtab %}
{% endtabs %}

The `class_names` argument accepts any list of class names. Available `model_version` values: `v2-s`, `v2-m`, `v2-l`, `v2-x`, `s`, `m`, `l`, `x`.

## Inference speed

Latency measured with [Roboflow Inference](https://inference.roboflow.com/) on 1x NVIDIA L4, batch size 1, mean after warmup.

<table data-search="false"><thead><tr><th>Model</th><th>Latency (ms)</th></tr></thead><tbody><tr><td><code>yolo-world</code></td><td>12.4</td></tr></tbody></table>

Measured on the `v2-s` variant with two classes. Setting the class list runs a text encoder once, and is excluded from this figure since it is not repeated per frame.

{% hint style="info" %}
Set `api_url` to match your deployment target:

* `https://serverless.roboflow.com` for the Serverless Hosted API.
* `http://localhost:9001` for a local [Inference](https://inference.roboflow.com/) server.
* Your [Dedicated Deployment](/deploy/dedicated-deployments.md) URL for a private endpoint.
  {% endhint %}
