File size: 1,365 Bytes
7def60a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package core

import (
	"github.com/mudler/LocalAI/core/config"
	"github.com/mudler/LocalAI/core/services"
	"github.com/mudler/LocalAI/pkg/model"
)

// The purpose of this structure is to hold pointers to all initialized services, to make plumbing easy
// Perhaps a proper DI system is worth it in the future, but for now keep things simple.
type Application struct {

	// Application-Level Config
	ApplicationConfig *config.ApplicationConfig
	// ApplicationState *ApplicationState

	// Core Low-Level Services
	BackendConfigLoader *config.BackendConfigLoader
	ModelLoader         *model.ModelLoader

	// Backend Services
	// EmbeddingsBackendService      *backend.EmbeddingsBackendService
	// ImageGenerationBackendService *backend.ImageGenerationBackendService
	// LLMBackendService             *backend.LLMBackendService
	// TranscriptionBackendService *backend.TranscriptionBackendService
	// TextToSpeechBackendService  *backend.TextToSpeechBackendService

	// LocalAI System Services
	BackendMonitorService *services.BackendMonitorService
	GalleryService        *services.GalleryService
	LocalAIMetricsService *services.LocalAIMetricsService
	// OpenAIService         *services.OpenAIService
}

// TODO [NEXT PR?]: Break up ApplicationConfig.
// Migrate over stuff that is not set via config at all - especially runtime stuff
type ApplicationState struct {
}