For the complete documentation index, see llms.txt. This page is also available as Markdown.

YOLOv8

Use the YOLOv8 model family through our Serverless Cloud API

YOLOv8 is an object detection, instance segmentation, and keypoint detection model family from Ultralytics. Roboflow serves COCO-pretrained YOLOv8 checkpoints under short aliases, and you can upload your own weights to run a model you trained elsewhere.

Training YOLOv8 is not supported on Roboflow. For a Roboflow-trained detector, see RF-DETR, YOLO26, or YOLO11.

Pretrained aliases

Pass one of these IDs as model_id to run a COCO-pretrained checkpoint without training anything. The full list lives on the Pretrained Model Aliases page.

Model
Input size
Task
Model ID
Test

YOLOv8n

640

Object Detection

yolov8n-640

YOLOv8n

1280

Object Detection

yolov8n-1280

YOLOv8s

640

Object Detection

yolov8s-640

YOLOv8s

1280

Object Detection

yolov8s-1280

YOLOv8m

640

Object Detection

yolov8m-640

YOLOv8m

1280

Object Detection

yolov8m-1280

YOLOv8l

640

Object Detection

yolov8l-640

YOLOv8l

1280

Object Detection

yolov8l-1280

YOLOv8x

640

Object Detection

yolov8x-640

YOLOv8x

1280

Object Detection

yolov8x-1280

YOLOv8n Instance Segmentation

640

Instance Segmentation

yolov8n-seg-640

YOLOv8n Instance Segmentation

1280

Instance Segmentation

yolov8n-seg-1280

YOLOv8s Instance Segmentation

640

Instance Segmentation

yolov8s-seg-640

YOLOv8m Instance Segmentation

1280

Instance Segmentation

yolov8s-seg-1280

YOLOv8m Instance Segmentation

640

Instance Segmentation

yolov8m-seg-640

YOLOv8m Instance Segmentation

1280

Instance Segmentation

yolov8m-seg-1280

YOLOv8l Instance Segmentation

640

Instance Segmentation

yolov8l-seg-640

YOLOv8l Instance Segmentation

1280

Instance Segmentation

yolov8l-seg-1280

YOLOv8x Instance Segmentation

640

Instance Segmentation

yolov8x-seg-640

YOLOv8x Instance Segmentation

1280

Instance Segmentation

yolov8x-seg-1280

YOLOv8x Keypoint Detection

1280

Keypoint Detection

yolov8x-pose-1280

YOLOv8x Keypoint Detection

640

Keypoint Detection

yolov8x-pose-640

YOLOv8l Keypoint Detection

640

Keypoint Detection

yolov8l-pose-640

YOLOv8m Keypoint Detection

640

Keypoint Detection

yolov8m-pose-640

YOLOv8s Keypoint Detection

640

Keypoint Detection

yolov8s-pose-640

YOLOv8n Keypoint Detection

640

Keypoint Detection

yolov8n-pose-640

Code sample

1

Get your API Key

Create a Roboflow account, find your key on the Roboflow API settings page and make it available to your shell:

2

Install the dependencies

Install the Inference SDK and supervision for decoding and drawing predictions:

3

Run the model

This example runs the pretrained yolov8n-640 checkpoint. To serve your own weights, swap in your {workspace}/{model-slug} ID (see Versions, Trainings, and Models).

Set api_url to match your deployment target:

  • https://serverless.roboflow.com for the Serverless Cloud API.

  • http://localhost:9001 for a local Inference server.

  • Your Dedicated Deployment URL for a private endpoint.

You can also load the checkpoint in-process with the inference package:

Last updated

Was this helpful?