> 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/yololite.md).

# YOLOLite

YOLOlite is a lightweight object detection model family from Roboflow, designed for low-latency deployments and edge hardware. You can train YOLOlite on a [Project](/workspaces/key-concepts.md) in Roboflow and deploy it via our [Serverless Hosted API](/deploy/serverless-hosted-api-v2.md).

For self-hosted deployment, see [Roboflow Inference](https://inference.roboflow.com/).

YOLOlite input size is configured during training on Roboflow.

## Available variants

YOLOlite ships in two scaling families: a standard set and an edge-optimized set. Each is available in five sizes.

<table data-search="false"><thead><tr><th>Family</th><th>Variants</th></tr></thead><tbody><tr><td>Standard</td><td><code>yololite-n</code>, <code>yololite-s</code>, <code>yololite-m</code>, <code>yololite-l</code>, <code>yololite-xl</code></td></tr><tr><td>Edge</td><td><code>yololite-edge-n</code>, <code>yololite-edge-s</code>, <code>yololite-edge-m</code>, <code>yololite-edge-l</code>, <code>yololite-edge-xl</code></td></tr></tbody></table>

You select a variant when you start a training on a Project. The trained model is then served from the Serverless Hosted API, where you call it by its per-model `{workspace}/{model-slug}` ID (see [Versions, Trainings, and Models](/train/versions-trainings-and-models.md)).

## Code sample

{% 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 [Inference SDK](https://inference.roboflow.com/inference_helpers/inference_sdk/) and [supervision](https://supervision.roboflow.com/):

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

{% endstep %}

{% step %}

### Run the model

This example runs a public YOLOlite model trained on a [screws dataset](https://universe.roboflow.com/erik-pe6au/rf-bolts) (screw, flat-washer, hex-nut). Swap in your own `{workspace}/{model-slug}` to run your trained weights.

```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/docs/bolts.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(image, model_id="erik-pe6au/rf-bolts-4-yololite-s-t1")

detections = sv.Detections.from_inference(results)

annotated = sv.BoxAnnotator().annotate(image.copy(), detections)

cv2.imwrite("annotated.png", annotated)
```

<figure><img src="/files/7Ey0zZ7Od7FV6VAR5gO4" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

{% 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 %}
