feat: backend monitor shutdown endpoint, process based (#938)

This PR adds a new endpoint to the backend monitor section
`/backend/shutdown` which terminates the grpc process for the related
model.
This commit is contained in:
Dave 2023-08-23 12:38:37 -04:00 committed by GitHub
parent 901f0709c5
commit 10b0e13882
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 51 additions and 19 deletions

View file

@ -218,6 +218,7 @@ func App(opts ...options.AppOption) (*fiber.App, error) {
// Experimental Backend Statistics Module
backendMonitor := localai.NewBackendMonitor(cl, options) // Split out for now
app.Get("/backend/monitor", localai.BackendMonitorEndpoint(backendMonitor))
app.Post("/backend/shutdown", localai.BackendShutdownEndpoint(backendMonitor))
// models
app.Get("/v1/models", auth, openai.ListModelsEndpoint(options.Loader, cl))