-
Notifications
You must be signed in to change notification settings - Fork 10
/
open_inference_rest.yaml
362 lines (361 loc) · 10.6 KB
/
open_inference_rest.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
# Copyright 2023 The KServe Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
openapi: 3.0.0
info:
title: Data Plane
version: '2.0'
description: 'https://github.com/kserve/open-inference-protocol/blob/main/specification/protocol/inference_rest.md'
license:
name: Apache 2.0
url: 'https://www.apache.org/licenses/LICENSE-2.0'
servers: []
paths:
/v2/health/live:
get:
summary: Server Live
responses:
'200':
description: OK
operationId: get-v2-health-live
description: The “server live” API indicates if the inference server is able to receive and respond to metadata and inference requests. The “server live” API can be used directly to implement the Kubernetes livenessProbe.
/v2/health/ready:
get:
summary: Server Ready
tags: []
responses:
'200':
description: OK
operationId: get-v2-health-ready
description: The “server ready” health API indicates if all the models are ready for inferencing. The “server ready” health API can be used directly to implement the Kubernetes readinessProbe.
'/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: []
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/:
get:
summary: Server Metadata
tags: []
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/metadata_server_response'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/metadata_server_error_response'
operationId: get-v2
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).'
'/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: []
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.'
components:
schemas:
metadata_server_response:
title: metadata_server_response
type: object
description: ''
x-examples: {}
properties:
name:
type: string
version:
type: string
extensions:
type: array
items:
type: string
required:
- name
- version
- extensions
metadata_server_error_response:
title: metadata_server_error_response
type: object
properties:
error:
type: string
required:
- error
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'
properties:
type: object
additionalProperties:
type: string
required:
- name
- platform
metadata_tensor:
title: metadata_tensor
type: object
properties:
name:
type: string
datatype:
type: string
shape:
type: array
items:
type: integer
required:
- name
- datatype
- shape
metadata_model_error_response:
title: metadata_model_error_response
type: object
properties:
error:
type: string
required:
- error
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:
title: parameters
x-examples: {}
type: object
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
tensor_data:
title: tensor_data
type: array
items:
anyOf:
- $ref: '#/components/schemas/tensor_data'
- type: number
- type: string
- type: boolean
request_output:
title: request_output
type: object
properties:
name:
type: string
parameters:
$ref: '#/components/schemas/parameters'
required:
- name
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
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
inference_error_response:
title: inference_error_response
type: object
properties:
error:
type: string