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>
This commit is contained in:
LocalAI [bot] 2026-04-11 08:38:55 +02:00 committed by GitHub
parent 606f462da4
commit c39213443b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 201 additions and 0 deletions

View file

@ -805,6 +805,57 @@ const docTemplate = `{
}
}
},
"/api/models/{name}/{action}": {
"put": {
"description": "Enable or disable a model from being loaded on demand. Disabled models remain installed but cannot be loaded.",
"tags": [
"config"
],
"summary": "Toggle model enabled/disabled status",
"parameters": [
{
"type": "string",
"description": "Model name",
"name": "name",
"in": "path",
"required": true
},
{
"type": "string",
"description": "Action: 'enable' or 'disable'",
"name": "action",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/localai.ModelResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/localai.ModelResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/localai.ModelResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/localai.ModelResponse"
}
}
}
}
},
"/api/p2p": {
"get": {
"tags": [
@ -2358,6 +2409,30 @@ const docTemplate = `{
}
}
},
"localai.ModelResponse": {
"type": "object",
"properties": {
"config": {},
"details": {
"type": "array",
"items": {
"type": "string"
}
},
"error": {
"type": "string"
},
"filename": {
"type": "string"
},
"message": {
"type": "string"
},
"success": {
"type": "boolean"
}
}
},
"localai.vramEstimateRequest": {
"type": "object",
"properties": {

View file

@ -802,6 +802,57 @@
}
}
},
"/api/models/{name}/{action}": {
"put": {
"description": "Enable or disable a model from being loaded on demand. Disabled models remain installed but cannot be loaded.",
"tags": [
"config"
],
"summary": "Toggle model enabled/disabled status",
"parameters": [
{
"type": "string",
"description": "Model name",
"name": "name",
"in": "path",
"required": true
},
{
"type": "string",
"description": "Action: 'enable' or 'disable'",
"name": "action",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/localai.ModelResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/localai.ModelResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/localai.ModelResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/localai.ModelResponse"
}
}
}
}
},
"/api/p2p": {
"get": {
"tags": [
@ -2355,6 +2406,30 @@
}
}
},
"localai.ModelResponse": {
"type": "object",
"properties": {
"config": {},
"details": {
"type": "array",
"items": {
"type": "string"
}
},
"error": {
"type": "string"
},
"filename": {
"type": "string"
},
"message": {
"type": "string"
},
"success": {
"type": "boolean"
}
}
},
"localai.vramEstimateRequest": {
"type": "object",
"properties": {

View file

@ -256,6 +256,22 @@ definitions:
type: string
type: array
type: object
localai.ModelResponse:
properties:
config: {}
details:
items:
type: string
type: array
error:
type: string
filename:
type: string
message:
type: string
success:
type: boolean
type: object
localai.vramEstimateRequest:
properties:
context_size:
@ -2125,6 +2141,41 @@ paths:
summary: Get an instruction's API guide or OpenAPI fragment
tags:
- instructions
/api/models/{name}/{action}:
put:
description: Enable or disable a model from being loaded on demand. Disabled
models remain installed but cannot be loaded.
parameters:
- description: Model name
in: path
name: name
required: true
type: string
- description: 'Action: ''enable'' or ''disable'''
in: path
name: action
required: true
type: string
responses:
"200":
description: OK
schema:
$ref: '#/definitions/localai.ModelResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/localai.ModelResponse'
"404":
description: Not Found
schema:
$ref: '#/definitions/localai.ModelResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/localai.ModelResponse'
summary: Toggle model enabled/disabled status
tags:
- config
/api/models/config-json/{name}:
patch:
consumes: