mirror of
https://github.com/mudler/LocalAI.git
synced 2024-12-26 07:41:05 +00:00
44a7045732
This PR bundles together two unrelated features: 1. Model Gallery improvements - specifically, the ability to follow ".ref" gallery links (which I made up for this specific application) to an actual gallery yaml file (in order to have stable URLs) and the ability to load self-contained configurations, rather than always using a base.yaml + overrides. This is groundwork for my python-based huggingface scraper. 2. A while ago I introduced some Insomnia request templates for people to use. Unfortunately, Insomnia has decided to tank their product... So I've personally switched to using [bruno](https://github.com/usebruno/bruno/). Corresponding equivalent files that I use for my testing have been added. Just open the folder from bruno and everything will work. No import process required. --------- Signed-off-by: Ettore Di Giacinto <mudler@users.noreply.github.com> Co-authored-by: Ettore Di Giacinto <mudler@users.noreply.github.com>
25 lines
1.5 KiB
Go
25 lines
1.5 KiB
Go
package gallery
|
|
|
|
// GalleryModel is the struct used to represent a model in the gallery returned by the endpoint.
|
|
// It is used to install the model by resolving the URL and downloading the files.
|
|
// The other fields are used to override the configuration of the model.
|
|
type GalleryModel struct {
|
|
URL string `json:"url,omitempty" yaml:"url,omitempty"`
|
|
Name string `json:"name,omitempty" yaml:"name,omitempty"`
|
|
Description string `json:"description,omitempty" yaml:"description,omitempty"`
|
|
License string `json:"license,omitempty" yaml:"license,omitempty"`
|
|
URLs []string `json:"urls,omitempty" yaml:"urls,omitempty"`
|
|
Icon string `json:"icon,omitempty" yaml:"icon,omitempty"`
|
|
Tags []string `json:"tags,omitempty" yaml:"tags,omitempty"`
|
|
// config_file is read in the situation where URL is blank - and therefore this is a base config.
|
|
ConfigFile map[string]interface{} `json:"config_file,omitempty" yaml:"config_file,omitempty"`
|
|
// Overrides are used to override the configuration of the model located at URL
|
|
Overrides map[string]interface{} `json:"overrides,omitempty" yaml:"overrides,omitempty"`
|
|
// AdditionalFiles are used to add additional files to the model
|
|
AdditionalFiles []File `json:"files,omitempty" yaml:"files,omitempty"`
|
|
// Gallery is a reference to the gallery which contains the model
|
|
Gallery Gallery `json:"gallery,omitempty" yaml:"gallery,omitempty"`
|
|
// Installed is used to indicate if the model is installed or not
|
|
Installed bool `json:"installed,omitempty" yaml:"installed,omitempty"`
|
|
}
|