Skip to content

Commit daece67

Browse files
committed
chore: drop embedded models
Since the remote gallery was introduced this is now completely superseded by it. In order to keep the code clean and remove redudant parts let's simplify the usage. Signed-off-by: Ettore Di Giacinto <[email protected]>
1 parent 7f62b41 commit daece67

39 files changed

+8
-986
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -861,7 +861,7 @@ swagger:
861861

862862
.PHONY: gen-assets
863863
gen-assets:
864-
$(GOCMD) run core/dependencies_manager/manager.go embedded/webui_static.yaml core/http/static/assets
864+
$(GOCMD) run core/dependencies_manager/manager.go webui_static.yaml core/http/static/assets
865865

866866
## Documentation
867867
docs/layouts/_default:

core/application/startup.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ func New(opts ...config.AppOption) (*Application, error) {
6262
}
6363
}
6464

65-
if err := pkgStartup.InstallModels(options.Galleries, options.ModelLibraryURL, options.ModelPath, options.EnforcePredownloadScans, nil, options.ModelsURL...); err != nil {
65+
if err := pkgStartup.InstallModels(options.Galleries, options.ModelPath, options.EnforcePredownloadScans, nil, options.ModelsURL...); err != nil {
6666
log.Error().Err(err).Msg("error installing models")
6767
}
6868

core/cli/models.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ func (mi *ModelsInstall) Run(ctx *cliContext.Context) error {
100100
log.Info().Str("model", modelName).Str("license", model.License).Msg("installing model")
101101
}
102102

103-
err = startup.InstallModels(galleries, "", mi.ModelsPath, !mi.DisablePredownloadScan, progressCallback, modelName)
103+
err = startup.InstallModels(galleries, mi.ModelsPath, !mi.DisablePredownloadScan, progressCallback, modelName)
104104
if err != nil {
105105
return err
106106
}

core/cli/run.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ type RunCMD struct {
3232

3333
Galleries string `env:"LOCALAI_GALLERIES,GALLERIES" help:"JSON list of galleries" group:"models" default:"${galleries}"`
3434
AutoloadGalleries bool `env:"LOCALAI_AUTOLOAD_GALLERIES,AUTOLOAD_GALLERIES" group:"models"`
35-
RemoteLibrary string `env:"LOCALAI_REMOTE_LIBRARY,REMOTE_LIBRARY" default:"${remoteLibraryURL}" help:"A LocalAI remote library URL" group:"models"`
3635
PreloadModels string `env:"LOCALAI_PRELOAD_MODELS,PRELOAD_MODELS" help:"A List of models to apply in JSON at start" group:"models"`
3736
Models []string `env:"LOCALAI_MODELS,MODELS" help:"A List of model configuration URLs to load" group:"models"`
3837
PreloadModelsConfig string `env:"LOCALAI_PRELOAD_MODELS_CONFIG,PRELOAD_MODELS_CONFIG" help:"A List of models to apply at startup. Path to a YAML config file" group:"models"`
@@ -90,7 +89,6 @@ func (r *RunCMD) Run(ctx *cliContext.Context) error {
9089
config.WithDynamicConfigDirPollInterval(r.LocalaiConfigDirPollInterval),
9190
config.WithF16(r.F16),
9291
config.WithStringGalleries(r.Galleries),
93-
config.WithModelLibraryURL(r.RemoteLibrary),
9492
config.WithCors(r.CORS),
9593
config.WithCorsAllowOrigins(r.CORSAllowOrigins),
9694
config.WithCsrf(r.CSRF),

core/config/application_config.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ type ApplicationConfig struct {
4444
DisableGalleryEndpoint bool
4545
LoadToMemory []string
4646

47-
ModelLibraryURL string
48-
4947
Galleries []Gallery
5048

5149
BackendAssets embed.FS
@@ -126,12 +124,6 @@ func WithP2PToken(s string) AppOption {
126124
}
127125
}
128126

129-
func WithModelLibraryURL(url string) AppOption {
130-
return func(o *ApplicationConfig) {
131-
o.ModelLibraryURL = url
132-
}
133-
}
134-
135127
func WithLibPath(path string) AppOption {
136128
return func(o *ApplicationConfig) {
137129
o.LibPath = path

core/services/gallery.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ func (g *GalleryService) Start(c context.Context, cl *config.BackendConfigLoader
129129
if op.GalleryModelName != "" {
130130
err = gallery.InstallModelFromGallery(op.Galleries, op.GalleryModelName, g.appConfig.ModelPath, op.Req, progressCallback, g.appConfig.EnforcePredownloadScans)
131131
} else if op.ConfigURL != "" {
132-
err = startup.InstallModels(op.Galleries, op.ConfigURL, g.appConfig.ModelPath, g.appConfig.EnforcePredownloadScans, progressCallback, op.ConfigURL)
132+
err = startup.InstallModels(op.Galleries, g.appConfig.ModelPath, g.appConfig.EnforcePredownloadScans, progressCallback, op.ConfigURL)
133133
if err != nil {
134134
updateError(err)
135135
continue

docs/content/docs/advanced/run-other-models.md

Lines changed: 0 additions & 126 deletions
This file was deleted.

docs/content/docs/getting-started/container-images.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ The AIO Images are inheriting the same environment variables as the base images
143143
| Variable | Default | Description |
144144
| ---------------------| ------- | ----------- |
145145
| `PROFILE` | Auto-detected | The size of the model to use. Available: `cpu`, `gpu-8g` |
146-
| `MODELS` | Auto-detected | A list of models YAML Configuration file URI/URL (see also [running models]({{%relref "docs/advanced/run-other-models" %}})) |
146+
| `MODELS` | Auto-detected | A list of models YAML Configuration file URI/URL (see also [running models]({{%relref "docs/getting-started/models" %}})) |
147147

148148

149149
## Standard container images

embedded/embedded.go

Lines changed: 0 additions & 72 deletions
This file was deleted.

embedded/model_library.yaml

Lines changed: 0 additions & 9 deletions
This file was deleted.

embedded/models/all-minilm-l6-v2.yaml

Lines changed: 0 additions & 13 deletions
This file was deleted.

embedded/models/animagine-xl.yaml

Lines changed: 0 additions & 17 deletions
This file was deleted.

embedded/models/bakllava.yaml

Lines changed: 0 additions & 40 deletions
This file was deleted.

embedded/models/bark.yaml

Lines changed: 0 additions & 8 deletions
This file was deleted.

embedded/models/cerbero.yaml

Lines changed: 0 additions & 24 deletions
This file was deleted.

embedded/models/codellama-7b-gguf.yaml

Lines changed: 0 additions & 20 deletions
This file was deleted.

embedded/models/codellama-7b.yaml

Lines changed: 0 additions & 14 deletions
This file was deleted.

embedded/models/coqui.yaml

Lines changed: 0 additions & 9 deletions
This file was deleted.

embedded/models/dolphin-2.5-mixtral-8x7b.yaml

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)