| 1 | package boot |
| 2 | |
| 3 | import "reasonix/internal/config" |
| 4 | |
| 5 | func runtimeModelSettingsReader(root, modelName, modelRef string, settings *config.ModelRuntimeSettings) func() (string, error) { |
| 6 | return func() (string, error) { |
| 7 | current, err := config.LoadModelRuntimeSnapshot(root, modelName) |
| 8 | if err != nil { |
| 9 | return "", err |
| 10 | } |
| 11 | if err := settings.Apply(current, root); err != nil { |
| 12 | return "", err |
| 13 | } |
| 14 | return current.ModelRuntimeFingerprint(modelRef), nil |
| 15 | } |
| 16 | } |
| 17 | |
| 18 | func runtimeImageCapabilityReader(root, modelName, snapshot string, settings *config.ModelRuntimeSettings) func() bool { |
| 19 | return func() bool { |
| 20 | current, err := config.LoadForRootReadOnly(root) |
| 21 | if err == nil { |
| 22 | err = settings.Apply(current, root) |
| 23 | } |
| 24 | if err != nil { |
| 25 | return false |
| 26 | } |
| 27 | config.NormalizeLegacyMimoCustomProvidersForRefs(current, modelName) |
| 28 | return config.ModelCapabilitySnapshot(current, config.NewModelCapabilityResolver()) != snapshot |
| 29 | } |
| 30 | } |
| 31 |