Skip to content

Commit

Permalink
chore: drop embedded models (#4715)
Browse files Browse the repository at this point in the history
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 <mudler@localai.io>
  • Loading branch information
mudler authored Jan 29, 2025
1 parent 1656e1a commit 72e52c4
Show file tree
Hide file tree
Showing 39 changed files with 8 additions and 986 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -861,7 +861,7 @@ swagger:

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

## Documentation
docs/layouts/_default:
Expand Down
2 changes: 1 addition & 1 deletion core/application/startup.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func New(opts ...config.AppOption) (*Application, error) {
}
}

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

Expand Down
2 changes: 1 addition & 1 deletion core/cli/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func (mi *ModelsInstall) Run(ctx *cliContext.Context) error {
log.Info().Str("model", modelName).Str("license", model.License).Msg("installing model")
}

err = startup.InstallModels(galleries, "", mi.ModelsPath, !mi.DisablePredownloadScan, progressCallback, modelName)
err = startup.InstallModels(galleries, mi.ModelsPath, !mi.DisablePredownloadScan, progressCallback, modelName)
if err != nil {
return err
}
Expand Down
2 changes: 0 additions & 2 deletions core/cli/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ type RunCMD struct {

Galleries string `env:"LOCALAI_GALLERIES,GALLERIES" help:"JSON list of galleries" group:"models" default:"${galleries}"`
AutoloadGalleries bool `env:"LOCALAI_AUTOLOAD_GALLERIES,AUTOLOAD_GALLERIES" group:"models"`
RemoteLibrary string `env:"LOCALAI_REMOTE_LIBRARY,REMOTE_LIBRARY" default:"${remoteLibraryURL}" help:"A LocalAI remote library URL" group:"models"`
PreloadModels string `env:"LOCALAI_PRELOAD_MODELS,PRELOAD_MODELS" help:"A List of models to apply in JSON at start" group:"models"`
Models []string `env:"LOCALAI_MODELS,MODELS" help:"A List of model configuration URLs to load" group:"models"`
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"`
Expand Down Expand Up @@ -90,7 +89,6 @@ func (r *RunCMD) Run(ctx *cliContext.Context) error {
config.WithDynamicConfigDirPollInterval(r.LocalaiConfigDirPollInterval),
config.WithF16(r.F16),
config.WithStringGalleries(r.Galleries),
config.WithModelLibraryURL(r.RemoteLibrary),
config.WithCors(r.CORS),
config.WithCorsAllowOrigins(r.CORSAllowOrigins),
config.WithCsrf(r.CSRF),
Expand Down
8 changes: 0 additions & 8 deletions core/config/application_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ type ApplicationConfig struct {
DisableGalleryEndpoint bool
LoadToMemory []string

ModelLibraryURL string

Galleries []Gallery

BackendAssets embed.FS
Expand Down Expand Up @@ -126,12 +124,6 @@ func WithP2PToken(s string) AppOption {
}
}

func WithModelLibraryURL(url string) AppOption {
return func(o *ApplicationConfig) {
o.ModelLibraryURL = url
}
}

func WithLibPath(path string) AppOption {
return func(o *ApplicationConfig) {
o.LibPath = path
Expand Down
2 changes: 1 addition & 1 deletion core/services/gallery.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func (g *GalleryService) Start(c context.Context, cl *config.BackendConfigLoader
if op.GalleryModelName != "" {
err = gallery.InstallModelFromGallery(op.Galleries, op.GalleryModelName, g.appConfig.ModelPath, op.Req, progressCallback, g.appConfig.EnforcePredownloadScans)
} else if op.ConfigURL != "" {
err = startup.InstallModels(op.Galleries, op.ConfigURL, g.appConfig.ModelPath, g.appConfig.EnforcePredownloadScans, progressCallback, op.ConfigURL)
err = startup.InstallModels(op.Galleries, g.appConfig.ModelPath, g.appConfig.EnforcePredownloadScans, progressCallback, op.ConfigURL)
if err != nil {
updateError(err)
continue
Expand Down
126 changes: 0 additions & 126 deletions docs/content/docs/advanced/run-other-models.md

This file was deleted.

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


## Standard container images
Expand Down
72 changes: 0 additions & 72 deletions embedded/embedded.go

This file was deleted.

9 changes: 0 additions & 9 deletions embedded/model_library.yaml

This file was deleted.

13 changes: 0 additions & 13 deletions embedded/models/all-minilm-l6-v2.yaml

This file was deleted.

17 changes: 0 additions & 17 deletions embedded/models/animagine-xl.yaml

This file was deleted.

40 changes: 0 additions & 40 deletions embedded/models/bakllava.yaml

This file was deleted.

8 changes: 0 additions & 8 deletions embedded/models/bark.yaml

This file was deleted.

24 changes: 0 additions & 24 deletions embedded/models/cerbero.yaml

This file was deleted.

20 changes: 0 additions & 20 deletions embedded/models/codellama-7b-gguf.yaml

This file was deleted.

14 changes: 0 additions & 14 deletions embedded/models/codellama-7b.yaml

This file was deleted.

9 changes: 0 additions & 9 deletions embedded/models/coqui.yaml

This file was deleted.

31 changes: 0 additions & 31 deletions embedded/models/dolphin-2.5-mixtral-8x7b.yaml

This file was deleted.

Loading

0 comments on commit 72e52c4

Please sign in to comment.