MCPcopy
hub / github.com/mudler/LocalAI / Run

Method Run

core/cli/models.go:47–72  ·  view source on GitHub ↗
(ctx *cliContext.Context)

Source from the content-addressed store, hash-verified

45}
46
47func (ml *ModelsList) Run(ctx *cliContext.Context) error {
48 var galleries []config.Gallery
49 if err := json.Unmarshal([]byte(ml.Galleries), &galleries); err != nil {
50 xlog.Error("unable to load galleries", "error", err)
51 }
52
53 systemState, err := system.GetSystemState(
54 system.WithModelPath(ml.ModelsPath),
55 system.WithBackendPath(ml.BackendsPath),
56 )
57 if err != nil {
58 return err
59 }
60 models, err := gallery.AvailableGalleryModels(galleries, systemState)
61 if err != nil {
62 return err
63 }
64 for _, model := range models {
65 if model.Installed {
66 fmt.Printf(" * %s@%s (installed)\n", model.Gallery.Name, model.Name)
67 } else {
68 fmt.Printf(" - %s@%s\n", model.Gallery.Name, model.Name)
69 }
70 }
71 return nil
72}
73
74func (mi *ModelsInstall) Run(ctx *cliContext.Context) error {
75 systemState, err := system.GetSystemState(

Callers

nothing calls this directly

Calls 5

GetSystemStateFunction · 0.92
WithModelPathFunction · 0.92
WithBackendPathFunction · 0.92
AvailableGalleryModelsFunction · 0.92
ErrorMethod · 0.45

Tested by

no test coverage detected