forked from mudler/LocalAI
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
15e6f93
commit 826006a
Showing
2 changed files
with
34 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
[ | ||
{ | ||
"name": "OnlyTwoLT2", | ||
"desc": "Test Rule: Only allow 2 backends to be loaded at once, unload the least recently used if a 3rd request comes in", | ||
"salience": 10, | ||
"when": [ | ||
"Result.Action == ActionDefs.Blank", | ||
"LoadedModelCount <= 1" | ||
], | ||
"then": [ | ||
"Result.Action = ActionDefs.Continue", | ||
"Result.ModelName = RequestedModelName" | ||
] | ||
}, | ||
{ | ||
"name": "OnlyTwoGT2", | ||
"desc": "Test Rule: Only allow 2 backends to be loaded at once, unload the least recently used if a 3rd request comes in", | ||
"salience": 10, | ||
"when": [ | ||
"Result.Action == ActionDefs.Blank", | ||
"LoadedModelCount >= 2" | ||
], | ||
"then": [ | ||
"Log(\"Too many backends in use, unloading least recently used...\")", | ||
"LRU = LoadedModels[0].ModelName", | ||
"ModelLoader.ShutdownModel(LRU)", | ||
"Result.Action = ActionDefs.Continue", | ||
"Result.ModelName = RequestedModelName" | ||
] | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters