Skip to content

Commit be3d263

Browse files
localai-botmudler
authored andcommitted
feat(swagger): update swagger (#10847)
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: mudler <2420543+mudler@users.noreply.github.com> Signed-off-by: Richard Palethorpe <io@richiejp.com>
1 parent 78f8ee7 commit be3d263

3 files changed

Lines changed: 273 additions & 0 deletions

File tree

swagger/docs.go

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1124,6 +1124,90 @@ const docTemplate = `{
11241124
}
11251125
}
11261126
},
1127+
"/api/nodes/{id}/vram-budget": {
1128+
"put": {
1129+
"tags": [
1130+
"Nodes"
1131+
],
1132+
"summary": "Update a node's VRAM allocation budget",
1133+
"parameters": [
1134+
{
1135+
"type": "string",
1136+
"description": "Node ID",
1137+
"name": "id",
1138+
"in": "path",
1139+
"required": true
1140+
},
1141+
{
1142+
"description": "New value (\\",
1143+
"name": "request",
1144+
"in": "body",
1145+
"required": true,
1146+
"schema": {
1147+
"$ref": "#/definitions/localai.UpdateVRAMBudgetRequest"
1148+
}
1149+
}
1150+
],
1151+
"responses": {
1152+
"200": {
1153+
"description": "OK",
1154+
"schema": {
1155+
"type": "object",
1156+
"additionalProperties": {
1157+
"type": "string"
1158+
}
1159+
}
1160+
},
1161+
"400": {
1162+
"description": "invalid budget",
1163+
"schema": {
1164+
"type": "object",
1165+
"additionalProperties": true
1166+
}
1167+
},
1168+
"404": {
1169+
"description": "node not found",
1170+
"schema": {
1171+
"type": "object",
1172+
"additionalProperties": true
1173+
}
1174+
}
1175+
}
1176+
},
1177+
"delete": {
1178+
"tags": [
1179+
"Nodes"
1180+
],
1181+
"summary": "Reset a node's VRAM budget to the worker default",
1182+
"parameters": [
1183+
{
1184+
"type": "string",
1185+
"description": "Node ID",
1186+
"name": "id",
1187+
"in": "path",
1188+
"required": true
1189+
}
1190+
],
1191+
"responses": {
1192+
"200": {
1193+
"description": "OK",
1194+
"schema": {
1195+
"type": "object",
1196+
"additionalProperties": {
1197+
"type": "boolean"
1198+
}
1199+
}
1200+
},
1201+
"404": {
1202+
"description": "node not found",
1203+
"schema": {
1204+
"type": "object",
1205+
"additionalProperties": true
1206+
}
1207+
}
1208+
}
1209+
}
1210+
},
11271211
"/api/p2p": {
11281212
"get": {
11291213
"tags": [
@@ -3748,6 +3832,9 @@ const docTemplate = `{
37483832
"description": "Cancelled is true if the operation was cancelled",
37493833
"type": "boolean"
37503834
},
3835+
"current_bytes": {
3836+
"type": "integer"
3837+
},
37513838
"deletion": {
37523839
"description": "Deletion is true if the operation is a deletion",
37533840
"type": "boolean"
@@ -3774,11 +3861,17 @@ const docTemplate = `{
37743861
"$ref": "#/definitions/galleryop.NodeProgress"
37753862
}
37763863
},
3864+
"phase": {
3865+
"type": "string"
3866+
},
37773867
"processed": {
37783868
"type": "boolean"
37793869
},
37803870
"progress": {
37813871
"type": "number"
3872+
},
3873+
"total_bytes": {
3874+
"type": "integer"
37823875
}
37833876
}
37843877
},
@@ -3951,6 +4044,15 @@ const docTemplate = `{
39514044
}
39524045
}
39534046
},
4047+
"localai.UpdateVRAMBudgetRequest": {
4048+
"type": "object",
4049+
"properties": {
4050+
"value": {
4051+
"description": "Value is the VRAM cap (\"80%\" or \"12GB\"). Empty string clears the cap.",
4052+
"type": "string"
4053+
}
4054+
}
4055+
},
39544056
"localai.VoiceProfileListResponse": {
39554057
"type": "object",
39564058
"properties": {

swagger/swagger.json

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1121,6 +1121,90 @@
11211121
}
11221122
}
11231123
},
1124+
"/api/nodes/{id}/vram-budget": {
1125+
"put": {
1126+
"tags": [
1127+
"Nodes"
1128+
],
1129+
"summary": "Update a node's VRAM allocation budget",
1130+
"parameters": [
1131+
{
1132+
"type": "string",
1133+
"description": "Node ID",
1134+
"name": "id",
1135+
"in": "path",
1136+
"required": true
1137+
},
1138+
{
1139+
"description": "New value (\\",
1140+
"name": "request",
1141+
"in": "body",
1142+
"required": true,
1143+
"schema": {
1144+
"$ref": "#/definitions/localai.UpdateVRAMBudgetRequest"
1145+
}
1146+
}
1147+
],
1148+
"responses": {
1149+
"200": {
1150+
"description": "OK",
1151+
"schema": {
1152+
"type": "object",
1153+
"additionalProperties": {
1154+
"type": "string"
1155+
}
1156+
}
1157+
},
1158+
"400": {
1159+
"description": "invalid budget",
1160+
"schema": {
1161+
"type": "object",
1162+
"additionalProperties": true
1163+
}
1164+
},
1165+
"404": {
1166+
"description": "node not found",
1167+
"schema": {
1168+
"type": "object",
1169+
"additionalProperties": true
1170+
}
1171+
}
1172+
}
1173+
},
1174+
"delete": {
1175+
"tags": [
1176+
"Nodes"
1177+
],
1178+
"summary": "Reset a node's VRAM budget to the worker default",
1179+
"parameters": [
1180+
{
1181+
"type": "string",
1182+
"description": "Node ID",
1183+
"name": "id",
1184+
"in": "path",
1185+
"required": true
1186+
}
1187+
],
1188+
"responses": {
1189+
"200": {
1190+
"description": "OK",
1191+
"schema": {
1192+
"type": "object",
1193+
"additionalProperties": {
1194+
"type": "boolean"
1195+
}
1196+
}
1197+
},
1198+
"404": {
1199+
"description": "node not found",
1200+
"schema": {
1201+
"type": "object",
1202+
"additionalProperties": true
1203+
}
1204+
}
1205+
}
1206+
}
1207+
},
11241208
"/api/p2p": {
11251209
"get": {
11261210
"tags": [
@@ -3745,6 +3829,9 @@
37453829
"description": "Cancelled is true if the operation was cancelled",
37463830
"type": "boolean"
37473831
},
3832+
"current_bytes": {
3833+
"type": "integer"
3834+
},
37483835
"deletion": {
37493836
"description": "Deletion is true if the operation is a deletion",
37503837
"type": "boolean"
@@ -3771,11 +3858,17 @@
37713858
"$ref": "#/definitions/galleryop.NodeProgress"
37723859
}
37733860
},
3861+
"phase": {
3862+
"type": "string"
3863+
},
37743864
"processed": {
37753865
"type": "boolean"
37763866
},
37773867
"progress": {
37783868
"type": "number"
3869+
},
3870+
"total_bytes": {
3871+
"type": "integer"
37793872
}
37803873
}
37813874
},
@@ -3948,6 +4041,15 @@
39484041
}
39494042
}
39504043
},
4044+
"localai.UpdateVRAMBudgetRequest": {
4045+
"type": "object",
4046+
"properties": {
4047+
"value": {
4048+
"description": "Value is the VRAM cap (\"80%\" or \"12GB\"). Empty string clears the cap.",
4049+
"type": "string"
4050+
}
4051+
}
4052+
},
39514053
"localai.VoiceProfileListResponse": {
39524054
"type": "object",
39534055
"properties": {

swagger/swagger.yaml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,8 @@ definitions:
239239
cancelled:
240240
description: Cancelled is true if the operation was cancelled
241241
type: boolean
242+
current_bytes:
243+
type: integer
242244
deletion:
243245
description: Deletion is true if the operation is a deletion
244246
type: boolean
@@ -262,10 +264,14 @@ definitions:
262264
items:
263265
$ref: '#/definitions/galleryop.NodeProgress'
264266
type: array
267+
phase:
268+
type: string
265269
processed:
266270
type: boolean
267271
progress:
268272
type: number
273+
total_bytes:
274+
type: integer
269275
type: object
270276
localai.APIInstructionResponse:
271277
properties:
@@ -390,6 +396,13 @@ definitions:
390396
>= 1.
391397
type: integer
392398
type: object
399+
localai.UpdateVRAMBudgetRequest:
400+
properties:
401+
value:
402+
description: Value is the VRAM cap ("80%" or "12GB"). Empty string clears
403+
the cap.
404+
type: string
405+
type: object
393406
localai.VoiceProfileListResponse:
394407
properties:
395408
data:
@@ -3400,6 +3413,62 @@ paths:
34003413
summary: Update a node's max replicas per model
34013414
tags:
34023415
- Nodes
3416+
/api/nodes/{id}/vram-budget:
3417+
delete:
3418+
parameters:
3419+
- description: Node ID
3420+
in: path
3421+
name: id
3422+
required: true
3423+
type: string
3424+
responses:
3425+
"200":
3426+
description: OK
3427+
schema:
3428+
additionalProperties:
3429+
type: boolean
3430+
type: object
3431+
"404":
3432+
description: node not found
3433+
schema:
3434+
additionalProperties: true
3435+
type: object
3436+
summary: Reset a node's VRAM budget to the worker default
3437+
tags:
3438+
- Nodes
3439+
put:
3440+
parameters:
3441+
- description: Node ID
3442+
in: path
3443+
name: id
3444+
required: true
3445+
type: string
3446+
- description: New value (\
3447+
in: body
3448+
name: request
3449+
required: true
3450+
schema:
3451+
$ref: '#/definitions/localai.UpdateVRAMBudgetRequest'
3452+
responses:
3453+
"200":
3454+
description: OK
3455+
schema:
3456+
additionalProperties:
3457+
type: string
3458+
type: object
3459+
"400":
3460+
description: invalid budget
3461+
schema:
3462+
additionalProperties: true
3463+
type: object
3464+
"404":
3465+
description: node not found
3466+
schema:
3467+
additionalProperties: true
3468+
type: object
3469+
summary: Update a node's VRAM allocation budget
3470+
tags:
3471+
- Nodes
34033472
/api/nodes/models:
34043473
get:
34053474
responses:

0 commit comments

Comments
 (0)