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 Graph Pipeline Validation

From Leeroopedia
Knowledge Sources
Domains Testing, Pipeline, Model_Serving
Last Updated 2026-02-13 00:00 GMT

Overview

Concrete curl-based testing pattern for validating InferenceGraph pipeline outputs with expected response formats.

Description

Pipeline validation uses HTTP POST requests to the graph URL with known test inputs. The expected response format varies by graph type. The Iris dataset sample input (iris-input.json) is commonly used for testing sklearn and xgboost graph components.

Usage

Run validation after deploying an InferenceGraph and verifying all component ISVCs are ready.

Code Reference

Source Location

  • Repository: kserve
  • File: docs/samples/graph/iris-input.json, Lines 1-6
  • File: docs/samples/graph/README.md, Lines 60-75 (sequence), Lines 185-200 (ensemble)

Signature

curl http://<graph-name>.<namespace>.example.com/ \
  -d @iris-input.json

Import

# No import — uses curl and test input JSON

I/O Contract

Inputs

Name Type Required Description
Graph URL string Yes InferenceGraph entry URL from status.url
Test input JSON Yes Prediction input (e.g., Iris features)

Outputs

Name Type Description
Sequence output JSON {"predictions": [1, 1]} — final step result
Ensemble output JSON {"sklearn-iris": {"predictions": [1,1]}, "xgboost-iris": {"predictions": [1,1]}}
Splitter output JSON {"treeModel": {"predictions": [1,1]}} — selected step result

Usage Examples

Validate Ensemble Graph

# Test input
cat > iris-input.json <<EOF
{
  "instances": [
    [6.8, 2.8, 4.8, 1.4],
    [6.0, 3.4, 4.5, 1.6]
  ]
}
EOF

# Send to ensemble graph
GRAPH_URL=$(kubectl get ig model-ensemble -o jsonpath='{.status.url}')
curl -s ${GRAPH_URL} -d @iris-input.json | jq .

# Expected output:
# {
#   "sklearn-iris": {"predictions": [1, 1]},
#   "xgboost-iris": {"predictions": [1, 1]}
# }

Validate Sequence Graph

GRAPH_URL=$(kubectl get ig model-chained -o jsonpath='{.status.url}')
curl -s ${GRAPH_URL} -d @iris-input.json | jq .

# Expected output (final step's output):
# {"predictions": [1, 1]}

Related Pages

Implements Principle

Page Connections

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