Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for the KServe inputs format #459

Closed
ruivieira opened this issue Nov 22, 2023 · 0 comments · Fixed by #456
Closed

Add support for the KServe inputs format #459

ruivieira opened this issue Nov 22, 2023 · 0 comments · Fixed by #456
Assignees
Labels
kind/bug Something isn't working kind/enhancement New feature or request rhods-2.5

Comments

@ruivieira
Copy link
Member

ruivieira commented Nov 22, 2023

Add support for the KServe "inputs" format.

Example:

Input:

{
    "inputs": [
      {
        "name": "input-0",
        "shape": [1, 4],
        "datatype": "FP32",
        "data": [
          [32, 0, 1, 2]
        ]
      }
    ]
  }

Output:

{"model_name":"example-isvc","id":"04f66a85-a54d-4a9c-aa5e-5f4514cb4def","parameters":{},"outputs":[{"name":"predict","shape":[1,1],"datatype":"INT64","data":[0]}]}

Validation

Assuming

  • A KServe installation
  • A namespace test
  • A test model like the below, deployed in test
  • A TrustyAIService CR deployed in test.

Model:

apiVersion: serving.kserve.io/v1beta1
kind: InferenceService
metadata:
  name: income-isvc
spec:
  predictor:
    model:
      modelFormat:
        name: sklearn
      runtime: kserve-mlserver
      storageUri: "https://github.com/trustyai-explainability/trustyai-explainability/raw/e3a0de0f73bffb764c65e44ccc7f40735104bb9d/explainability-service/demo/models/model.joblib"

And an example payload (e.g. in payload.json):

{
    "inputs": [
      {
        "name": "input-0",
        "shape": [1, 4],
        "datatype": "FP32",
        "data": [
          [32, 0, 1, 2]
        ]
      }
    ]
  }

Issuing an inference request to the model (localhost added for simplicity, adapt to the model's ingress), e.g.

curl -v \
  -H "Host: ${SERVICE_HOSTNAME}" \
  -H "Content-Type: application/json" \
  -d @./payload.json \
  http://localhost:8080/v2/models/income-isvc/infer

Should be correctly parsed by the TrustyAIService. This can be verified either from the TrustyAIService logs, which will report a payload reconciliation, or by inspecting the existence of the data files in the TrustyAIService storage.

@ruivieira ruivieira added kind/bug Something isn't working kind/enhancement New feature or request labels Nov 22, 2023
@ruivieira ruivieira self-assigned this Nov 22, 2023
@ruivieira ruivieira linked a pull request Nov 22, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working kind/enhancement New feature or request rhods-2.5
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant