File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -771,6 +771,57 @@ const docTemplate = `{
771771 }
772772 }
773773 },
774+ "/api/models/toggle-pinned/{name}/{action}": {
775+ "put": {
776+ "description": "Pin or unpin a model. Pinned models stay loaded and are excluded from automatic eviction.",
777+ "tags": [
778+ "config"
779+ ],
780+ "summary": "Toggle model pinned status",
781+ "parameters": [
782+ {
783+ "type": "string",
784+ "description": "Model name",
785+ "name": "name",
786+ "in": "path",
787+ "required": true
788+ },
789+ {
790+ "type": "string",
791+ "description": "Action: 'pin' or 'unpin'",
792+ "name": "action",
793+ "in": "path",
794+ "required": true
795+ }
796+ ],
797+ "responses": {
798+ "200": {
799+ "description": "OK",
800+ "schema": {
801+ "$ref": "#/definitions/localai.ModelResponse"
802+ }
803+ },
804+ "400": {
805+ "description": "Bad Request",
806+ "schema": {
807+ "$ref": "#/definitions/localai.ModelResponse"
808+ }
809+ },
810+ "404": {
811+ "description": "Not Found",
812+ "schema": {
813+ "$ref": "#/definitions/localai.ModelResponse"
814+ }
815+ },
816+ "500": {
817+ "description": "Internal Server Error",
818+ "schema": {
819+ "$ref": "#/definitions/localai.ModelResponse"
820+ }
821+ }
822+ }
823+ }
824+ },
774825 "/api/models/vram-estimate": {
775826 "post": {
776827 "description": "Estimates VRAM based on model weight files, context size, and GPU layers",
Original file line number Diff line number Diff line change 768768 }
769769 }
770770 },
771+ "/api/models/toggle-pinned/{name}/{action}" : {
772+ "put" : {
773+ "description" : " Pin or unpin a model. Pinned models stay loaded and are excluded from automatic eviction." ,
774+ "tags" : [
775+ " config"
776+ ],
777+ "summary" : " Toggle model pinned status" ,
778+ "parameters" : [
779+ {
780+ "type" : " string" ,
781+ "description" : " Model name" ,
782+ "name" : " name" ,
783+ "in" : " path" ,
784+ "required" : true
785+ },
786+ {
787+ "type" : " string" ,
788+ "description" : " Action: 'pin' or 'unpin'" ,
789+ "name" : " action" ,
790+ "in" : " path" ,
791+ "required" : true
792+ }
793+ ],
794+ "responses" : {
795+ "200" : {
796+ "description" : " OK" ,
797+ "schema" : {
798+ "$ref" : " #/definitions/localai.ModelResponse"
799+ }
800+ },
801+ "400" : {
802+ "description" : " Bad Request" ,
803+ "schema" : {
804+ "$ref" : " #/definitions/localai.ModelResponse"
805+ }
806+ },
807+ "404" : {
808+ "description" : " Not Found" ,
809+ "schema" : {
810+ "$ref" : " #/definitions/localai.ModelResponse"
811+ }
812+ },
813+ "500" : {
814+ "description" : " Internal Server Error" ,
815+ "schema" : {
816+ "$ref" : " #/definitions/localai.ModelResponse"
817+ }
818+ }
819+ }
820+ }
821+ },
771822 "/api/models/vram-estimate" : {
772823 "post" : {
773824 "description" : " Estimates VRAM based on model weight files, context size, and GPU layers" ,
Original file line number Diff line number Diff line change @@ -2241,6 +2241,41 @@ paths:
22412241 summary : Get dynamic autocomplete values for a config field
22422242 tags :
22432243 - config
2244+ /api/models/toggle-pinned/{name}/{action} :
2245+ put :
2246+ description : Pin or unpin a model. Pinned models stay loaded and are excluded
2247+ from automatic eviction.
2248+ parameters :
2249+ - description : Model name
2250+ in : path
2251+ name : name
2252+ required : true
2253+ type : string
2254+ - description : ' Action: '' pin'' or '' unpin'' '
2255+ in : path
2256+ name : action
2257+ required : true
2258+ type : string
2259+ responses :
2260+ " 200 " :
2261+ description : OK
2262+ schema :
2263+ $ref : ' #/definitions/localai.ModelResponse'
2264+ " 400 " :
2265+ description : Bad Request
2266+ schema :
2267+ $ref : ' #/definitions/localai.ModelResponse'
2268+ " 404 " :
2269+ description : Not Found
2270+ schema :
2271+ $ref : ' #/definitions/localai.ModelResponse'
2272+ " 500 " :
2273+ description : Internal Server Error
2274+ schema :
2275+ $ref : ' #/definitions/localai.ModelResponse'
2276+ summary : Toggle model pinned status
2277+ tags :
2278+ - config
22442279 /api/models/vram-estimate :
22452280 post :
22462281 consumes :
You can’t perform that action at this time.
0 commit comments