Ultralytics YOLO27:
License YOLO
Back to Ultralytics Glossary

Model Serving

Model serving hosts a trained model behind a network API so applications send inputs and get predictions back, with batching, scaling, and health checks.

Model serving is the hosting of a trained machine learning model behind a network endpoint, usually HTTP or gRPC, so that applications can send inputs and receive predictions. A serving system loads the weights once, keeps them in memory on CPUs or GPUs, accepts many concurrent requests, groups them into batches, adds or removes replicas as traffic changes, swaps model versions, and reports its health. Google open-sourced TensorFlow Serving in February 2016 for running TensorFlow models in production, and serving is now the runtime half of machine learning operations (MLOps), between packaging a model and monitoring its predictions.

How a Serving System Handles Requests#

Each request passes through validation, preprocessing such as decoding and resizing an image, a queue, the model itself, and postprocessing into a response format such as JSON. The queue is where most serving decisions happen. Dynamic batching holds requests for a few milliseconds so the accelerator processes several inputs in one forward pass, which raises throughput at a small cost in inference latency. When the queue is full, the server rejects new requests with HTTP 429 so clients back off.

Serving teams track latency percentiles such as p95 and p99, throughput in requests per second, accelerator utilization, error rate, and cold-start time, the delay before a replica scaled up from zero can answer. Versions roll out gradually: a canary release sends a small share of traffic to the new model, and shadow deployment sends copies of live requests to it without returning its answers.

This FastAPI app loads YOLO26 once at startup and returns detections as JSON. FastAPI's TestClient sends one request through the full HTTP stack in the same process, so the example runs without starting a server:

from fastapi import FastAPI
from fastapi.testclient import TestClient
from ultralytics import YOLO

app = FastAPI()
model = YOLO("yolo26n.pt")  # load the weights once, when the server starts


@app.get("/predict")
async def predict(url: str):
    """Detect objects in the image at `url` and return them as JSON."""
    results = model(url)
    return results[0].summary()


client = TestClient(app)
response = client.get("/predict", params={"url": "https://ultralytics.com/images/bus.jpg"})
print(response.status_code, response.json()[0])

The output shows status 200 and the first detection as a dictionary with its class name, confidence, and box coordinates, the structure summary() produces for every detected object. Because the handler is async def, FastAPI runs it on a single event loop, so the shared model never handles two requests at once. Servers that need parallelism run several worker processes, each loading its own model.

Serving Patterns and Software#

How a model is served depends on when its answers are needed, from real-time inference on camera feeds to overnight jobs:

  • Online serving: Each request gets its answer while the caller waits, over REST or gRPC, as in user-facing apps and live camera feeds.
  • Batch serving: A scheduled job scores a large dataset offline, such as a nightly run over a day of images, and optimizes throughput over latency.
  • Streaming: Results are pushed continuously as video frames or sensor readings arrive.
  • Edge AI: The model runs on the device itself, often after export to an optimized format, with no network round trip.

General-purpose serving software includes NVIDIA Dynamo-Triton, formerly Triton Inference Server, along with TensorFlow Serving, Ray Serve, BentoML, and KServe on Kubernetes. PyTorch's TorchServe is in limited maintenance with no further updates planned. LLM servers such as vLLM, SGLang, and TensorRT-LLM add continuous batching and paged KV cache management for token-by-token generation. Most of these systems run in containers so that the model, runtime, and dependencies ship as one image.

Serving vs. Deployment and Inference Engines#

Model serving is closely tied to a few neighboring terms. Model deployment is the wider process of putting a model into production, including packaging, infrastructure, and rollout, and serving is the part that answers requests once it is live. An inference engine such as TensorRT, ONNX Runtime, or OpenVINO executes the model's computations, and a serving system wraps one or more engines with networking, queuing, and scaling.

Ultralytics Platform serves YOLO models through dedicated endpoints, each a single-tenant service in one of 42 regions with /predict, /health, and generated /docs routes. The default size scales to zero when idle and can take up to about a minute to start, and replacing the model keeps the endpoint URL while the previous model keeps serving until the new one is ready.

Explore solutions

Computer vision in sports

Computer vision in sports

Discover how Ultralytics YOLO powers sports vision with player and ball tracking, performance analytics, coaching insights, and athlete rehabilitation.
Learn more
Computer vision for aerial imagery

Computer vision for aerial imagery

Transform drone and aerial imagery into real-time insights for agriculture, aquaculture, environmental monitoring, conservation, and geospatial analysis with Ultralytics YOLO.
Learn more
Computer vision in aerospace

Computer vision in aerospace

Bring vision AI to aerial monitoring with Ultralytics YOLO models. Power drones, aerospace workflows, environmental conservation & geospatial industries with computer vision solutions.
Learn more
Computer vision in security

Computer vision in security

Protect every site with Ultralytics YOLO models. Vision AI powers perimeter monitoring, threat detection, license-plate recognition, and workplace safety.
Learn more
Computer vision in robotics

Computer vision in robotics

Power smarter machines with Ultralytics YOLO models. Vision AI in robotics drives autonomous navigation, perception, object tracking, and real-time control.
Learn more
Computer vision in logistics

Computer vision in logistics

Streamline logistics with Ultralytics YOLO models. Vision AI enables package inspection, sorting, vehicle tracking, and real-time warehouse safety monitoring.
Learn more
Computer vision in retail

Computer vision in retail

Reimagine retail with Ultralytics YOLO models. Vision AI powers inventory tracking, shelf monitoring, queue management, and smarter customer insights.
Learn more
Computer vision in healthcare

