Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Principle:Kserve Kserve Prediction Protocol

From Leeroopedia
Revision as of 17:39, 16 February 2026 by Admin (talk | contribs) (Auto-imported from principles/Kserve_Kserve_Prediction_Protocol.md)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Knowledge Sources
Domains API_Design, Model_Serving, Inference
Last Updated 2026-02-13 00:00 GMT

Overview

A standardized request-response protocol for sending prediction inputs to ML model servers and receiving inference outputs via REST and gRPC.

Description

KServe defines two prediction protocols:

  • V1 Protocol: TensorFlow Serving compatible. REST path: /v1/models/<model>:predict. Input format: {"instances": [...]}.
  • V2 Protocol: Open Inference Protocol (formerly KFServing v2). REST path: /v2/models/<model>/infer. Supports tensor-based I/O with explicit shapes and data types.

Both protocols support REST (JSON) and gRPC (protobuf) transports. The protocol choice depends on the model framework and serving runtime configuration.

Usage

Use V1 protocol for TensorFlow Serving compatible models. Use V2 protocol for Triton, MLServer, and other frameworks supporting the Open Inference Protocol. HuggingFace runtime supports both.

Theoretical Basis

# V1 Protocol (TensorFlow Serving compatible)
POST /v1/models/<model_name>:predict
Request:  {"instances": [[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]]}
Response: {"predictions": [0, 1]}

# V2 Protocol (Open Inference Protocol)
POST /v2/models/<model_name>/infer
Request:  {"inputs": [{"name": "input-0", "shape": [2, 3], "datatype": "FP32",
           "data": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0]}]}
Response: {"outputs": [{"name": "output-0", "shape": [2], "datatype": "INT64",
           "data": [0, 1]}]}

# gRPC Transport
Uses protobuf-defined PredictionService with Predict RPC
Supports streaming and binary tensor data

Related Pages

Implemented By

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment