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.

Implementation:Kserve Kserve Batcher Sample Input

From Leeroopedia
Revision as of 13:08, 16 February 2026 by Admin (talk | contribs) (Auto-imported from implementations/Kserve_Kserve_Batcher_Sample_Input.md)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Knowledge Sources
Domains Kubernetes, Model Serving, Batch Inference
Last Updated 2026-02-13 00:00 GMT

Overview

This file contains sample input data for testing the KServe inference batcher with image classification, providing pixel data in the KServe v1 prediction format.

Description

The file is a JSON document structured as a KServe v1 prediction request with an instances array containing multi-dimensional arrays of floating-point pixel values representing images in CIFAR-10 format (3 channels x 32 x 32 pixels). At 3,276 lines, the file provides a realistically sized payload to demonstrate meaningful batch processing behavior, where the batcher accumulates multiple inference requests and submits them as a single batched call to the model server.

Usage

Use this input file to test the KServe batcher feature. Send it as the request body to an InferenceService endpoint that has batcher annotations enabled. The large payload size helps verify that the batcher correctly handles substantial input data and demonstrates performance improvements from batching.

Code Reference

Source Location

Signature

{
   "instances": [
      [
         [
            [
               0.23921573162078857,
               0.24705886840820312,
               0.29411768913269043,
               ...
            ],
            ...  // 32 values per row
         ],
         ...  // 3 channels (RGB)
      ],
      ...  // 32 rows per channel
   ]
}

Import

# Send to an InferenceService with batcher enabled
curl -v -H "Content-Type: application/json" \
  http://${SERVICE_HOSTNAME}/v1/models/${MODEL_NAME}:predict \
  -d @docs/samples/batcher/basic/input.json

I/O Contract

Input Structure

Field Type Description
instances array Top-level array of input instances (KServe v1 format)
instances[i] 3D array Single image as [channels][height][width] (3 x 32 x 32)
pixel values float Normalized floating-point values (approximately -1.0 to 1.0)

Data Format

Property Value
Format KServe v1 Prediction Request
Image Format CIFAR-10 (3x32x32)
Channels 3 (RGB)
Height 32 pixels
Width 32 pixels
Pixel Type float64 (normalized)
Total Lines 3,276

Expected Output

Field Type Description
predictions array Array of classification predictions for each input instance

Usage Examples

# Deploy an InferenceService with batcher annotations
# Then send the sample input
MODEL_NAME=cifar10
SERVICE_HOSTNAME=$(kubectl get inferenceservice ${MODEL_NAME} \
  -o jsonpath='{.status.url}' | cut -d "/" -f 3)

curl -v -H "Content-Type: application/json" \
  -H "Host: ${SERVICE_HOSTNAME}" \
  http://${INGRESS_HOST}:${INGRESS_PORT}/v1/models/${MODEL_NAME}:predict \
  -d @docs/samples/batcher/basic/input.json

Related Pages

Page Connections

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