MCPcopy
hub / github.com/mudler/LocalAI / NewGalleryService

Function NewGalleryService

core/services/galleryop/service.go:60–71  ·  view source on GitHub ↗
(appConfig *config.ApplicationConfig, ml *model.ModelLoader)

Source from the content-addressed store, hash-verified

58}
59
60func NewGalleryService(appConfig *config.ApplicationConfig, ml *model.ModelLoader) *GalleryService {
61 return &GalleryService{
62 appConfig: appConfig,
63 ModelGalleryChannel: make(chan ManagementOp[gallery.GalleryModel, gallery.ModelConfig]),
64 BackendGalleryChannel: make(chan ManagementOp[gallery.GalleryBackend, any]),
65 modelLoader: ml,
66 modelManager: NewLocalModelManager(appConfig, ml),
67 backendManager: NewLocalBackendManager(appConfig, ml),
68 statuses: make(map[string]*OpStatus),
69 cancellations: make(map[string]context.CancelFunc),
70 }
71}
72
73// SetModelManager replaces the model manager (e.g. with a distributed implementation).
74func (g *GalleryService) SetModelManager(m ModelManager) {

Calls 2

NewLocalModelManagerFunction · 0.85
NewLocalBackendManagerFunction · 0.85

Tested by

no test coverage detected