feat(swagger): update swagger (#9318)

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 22:31:36 +02:00
committed by GitHub
parent 8ab0744458
commit b20a2f1cea
3 changed files with 137 additions and 0 deletions

View File

@@ -771,6 +771,57 @@ const docTemplate = `{
}
}
},
"/api/models/toggle-pinned/{name}/{action}": {
"put": {
"description": "Pin or unpin a model. Pinned models stay loaded and are excluded from automatic eviction.",
"tags": [
"config"
],
"summary": "Toggle model pinned status",
"parameters": [
{
"type": "string",
"description": "Model name",
"name": "name",
"in": "path",
"required": true
},
{
"type": "string",
"description": "Action: 'pin' or 'unpin'",
"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/models/vram-estimate": {
"post": {
"description": "Estimates VRAM based on model weight files, context size, and GPU layers",

View File

@@ -768,6 +768,57 @@
}
}
},
"/api/models/toggle-pinned/{name}/{action}": {
"put": {
"description": "Pin or unpin a model. Pinned models stay loaded and are excluded from automatic eviction.",
"tags": [
"config"
],
"summary": "Toggle model pinned status",
"parameters": [
{
"type": "string",
"description": "Model name",
"name": "name",
"in": "path",
"required": true
},
{
"type": "string",
"description": "Action: 'pin' or 'unpin'",
"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/models/vram-estimate": {
"post": {
"description": "Estimates VRAM based on model weight files, context size, and GPU layers",

View File

@@ -2241,6 +2241,41 @@ paths:
summary: Get dynamic autocomplete values for a config field
tags:
- config
/api/models/toggle-pinned/{name}/{action}:
put:
description: Pin or unpin a model. Pinned models stay loaded and are excluded
from automatic eviction.
parameters:
- description: Model name
in: path
name: name
required: true
type: string
- description: 'Action: ''pin'' or ''unpin'''
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 pinned status
tags:
- config
/api/models/vram-estimate:
post:
consumes: