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

Function loaderLookup

core/http/middleware/route_model_test.go:463–471  ·  view source on GitHub ↗

loaderLookup mirrors application.ModelConfigLookup — bridges the loader to the ModelConfigLookup signature ClassifierDeps wants.

(loader *config.ModelConfigLoader, appConfig *config.ApplicationConfig)

Source from the content-addressed store, hash-verified

461// loaderLookup mirrors application.ModelConfigLookup — bridges the
462// loader to the ModelConfigLookup signature ClassifierDeps wants.
463func loaderLookup(loader *config.ModelConfigLoader, appConfig *config.ApplicationConfig) ModelConfigLookup {
464 return func(name string) *config.ModelConfig {
465 cfg, err := loader.LoadModelConfigFileByNameDefaultOptions(name, appConfig)
466 if err != nil || cfg == nil {
467 return nil
468 }
469 return cfg
470 }
471}
472
473// writeChatMLClassifierModel writes a classifier model YAML that
474// mirrors the live arch-router-1.5b.yaml shipped at

Callers 1

Tested by

no test coverage detected