Skip to content

Commit c392134

Browse files
localai-botmudler
andauthored
feat(swagger): update swagger (#9310)
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: mudler <2420543+mudler@users.noreply.github.com>
1 parent 606f462 commit c392134

3 files changed

Lines changed: 201 additions & 0 deletions

File tree

swagger/docs.go

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -805,6 +805,57 @@ const docTemplate = `{
805805
}
806806
}
807807
},
808+
"/api/models/{name}/{action}": {
809+
"put": {
810+
"description": "Enable or disable a model from being loaded on demand. Disabled models remain installed but cannot be loaded.",
811+
"tags": [
812+
"config"
813+
],
814+
"summary": "Toggle model enabled/disabled status",
815+
"parameters": [
816+
{
817+
"type": "string",
818+
"description": "Model name",
819+
"name": "name",
820+
"in": "path",
821+
"required": true
822+
},
823+
{
824+
"type": "string",
825+
"description": "Action: 'enable' or 'disable'",
826+
"name": "action",
827+
"in": "path",
828+
"required": true
829+
}
830+
],
831+
"responses": {
832+
"200": {
833+
"description": "OK",
834+
"schema": {
835+
"$ref": "#/definitions/localai.ModelResponse"
836+
}
837+
},
838+
"400": {
839+
"description": "Bad Request",
840+
"schema": {
841+
"$ref": "#/definitions/localai.ModelResponse"
842+
}
843+
},
844+
"404": {
845+
"description": "Not Found",
846+
"schema": {
847+
"$ref": "#/definitions/localai.ModelResponse"
848+
}
849+
},
850+
"500": {
851+
"description": "Internal Server Error",
852+
"schema": {
853+
"$ref": "#/definitions/localai.ModelResponse"
854+
}
855+
}
856+
}
857+
}
858+
},
808859
"/api/p2p": {
809860
"get": {
810861
"tags": [
@@ -2358,6 +2409,30 @@ const docTemplate = `{
23582409
}
23592410
}
23602411
},
2412+
"localai.ModelResponse": {
2413+
"type": "object",
2414+
"properties": {
2415+
"config": {},
2416+
"details": {
2417+
"type": "array",
2418+
"items": {
2419+
"type": "string"
2420+
}
2421+
},
2422+
"error": {
2423+
"type": "string"
2424+
},
2425+
"filename": {
2426+
"type": "string"
2427+
},
2428+
"message": {
2429+
"type": "string"
2430+
},
2431+
"success": {
2432+
"type": "boolean"
2433+
}
2434+
}
2435+
},
23612436
"localai.vramEstimateRequest": {
23622437
"type": "object",
23632438
"properties": {

swagger/swagger.json

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -802,6 +802,57 @@
802802
}
803803
}
804804
},
805+
"/api/models/{name}/{action}": {
806+
"put": {
807+
"description": "Enable or disable a model from being loaded on demand. Disabled models remain installed but cannot be loaded.",
808+
"tags": [
809+
"config"
810+
],
811+
"summary": "Toggle model enabled/disabled status",
812+
"parameters": [
813+
{
814+
"type": "string",
815+
"description": "Model name",
816+
"name": "name",
817+
"in": "path",
818+
"required": true
819+
},
820+
{
821+
"type": "string",
822+
"description": "Action: 'enable' or 'disable'",
823+
"name": "action",
824+
"in": "path",
825+
"required": true
826+
}
827+
],
828+
"responses": {
829+
"200": {
830+
"description": "OK",
831+
"schema": {
832+
"$ref": "#/definitions/localai.ModelResponse"
833+
}
834+
},
835+
"400": {
836+
"description": "Bad Request",
837+
"schema": {
838+
"$ref": "#/definitions/localai.ModelResponse"
839+
}
840+
},
841+
"404": {
842+
"description": "Not Found",
843+
"schema": {
844+
"$ref": "#/definitions/localai.ModelResponse"
845+
}
846+
},
847+
"500": {
848+
"description": "Internal Server Error",
849+
"schema": {
850+
"$ref": "#/definitions/localai.ModelResponse"
851+
}
852+
}
853+
}
854+
}
855+
},
805856
"/api/p2p": {
806857
"get": {
807858
"tags": [
@@ -2355,6 +2406,30 @@
23552406
}
23562407
}
23572408
},
2409+
"localai.ModelResponse": {
2410+
"type": "object",
2411+
"properties": {
2412+
"config": {},
2413+
"details": {
2414+
"type": "array",
2415+
"items": {
2416+
"type": "string"
2417+
}
2418+
},
2419+
"error": {
2420+
"type": "string"
2421+
},
2422+
"filename": {
2423+
"type": "string"
2424+
},
2425+
"message": {
2426+
"type": "string"
2427+
},
2428+
"success": {
2429+
"type": "boolean"
2430+
}
2431+
}
2432+
},
23582433
"localai.vramEstimateRequest": {
23592434
"type": "object",
23602435
"properties": {

swagger/swagger.yaml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,22 @@ definitions:
256256
type: string
257257
type: array
258258
type: object
259+
localai.ModelResponse:
260+
properties:
261+
config: {}
262+
details:
263+
items:
264+
type: string
265+
type: array
266+
error:
267+
type: string
268+
filename:
269+
type: string
270+
message:
271+
type: string
272+
success:
273+
type: boolean
274+
type: object
259275
localai.vramEstimateRequest:
260276
properties:
261277
context_size:
@@ -2125,6 +2141,41 @@ paths:
21252141
summary: Get an instruction's API guide or OpenAPI fragment
21262142
tags:
21272143
- instructions
2144+
/api/models/{name}/{action}:
2145+
put:
2146+
description: Enable or disable a model from being loaded on demand. Disabled
2147+
models remain installed but cannot be loaded.
2148+
parameters:
2149+
- description: Model name
2150+
in: path
2151+
name: name
2152+
required: true
2153+
type: string
2154+
- description: 'Action: ''enable'' or ''disable'''
2155+
in: path
2156+
name: action
2157+
required: true
2158+
type: string
2159+
responses:
2160+
"200":
2161+
description: OK
2162+
schema:
2163+
$ref: '#/definitions/localai.ModelResponse'
2164+
"400":
2165+
description: Bad Request
2166+
schema:
2167+
$ref: '#/definitions/localai.ModelResponse'
2168+
"404":
2169+
description: Not Found
2170+
schema:
2171+
$ref: '#/definitions/localai.ModelResponse'
2172+
"500":
2173+
description: Internal Server Error
2174+
schema:
2175+
$ref: '#/definitions/localai.ModelResponse'
2176+
summary: Toggle model enabled/disabled status
2177+
tags:
2178+
- config
21282179
/api/models/config-json/{name}:
21292180
patch:
21302181
consumes:

0 commit comments

Comments
 (0)