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

| Family   | Variants                                                                                       |
| -------- | ---------------------------------------------------------------------------------------------- |
| Standard | `yololite-n`, `yololite-s`, `yololite-m`, `yololite-l`, `yololite-xl`                          |
| Edge     | `yololite-edge-n`, `yololite-edge-s`, `yololite-edge-m`, `yololite-edge-l`, `yololite-edge-xl` |

You select a variant when training a YOLOlite model on a Project. The trained model is then served from the Serverless Hosted API under your `workspace/project/version` path.

## Code sample

Install the [Inference SDK](https://inference.roboflow.com/inference_helpers/inference_sdk/) and [supervision](https://supervision.roboflow.com/):

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

The following sample runs detection against a YOLOlite model trained on a Roboflow Project, decodes the response with `supervision`, draws boxes and labels, and saves the annotated PNG. Replace `your-project/1` with your own `project/version`. Pass your [Roboflow API Key](https://app.roboflow.com/settings/api) via the `API_KEY` environment variable.

```python
import os
import urllib.request

import cv2
import supervision as sv
from inference_sdk import InferenceHTTPClient

image_url = "https://storage.googleapis.com/com-roboflow-marketing/notebooks/examples/cars-highway.png"
image_path = "cars-highway.png"
urllib.request.urlretrieve(image_url, image_path)

image = cv2.imread(image_path)

client = InferenceHTTPClient(
    api_url="https://serverless.roboflow.com",
    api_key=os.getenv("API_KEY"),
)
results = client.infer(image, model_id="your-project/1")

detections = sv.Detections.from_inference(results)

box_annotator = sv.BoxAnnotator()
label_annotator = sv.LabelAnnotator()

annotated = box_annotator.annotate(scene=image.copy(), detections=detections)
annotated = label_annotator.annotate(scene=annotated, detections=detections)

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

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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.roboflow.com/deploy/supported-models/yololite.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
