Skip to content

Commit 8f9a9cc

Browse files
committed
feat: Rework VRAM estimation and use known_usecases in gallery
Signed-off-by: Richard Palethorpe <io@richiejp.com>
1 parent a271c72 commit 8f9a9cc

28 files changed

Lines changed: 1487 additions & 372 deletions

core/application/startup.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import (
1717
"github.com/mudler/LocalAI/core/services/jobs"
1818
"github.com/mudler/LocalAI/core/services/nodes"
1919
"github.com/mudler/LocalAI/core/services/storage"
20+
"github.com/mudler/LocalAI/pkg/vram"
2021
coreStartup "github.com/mudler/LocalAI/core/startup"
2122
"github.com/mudler/LocalAI/internal"
2223

@@ -251,6 +252,10 @@ func New(opts ...config.AppOption) (*Application, error) {
251252
go uc.Run(options.Context)
252253
}
253254

255+
// Wire gallery generation counter into VRAM caches so they invalidate
256+
// when gallery data refreshes instead of using a fixed TTL.
257+
vram.SetGalleryGenerationFunc(gallery.GalleryGeneration)
258+
254259
if options.ConfigFile != "" {
255260
if err := application.ModelConfigLoader().LoadMultipleModelConfigsSingleFile(options.ConfigFile, configLoaderOpts...); err != nil {
256261
xlog.Error("error loading config file", "error", err)

0 commit comments

Comments
 (0)