Canary of a model's newer weights: ctl model canary, promote and canaries, rolled back by itself when it serves worse

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 20:31:26 +02:00
1 parent 0a4076928a
commit a1dfd4df1d
13 files changed
+750 -18

No files matched your search

@@ -60,6 +60,8 @@ type updModels struct {
mu sync.Mutex
models map[string]catalog.Model
declared map[string]bool
// onAdd starts what is added, as the reconciler would.
onAdd func(catalog.Model)
}
func (c *updModels) Declared(n string) bool { return c.declared[n] }
@@ -79,6 +81,29 @@ func (c *updModels) SetOrigin(_ context.Context, n string, o *catalog.Origin) er
c.models[n] = m
return nil
}
func (c *updModels) Add(_ context.Context, m catalog.Model, _ string) error {
c.mu.Lock()
defer c.mu.Unlock()
c.models[m.Name] = m
if c.onAdd != nil {
c.onAdd(m)
}
return nil
}
func (c *updModels) Remove(_ context.Context, n string) error {
c.mu.Lock()
defer c.mu.Unlock()
delete(c.models, n)
return nil
}
func (c *updModels) SetCanary(_ context.Context, n string, cn *catalog.Canary, _ string) (catalog.Model, error) {
c.mu.Lock()
defer c.mu.Unlock()
m := c.models[n]
m.Canary = cn
c.models[n] = m
return m, nil
}
func (c *updModels) all() []catalog.Model {
c.mu.Lock()
defer c.mu.Unlock()