From 68c2056a7b76bf40349505ac7d4ba1aba1162e78 Mon Sep 17 00:00:00 2001 From: Zev Isert Date: Sun, 26 Nov 2023 17:01:52 -0800 Subject: [PATCH] feat: add missing versionless OpenAPI routes --- .../protocol/open_inference_rest.yaml | 93 +++++++++++++++++-- 1 file changed, 87 insertions(+), 6 deletions(-) diff --git a/specification/protocol/open_inference_rest.yaml b/specification/protocol/open_inference_rest.yaml index a14f9eb..ffeb5bd 100644 --- a/specification/protocol/open_inference_rest.yaml +++ b/specification/protocol/open_inference_rest.yaml @@ -52,13 +52,30 @@ paths: in: path required: true get: - summary: Model Ready + summary: Model Version Ready tags: [] responses: '200': description: OK operationId: check-model-version-readiness - 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. + description: The "model ready" health API indicates if a specific model is ready for inferencing. The model name and version must be provided in the URL. + '/v2/models/{MODEL_NAME}/ready': + parameters: + - schema: + type: string + name: MODEL_NAME + in: path + required: true + get: + summary: Model Ready + tags: [] + responses: + '200': + description: OK + operationId: check-model-readiness + description: > + The "model ready" health API indicates if a specific model is ready for inferencing. + The model name is provided in the URL. The server may choose a model version based on its own policies. /v2/: get: summary: Server Metadata @@ -77,7 +94,9 @@ paths: schema: $ref: '#/components/schemas/metadata_server_error_response' operationId: read-server-metadata - description: 'The server metadata endpoint provides information about the server. A server metadata request is made with an HTTP GET to a server metadata endpoint. In the corresponding response the HTTP body contains the [Server Metadata Response JSON Object](#server-metadata-response-json-object) or the [Server Metadata Response JSON Error Object](#server-metadata-response-json-error-object).' + description: > + The server metadata endpoint provides information about the server. + Compliant servers return a [Server Metadata Response JSON Object](#server-metadata-response-json-object) or a [Server Metadata Response JSON Error Object](#server-metadata-response-json-error-object). '/v2/models/{MODEL_NAME}/versions/{MODEL_VERSION}': parameters: - schema: @@ -91,7 +110,7 @@ paths: in: path required: true get: - summary: Model Metadata + summary: Model Version Metadata tags: [] responses: '200': @@ -101,7 +120,32 @@ paths: schema: $ref: '#/components/schemas/metadata_model_response' operationId: read-model-version-metadata - 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.' + description: > + The per-model metadata endpoint provides information about a model. + Compliant servers return a [Model Metadata Response JSON Object](#model-metadata-response-json-object) or a [Model Metadata Response JSON Error Object](#model-metadata-response-json-error-object). + The model name and version must be provided in the URL. + '/v2/models/{MODEL_NAME}': + parameters: + - schema: + type: string + name: MODEL_NAME + in: path + required: true + get: + summary: Model Metadata + tags: [] + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/metadata_model_response' + operationId: read-model-metadata + description: > + The per-model metadata endpoint provides information about a model. + Compliant servers return a [Model Metadata Response JSON Object](#model-metadata-response-json-object) or a [Model Metadata Response JSON Error Object](#model-metadata-response-json-error-object). + The model name is provided in the URL. The server may choose a model version based on its own policies or return an error. '/v2/models/{MODEL_NAME}/versions/{MODEL_VERSION}/infer': parameters: - schema: @@ -135,7 +179,44 @@ paths: 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.' + description: > + An inference request is made with an HTTP POST to an inference endpoint. + Compliant servers return an [Inference Response JSON Object](#inference-response-json-object) or an [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. + The model name and version must be provided in the URL. + '/v2/models/{MODEL_NAME}/infer': + parameters: + - schema: + type: string + name: MODEL_NAME + in: path + required: true + post: + summary: Inference + operationId: model-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. + Compliant servers return an [Inference Response JSON Object](#inference-response-json-object) or an [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. + The model name is provided in the URL. The server may choose a model version based on its own policies or return an error. components: schemas: metadata_server_response: