# MLServe Api Document
###### tags: `mlserve` `apidoc`
## Admin api
### Tritons
::: success
::: spoiler GET /api/tritons List tritons
| | |
| ---------- |:-------------- |
| **Title** | **apiTritonList** |
| **URL** | `/api/tritons` |
| **Method** | **GET** |
#### Request
```json=
```
#### Response
```diff=
{
"tritons":[
{
"name": str,
"host": str,
"port": str,
"gpus": int,
"state" str,
"create_at": Date
},
]
}
```
#### Response Now
```json=
{
"tritons":[
{
"id": int,
"ip": str,
"port": str,
"gpus": int,
"models" [],
"path": str,
},
]
}
```
:::
::: info
::: spoiler POST /api/tritons Create tritons
| | |
| ---------- |:-------------- |
| **Title** | **apiTritonCreate** |
| **URL** | `/api/tritons` |
| **Method** | **POST** |
#### Request
```json=
{
"name": str,
"host": str,
"port": str,
"gpus": int
}
```
#### Request Now
```json=
{
"ip": str,
"port": str,
}
```
#### Response
```json=
{
"name": str,
"host": str,
"port": str,
"gpus": int,
"state" str,
"create_at": Date
}
```
#### Response Now
```json=
{
"id": int
}
```
:::
::: success
::: spoiler GET /api/tritons/${ideneity} Get triton
| | |
| ---------- |:-------------- |
| **Title** | **apiTritonGet** |
| **URL** | `/api/tritons/${ideneity}` |
| **Method** | **GET** |
#### Request
```json=
```
#### Response
```json=
{
"name": str,
"host": str,
"port": str,
"gpus": int,
"state" str,
"create_at": Date
}
```
#### Response Now
```json=
{
"data": {
"id": int,
"ip": str,
"port": str,
"gpus": int,
"models" [],
"path": str,
}
}
```
:::
::: warning
::: spoiler PATCH /api/tritons/${ideneity} Update triton
| | |
| ---------- |:-------------- |
| **Title** | **apiTritonUpdate** |
| **URL** | `/api/tritons/${ideneity}` |
| **Method** | **PATCH** |
#### Request
```json=
{
"name": str,
"host": str,
"port": str,
"gpus": int
}
```
#### Request Now
```json=
{
"ip": str,
"port": str,
}
```
#### Response
```json=
{
"name": str,
"host": str,
"port": str,
"gpus": int,
"state" str,
"create_at": Date
}
```
#### Response Now
```json=
{
"status": "ok"
}
```
:::
::: danger
::: spoiler DELETE /api/tritons/${ideneity} Delete triton
| | |
| ---------- |:-------------- |
| **Title** | **apiTritonDelete** |
| **URL** | `/api/tritons/${ideneity}` |
| **Method** | **DELETE** |
#### Request
```json=
```
#### Response
```json=
{
"status": "ok"
}
```
:::
### Models
::: success
::: spoiler GET /api/models List models
| | |
| ---------- |:-------------- |
| **Title** | **apiModelList** |
| **URL** | `/api/models` |
| **Method** | **GET** |
#### Request
```json=
```
#### Response
```json=
{
"models":[
{
"name": str,
"latest_version": str,
"inference_count": str,
"last_inference": Date,
"state" str,
"create_at": Date
},
]
}
```
#### Response Now
```json=
{
"id": int,
"name": str,
"path": str,
"versions": PickleType,
"tritons": [
"ip": str,
"port": str
]
}
```
:::
::: info
::: spoiler POST /api/models Create model
| | |
| ---------- |:-------------- |
| **Title** | **apiModelCreate** |
| **URL** | `/api/models` |
| **Method** | **POST** |
#### Request
```json=
{
"name": str,
"files[]": File[],
}
```
#### Response
```json=
{
"name": str,
"latest_version": str,
"inference_count": str,
"last_inference": Date,
"state" str,
"create_at": Date
}
```
#### Response Now
```json=
{
"id": int
}
```
:::
::: success
::: spoiler GET /api/models/${identity} Get model
| | |
| ---------- |:-------------- |
| **Title** | **apiModelGet** |
| **URL** | `/api/models/${identity}` |
| **Method** | **GET** |
#### Request
```json=
{
}
```
#### Request Now
```json=
{
"triton_id": str
}
```
#### Response
```json=
{
"name": str,
"latest_version": str,
"inference_count": str,
"last_inference": Date,
"state" str,
"versions": [
{
"version": str,
"inference_count": str,
"execution_count": str,
"last_inference": Date,
"state" str,
},
]
"create_at": Date
}
```
#### Response Now
```json=
{
"config": {
"localhost:8080": {
"name":"resnet50_netdef",
"versions" :["1","2"],
"platform":"caffe2_netdef",
"inputs":[
{
"name":"gpu_0/data","datatype":"FP32","shape":[-1,3,224,224]
}
],
"outputs":[
{
"name":"gpu_0/softmax","datatype":"FP32","shape":[-1,1000]
}
]
}
}
}
```
:::
::: warning
::: spoiler PATCH /api/models/${identity} Update model
| | |
| ---------- |:-------------- |
| **Title** | **apiModelGet** |
| **URL** | `/api/models/${identity}` |
| **Method** | **PATCH** |
#### Request
```json=
{
"description": str
}
```
#### Request Now
```json=
{
"Files[]": File
}
```
#### Response
```json=
{
"status": "ok"
}
```
:::
::: danger
::: spoiler DELETE /api/models/${identity} Delete model
| | |
| ---------- |:-------------- |
| **Title** | **apiModelDelete** |
| **URL** | `/api/models/${identity}` |
| **Method** | **DELETE** |
#### Request
```json=
```
#### Response
```json=
{
"status": "ok"
}
```
:::
::: info
::: spoiler POST /api/models/${identity}/load Load model
| | |
| ---------- |:-------------- |
| **Title** | **apiModelLoad** |
| **URL** | `/api/models/${identity}/load` |
| **Method** | **POST** |
#### Request
```json=
```
#### Request Now
```json=
{
"triton_id": str
}
```
#### Response
```json=
{
"status": "ok"
}
```
:::
::: info
::: spoiler POST /api/models/${identity} Unload model
| | |
| ---------- |:-------------- |
| **Title** | **apiModelUnload** |
| **URL** | `/api/models/${identity}/unload` |
| **Method** | **POST** |
#### Request
```json=
```
#### Request Now
```json=
{
"triton_id": str
}
```
#### Response
```json=
{
"status": "ok"
}
```
:::
::: success
::: spoiler GET /api/models/${identity}/versions List model-version
| | |
| ---------- |:-------------- |
| **Title** | **apiModelVersionList** |
| **URL** | `/api/models/${identity}/versions` |
| **Method** | **GET** |
#### Request
```json=
```
#### Response
```json=
{
"versions": [
{
"version": str,
"inference_count": str,
"execution_count": str,
"last_inference": Date,
"state" str,
},
]
}
```
#### Response Now
```json=
{
"versions": PickleType
}
```
:::
::: info
::: spoiler POST /api/models/${identity}/versions Upgrade model-version
| | |
| ---------- |:-------------- |
| **Title** | **apiModelVersionCreate** |
| **URL** | `/api/models/${identity}/versions` |
| **Method** | **POST** |
#### Request
```json=
{
"Files[]": Files[],
"offset": str,
"check": str
}
```
#### Response
```json=
{
"status": "ok"
}
```
:::
::: danger
::: spoiler DELETE /api/models/${identity}/versions Delete model-version
| | |
| ---------- |:-------------- |
| **Title** | **apiModelVersionDelete** |
| **URL** | `/api/models/${identity}/versions` |
| **Method** | **DELETE** |
#### Request
```json=
```
#### Response
```json=
{
"status": "ok"
}
```
:::
### Users
::: success
::: spoiler GET /api/users List Users
| | |
| ---------- |:-------------- |
| **Title** | **apiUserList** |
| **URL** | `/api/users` |
| **Method** | **GET** |
#### Request
```json=
```
#### Response
```json=
{
"users": [
{
"name": str,
"password": str,
"role": str,
"tags": str,
"apps": [
str
]
}
]
}
```
:::
::: info
::: spoiler POST /api/users Create User
| | |
| ---------- |:-------------- |
| **Title** | **apiUserCreate** |
| **URL** | `/api/users` |
| **Method** | **POST** |
#### Request
```json=
{
"name": str,
"password": str,
"role": str,
"tags": str
}
```
#### Response
```json=
{
"status": "ok"
}
```
:::
::: success
::: spoiler GET /api/users/${identity} Get User
| | |
| ---------- |:-------------- |
| **Title** | **apiUserGet** |
| **URL** | `/api/users/${identity}` |
| **Method** | **GET** |
#### Request
```json=
{
"name": str,
"password": str,
"role": str,
"tags": str
}
```
#### Response
```json=
{
"name": str,
"password": str,
"role": str,
"tags": str,
"apps": [
str
]
}
```
:::
::: danger
::: spoiler DELETE /api/users/${identity} Delete User
| | |
| ---------- |:-------------- |
| **Title** | **apiUserDelete** |
| **URL** | `/api/users/${identity}` |
| **Method** | **DELETE** |
#### Request
```json=
```
#### Response
```json=
{
"status": "ok"
}
```
:::
::: warning
::: spoiler PATCH /api/users/${identity} Update User
| | |
| ---------- |:-------------- |
| **Title** | **apiUserUpdate** |
| **URL** | `/api/users/${identity}` |
| **Method** | **PATCH** |
#### Request
```json=
{
"password": str,
"role": str,
"tags": str
}
```
#### Response
```json=
{
"status": "ok"
}
```
:::
::: success
::: spoiler GET /api/users/${identity}/apps List User Apps
| | |
| ---------- |:-------------- |
| **Title** | **apiiUserAppList** |
| **URL** | `/api/users/${identity}/apps` |
| **Method** | **GET** |
#### Request
```json=
```
#### Response
```json=
{
"apps": [str]
}
```
:::
::: info
::: spoiler POST /api/users/${identity}/apps/${app}/auth Auth User App
| | |
| ---------- |:-------------- |
| **Title** | **apiUserAppAuth** |
| **URL** | `/api/users/${identity}/apps/${app}/auth` |
| **Method** | **POST** |
#### Request
```json=
```
#### Response
```json=
{
"status": "ok"
}
```
:::
::: info
::: spoiler POST /api/users/${identity}/apps/${app}/unauth Unauth User App
| | |
| ---------- |:-------------- |
| **Title** | **apiUserAppUnauth** |
| **URL** | `/api/users/${identity}/apps/${app}/unauth` |
| **Method** | **POST** |
#### Request
```json=
```
#### Response
```json=
{
"status": "ok"
}
```
:::
### Applications
::: success
::: spoiler GET /api/apps List Applications
| | |
| ---------- |:-------------- |
| **Title** | **apiAppList** |
| **URL** | `/api/apps` |
| **Method** | **GET** |
#### Request
```json=
```
#### Response
```json=
{
"apps": [
{
"name": str,
"host": str,
"port": str,
"retries": str,
"routes": [
{
"model_name": str,
"protocols": [str],
"url": str,
"paths": [str],
"create_at": Date
},
],
"consumers": [
{
"name": str,
"tags": str,
"cteate_at": Date
},
],
"update_at": Date,
"create_at": Date
},
]
}
```
:::
::: info
::: spoiler POST /api/apps Create Application
| | |
| ---------- |:-------------- |
| **Title** | **apiAppCreate** |
| **URL** | `/api/apps` |
| **Method** | **POST** |
#### Request
```json=
{
"name": str,
"host": str,
"ip": str,
"gpus": int, // Fix 1 now
"retries": int
}
```
#### Response
```json=
{
"name": str,
"host": str,
"ip": str,
"gpus": int,
"retries": int,
"update_at": Date,
"create_at": Date
}
```
:::
::: success
::: spoiler GET /api/apps/{$identity} Get Application
| | |
| ---------- |:-------------- |
| **Title** | **apiAppGet** |
| **URL** | `/api/apps/${identity}` |
| **Method** | **GET** |
#### Request
```json=
```
#### Response
```json=
{
"name": str,
"host": str,
"ip": str,
"gpus": int,
"retries": int
"routes": [
{
"model_name": str,
"protocols": [str],
"url": str,
"paths": [str],
"create_at": Date
},
],
"consumers": [
{
"name": str,
"tags": str,
"cteate_at": Date
},
],
"update_at": Date,
"create_at": Date
}
```
:::
::: warning
::: spoiler PATCH /api/apps/${identity} Update Application
| | |
| ---------- |:-------------- |
| **Title** | **apiAppUpdate** |
| **URL** | `/api/apps/${identity}` |
| **Method** | **PATCH** |
#### Request
```json=
{
"name": str,
"host": str,
"ip": str,
"gpus": int, // Fix 1 now
"retries": int
}
```
#### Response
```json=
{
"name": str,
"host": str,
"ip": str,
"gpus": int,
"retries": int
"update_at": Date,
"create_at": Date
}
```
:::
::: danger
::: spoiler DELETE /api/apps/${identity} Delete Application
| | |
| ---------- |:-------------- |
| **Title** | **apiAppDelete** |
| **URL** | `/api/apps/${identity}` |
| **Method** | **DELETE** |
#### Request
```json=
```
#### Response
```json=
{
"status": "ok"
}
```
:::
::: success
::: spoiler GET /api/apps/${identity}/routes Get models from Application
| | |
| ---------- |:-------------- |
| **Title** | **apiAppRoutesList** |
| **URL** | `/api/apps/${identity}/routes` |
| **Method** | **GET** |
#### Request
```json=
```
#### Response
```json=
{
"routes": [
{
"model_name": str,
"protocols": [str],
"url": str,
"paths": [str],
"create_at": Date
},
]
}
```
:::
::: info
::: spoiler POST /api/apps/${identity}/routes/${model} Import model to Application
| | |
| ---------- |:-------------- |
| **Title** | **apiAppRoutesImport** |
| **URL** | `/api/apps/${identity}/routes/${model}` |
| **Method** | **POST** |
#### Request
```json=
```
#### Response
```json=
{
"status": "ok"
}
```
:::
::: danger
::: spoiler DELETE /api/apps/${identity}/routes/${model} Remove model from Application
| | |
| ---------- |:-------------- |
| **Title** | **apiAppRoutesRemove** |
| **URL** | `/api/apps/${identity}/routes/${model}` |
| **Method** | **DELETE** |
#### Request
```json=
```
#### Response
```json=
{
"status": "ok"
}
```
:::
::: success
::: spoiler GET /api/apps/${identity}/consumers Get consumers from Application
| | |
| ---------- |:-------------- |
| **Title** | **apiAppConsumersList** |
| **URL** | `/api/apps/${identity}/consumers` |
| **Method** | **GET** |
#### Request
```json=
```
#### Response
```json=
{
"consumers": [
{
"name": str,
"tags": str,
"cteate_at": Date
},
],
}
```
:::
::: info
::: spoiler POST /api/apps/${identity}/consumers/${consumer} Add consumer to Application
| | |
| ---------- |:-------------- |
| **Title** | **apiAppConsumersAdd** |
| **URL** | `/api/apps/${identity}/consumers/${consumer}` |
| **Method** | **POST** |
#### Request
```json=
```
#### Response
```json=
{
"status": "ok"
}
```
:::
::: danger
::: spoiler DELETE /api/apps/${consumers}/routes/${consumer} Remove consumer from Application
| | |
| ---------- |:-------------- |
| **Title** | **apiAppConsumersRemove** |
| **URL** | `/api/apps/${identity}/consumers/${consumer}` |
| **Method** | **DELETE** |
#### Request
```json=
```
#### Response
```json=
{
"status": "ok"
}
```
:::
## Developer api