-
-
Notifications
You must be signed in to change notification settings - Fork 3k
feat: Add backend gallery #5607
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
✅ Deploy Preview for localai ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
49199b6 to
f18108c
Compare
| if config.Alias != "" { | ||
| // Write an alias file inside | ||
| aliasFile := filepath.Join(backendPath, "alias") | ||
| if err := os.WriteFile(aliasFile, []byte(config.Alias), 0644); err != nil { |
Check failure
Code scanning / gosec
Expect WriteFile permissions to be 0600 or less Error
This PR add support to manage backends as similar to models. There is now available a backend gallery which can be used to install and remove extra backends. The backend gallery can be configured similarly as a model gallery, and API calls allows to install and remove new backends in runtime, and as well during the startup phase of LocalAI. Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
fe47de8 to
b57f399
Compare
| } | ||
|
|
||
| func (r *RunCMD) Run(ctx *cliContext.Context) error { | ||
| os.MkdirAll(r.BackendsPath, 0750) |
Check warning
Code scanning / gosec
Errors unhandled Warning
|
|
||
| func (r *RunCMD) Run(ctx *cliContext.Context) error { | ||
| os.MkdirAll(r.BackendsPath, 0750) | ||
| os.MkdirAll(r.ModelsPath, 0750) |
Check warning
Code scanning / gosec
Errors unhandled Warning
| "Title": "LocalAI - Backends", | ||
| "BaseURL": utils.BaseURL(c), | ||
| "Version": internal.PrintableVersion(), | ||
| "Backends": template.HTML(elements.ListBackends(backends, opcache, galleryService)), |
Check failure
Code scanning / gosec
The used method does not auto-escape HTML. This can potentially lead to 'Cross-site Scripting' vulnerabilities, in case the attacker controls the input. Error
| summary["NextPage"] = nextPage | ||
| summary["TotalPages"] = totalPages | ||
| summary["CurrentPage"] = pageNum | ||
| summary["Backends"] = template.HTML(elements.ListBackends(backends, opcache, galleryService)) |
Check failure
Code scanning / gosec
The used method does not auto-escape HTML. This can potentially lead to 'Cross-site Scripting' vulnerabilities, in case the attacker controls the input. Error
| "Title": "LocalAI - Models", | ||
| "BaseURL": utils.BaseURL(c), | ||
| "Version": internal.PrintableVersion(), | ||
| "Models": template.HTML(elements.ListModels(models, opcache, galleryService)), |
Check failure
Code scanning / gosec
The used method does not auto-escape HTML. This can potentially lead to 'Cross-site Scripting' vulnerabilities, in case the attacker controls the input. Error
| summary["NextPage"] = nextPage | ||
| summary["TotalPages"] = totalPages | ||
| summary["CurrentPage"] = pageNum | ||
| summary["Models"] = template.HTML(elements.ListModels(models, opcache, galleryService)) |
Check failure
Code scanning / gosec
The used method does not auto-escape HTML. This can potentially lead to 'Cross-site Scripting' vulnerabilities, in case the attacker controls the input. Error
| } | ||
|
|
||
| func ApplyGalleryFromFile(modelPath, s string, enforceScan bool, galleries []config.Gallery) error { | ||
| dat, err := os.ReadFile(s) |
Check failure
Code scanning / gosec
Potential file inclusion via variable Error
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
11968f3 to
672f467
Compare
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
672f467 to
2ba3899
Compare
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Signed-off-by: Ettore Di Giacinto <mudler@users.noreply.github.com>
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
8666e76 to
ed39960
Compare
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
ef1e957 to
1699c96
Compare
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
… reading ggufs with gguf-parser Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Description
This PR add support to manage backends as similar to models. There is now available a backend gallery which can be used to install and remove extra backends. The backend gallery can be configured similarly as a model gallery, and
API calls allows to install and remove new backends in runtime, and as well during the startup phase of LocalAI.
Users are encouraged, as with models, to create their own backend galleries. Backends are just standard OCI images which have packed all the bits to run a backend. Documentation is provided too.
Users can specify the path of backends with
--backends-pathor by using theLOCALAI_BACKENDS_PATHenvironment variable.--external-backendsorLOCALAI_EXTERNAL_BACKENDScan be set to a list of backends to load automatically on start. Finally,LOCALAI_BACKEND_GALLERIESor--backend-galleriescan be a json list of backend galleries, for example default is[{"name":"localai", "url":"github:mudler/LocalAI/backend/index.yaml@master"}].Fixes #3953
Notes for Reviewers
Not-exhaustive list of related tickets of backends that can be now implemented completely separately (yay!):
#5519
#1126
#5447
#5215
#4168
Signed commits