openapi: 3.2.0 info: title: Predict Models API version: '2.0' description: https://github.com/kubeflow/kfserving/blob/master/docs/predict-api/v2/required_api.md license: name: Apache 2.0 servers: [] tags: - name: Models paths: /v2/models/${MODEL_NAME}/versions/${MODEL_VERSION}/ready: parameters: - schema: type: string name: MODEL_NAME in: path required: true - schema: type: string name: MODEL_VERSION in: path required: true get: summary: Model Ready tags: - Models responses: '200': description: OK operationId: get-v2-models-$-modelName-versions-$-modelVersion-ready description: The “model ready” health API indicates if a specific model is ready for inferencing. The model name and (optionally) version must be available in the URL. If a version is not provided the server may choose a version based on its own policies. /v2/models/${MODEL_NAME}/versions/${MODEL_VERSION}: parameters: - schema: type: string name: MODEL_NAME in: path required: true - schema: type: string name: MODEL_VERSION in: path required: true get: summary: Model Metadata tags: - Models responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/metadata_model_response' operationId: get-v2-models-$-modelName-versions-$-modelVersion description: The per-model metadata endpoint provides information about a model. A model metadata request is made with an HTTP GET to a model metadata endpoint. In the corresponding response the HTTP body contains the [Model Metadata Response JSON Object](#model-metadata-response-json-object) or the [Model Metadata Response JSON Error Object](#model-metadata-response-json-error-object). The model name and (optionally) version must be available in the URL. If a version is not provided the server may choose a version based on its own policies or return an error. /v2/models/${MODEL_NAME}/versions/${MODEL_VERSION}/infer: parameters: - schema: type: string name: MODEL_NAME in: path required: true - schema: type: string name: MODEL_VERSION in: path required: true post: summary: Inference operationId: post-v2-models-$-MODEL_NAME-versions-$-MODEL_VERSION-infer responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/inference_response' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/inference_error_response' requestBody: content: application/json: schema: $ref: '#/components/schemas/inference_request' description: An inference request is made with an HTTP POST to an inference endpoint. In the request the HTTP body contains the [Inference Request JSON Object](#inference-request-json-object). In the corresponding response the HTTP body contains the [Inference Response JSON Object](#inference-response-json-object) or [Inference Response JSON Error Object](#inference-response-json-error-object). See [Inference Request Examples](#inference-request-examples) for some example HTTP/REST requests and responses. tags: - Models components: schemas: inference_error_response: title: inference_error_response type: object properties: error: type: string inference_request: title: inference_request type: object x-examples: Example 1: id: '42' inputs: - name: input0 shape: - 2 - 2 datatype: UINT32 data: - 1 - 2 - 3 - 4 - name: input1 shape: - 3 datatype: BOOL data: - true outputs: - name: output0 Example 2: id: '42' outputs: - name: output0 shape: - 3 - 2 datatype: FP32 data: - 1 - 1.1 - 2 - 2.1 - 3 - 3.1 properties: id: type: string parameters: $ref: '#/components/schemas/parameters' inputs: type: array items: $ref: '#/components/schemas/request_input' outputs: type: array items: $ref: '#/components/schemas/request_output' required: - inputs parameters: type: object title: parameters x-examples: {} additionalProperties: true properties: content_type: type: string metadata_model_response: title: metadata_model_response type: object properties: name: type: string versions: type: array items: type: string platform: type: string inputs: type: array items: $ref: '#/components/schemas/metadata_tensor' outputs: type: array items: $ref: '#/components/schemas/metadata_tensor' required: - name - platform metadata_tensor: title: metadata_tensor type: object properties: name: type: string datatype: type: string shape: type: array items: type: integer tags: type: object additionalProperties: true properties: content_type: type: string required: - name - datatype - shape response_output: title: response_output type: object properties: name: type: string shape: type: array items: type: integer datatype: type: string parameters: $ref: '#/components/schemas/parameters' data: $ref: '#/components/schemas/tensor_data' required: - name - shape - datatype - data tensor_data: title: tensor_data request_output: title: request_output type: object properties: name: type: string parameters: $ref: '#/components/schemas/parameters' required: - name inference_response: title: inference_response type: object properties: model_name: type: string model_version: type: string id: type: string parameters: $ref: '#/components/schemas/parameters' outputs: type: array items: $ref: '#/components/schemas/response_output' required: - model_name - outputs request_input: title: request_input type: object properties: name: type: string shape: type: array items: type: integer datatype: type: string parameters: $ref: '#/components/schemas/parameters' data: $ref: '#/components/schemas/tensor_data' required: - name - shape - datatype - data