Computer vision in healthcare

Build healthcare solutions with Ultralytics YOLO models. Vision AI in healthcare powers faster medical imaging, smarter diagnostics, and patient monitoring.
Learn more
Computer vision in manufacturing

Computer vision in manufacturing

Optimize manufacturing with Ultralytics YOLO models. Vision AI drives quality control, defect detection, PPE compliance, and assembly line automation.
Learn more
Computer vision in automotive

Computer vision in automotive

Apply computer vision in automotive with Ultralytics YOLO models. Vision AI elevates road safety, driver assistance, and vehicle automation for smarter roads.
Learn more
Computer vision in agriculture

Computer vision in agriculture

Bring vision AI to smart agriculture with Ultralytics YOLO models. Power crop monitoring, livestock tracking, and precision farming for higher, smarter yields.
Learn more
Computer vision in sports

Computer vision in sports

Discover how Ultralytics YOLO powers sports vision with player and ball tracking, performance analytics, coaching insights, and athlete rehabilitation.
Learn more
Computer vision for aerial imagery

Computer vision for aerial imagery

Transform drone and aerial imagery into real-time insights for agriculture, aquaculture, environmental monitoring, conservation, and geospatial analysis with Ultralytics YOLO.
Learn more
Computer vision in aerospace

Computer vision in aerospace

Bring vision AI to aerial monitoring with Ultralytics YOLO models. Power drones, aerospace workflows, environmental conservation & geospatial industries with computer vision solutions.
Learn more
Computer vision in security

Computer vision in security

Protect every site with Ultralytics YOLO models. Vision AI powers perimeter monitoring, threat detection, license-plate recognition, and workplace safety.
Learn more
Computer vision in robotics

Computer vision in robotics

Power smarter machines with Ultralytics YOLO models. Vision AI in robotics drives autonomous navigation, perception, object tracking, and real-time control.
Learn more
Computer vision in logistics

Computer vision in logistics

Streamline logistics with Ultralytics YOLO models. Vision AI enables package inspection, sorting, vehicle tracking, and real-time warehouse safety monitoring.
Learn more
Computer vision in retail

Computer vision in retail

Reimagine retail with Ultralytics YOLO models. Vision AI powers inventory tracking, shelf monitoring, queue management, and smarter customer insights.
Learn more
Computer vision in healthcare

Computer vision in healthcare

Build healthcare solutions with Ultralytics YOLO models. Vision AI in healthcare powers faster medical imaging, smarter diagnostics, and patient monitoring.
Learn more
Computer vision in manufacturing

Computer vision in manufacturing

Optimize manufacturing with Ultralytics YOLO models. Vision AI drives quality control, defect detection, PPE compliance, and assembly line automation.
Learn more
Computer vision in automotive

Computer vision in automotive

Apply computer vision in automotive with Ultralytics YOLO models. Vision AI elevates road safety, driver assistance, and vehicle automation for smarter roads.
Learn more
Computer vision in agriculture

Computer vision in agriculture

Bring vision AI to smart agriculture with Ultralytics YOLO models. Power crop monitoring, livestock tracking, and precision farming for higher, smarter yields.
Learn more
Computer vision in sports

Computer vision in sports

Discover how Ultralytics YOLO powers sports vision with player and ball tracking, performance analytics, coaching insights, and athlete rehabilitation.
Learn more
Computer vision for aerial imagery

Computer vision for aerial imagery

Transform drone and aerial imagery into real-time insights for agriculture, aquaculture, environmental monitoring, conservation, and geospatial analysis with Ultralytics YOLO.
Learn more
Computer vision in aerospace

Computer vision in aerospace

Bring vision AI to aerial monitoring with Ultralytics YOLO models. Power drones, aerospace workflows, environmental conservation & geospatial industries with computer vision solutions.
Learn more
Computer vision in security

Computer vision in security

Protect every site with Ultralytics YOLO models. Vision AI powers perimeter monitoring, threat detection, license-plate recognition, and workplace safety.
Learn more
Computer vision in robotics

Computer vision in robotics

Power smarter machines with Ultralytics YOLO models. Vision AI in robotics drives autonomous navigation, perception, object tracking, and real-time control.
Learn more
Computer vision in logistics

Computer vision in logistics

Streamline logistics with Ultralytics YOLO models. Vision AI enables package inspection, sorting, vehicle tracking, and real-time warehouse safety monitoring.
Learn more
Computer vision in retail

Computer vision in retail

Reimagine retail with Ultralytics YOLO models. Vision AI powers inventory tracking, shelf monitoring, queue management, and smarter customer insights.
Learn more
Computer vision in healthcare

Computer vision in healthcare

Build healthcare solutions with Ultralytics YOLO models. Vision AI in healthcare powers faster medical imaging, smarter diagnostics, and patient monitoring.
Learn more
Computer vision in manufacturing

Computer vision in manufacturing

Optimize manufacturing with Ultralytics YOLO models. Vision AI drives quality control, defect detection, PPE compliance, and assembly line automation.
Learn more
Computer vision in automotive

Computer vision in automotive

Apply computer vision in automotive with Ultralytics YOLO models. Vision AI elevates road safety, driver assistance, and vehicle automation for smarter roads.
Learn more
Computer vision in agriculture

Computer vision in agriculture

Bring vision AI to smart agriculture with Ultralytics YOLO models. Power crop monitoring, livestock tracking, and precision farming for higher, smarter yields.
Learn more

Let's build the future of AI together!

Begin your journey with the future of machine learning