Track the registry's new weights for served models, and move a model to them or back

A model served from the registry records its origin: repository, commit and
each file's checksum; one served before is worked out from the mirror's
record of where it fetched the file. Every mirror.update_check (6h) the
control plane asks whether those files changed there. ctl model updates
lists it, ctl model update fetches beside the old files, checks, swaps and
replaces replicas one at a time, ctl model rollback goes back. The console
shows it on Models and offers the same.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ilker ManapandClaude Opus 5.5 committed 2026-10-04 00:12:20 +02:00
1 parent a96b1a54b2
commit 44425193bd
15 files changed
+1393 -33

No files matched your search

+32
View File
@@ -288,6 +288,38 @@ func (s *Service) SetAdapters(ctx context.Context, name string, adapters []catal
return final, err
}
// SetSource moves a model added at runtime to other weights, recording where
// they came from. Running replicas keep what they loaded until they are
// replaced; the caller restarts them.
func (s *Service) SetSource(ctx context.Context, name, source string, origin *catalog.Origin, by string) (catalog.Model, error) {
final, err := s.update(ctx, name, by, "change its source", func(m *catalog.Model) error {
m.Source, m.Origin = source, origin
return nil
})
if err == nil {
rev := ""
if origin != nil {
rev = origin.Revision
}
s.log.Info("model source set", "model", name, "source", source, "revision", rev, "by", by)
}
return final, err
}
// SetOrigin records where a model's weights came from without changing them:
// for a model added before origins were kept. A model from configuration is
// left alone, its origin worked out again when it is needed.
func (s *Service) SetOrigin(ctx context.Context, name string, origin *catalog.Origin) error {
if s.Declared(name) {
return nil
}
_, err := s.update(ctx, name, "llmgw", "record its origin", func(m *catalog.Model) error {
m.Origin = origin
return nil
})
return err
}
// update changes one model added at runtime and keeps the change.
//
// Built before anything is written, like Add: catalog.New is what applies the