diff --git a/swagger/docs.go b/swagger/docs.go index d556fd889..e2be7b2b5 100644 --- a/swagger/docs.go +++ b/swagger/docs.go @@ -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": { diff --git a/swagger/swagger.json b/swagger/swagger.json index 8b952ff50..944877462 100644 --- a/swagger/swagger.json +++ b/swagger/swagger.json @@ -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": { diff --git a/swagger/swagger.yaml b/swagger/swagger.yaml index 18ef7786f..184d203fa 100644 --- a/swagger/swagger.yaml +++ b/swagger/swagger.yaml @@ -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: