A model removed from the catalog is no longer wanted
CI / test (push) Successful in 10m18s

Removed and added again to give it a licence, qwen3-vl-8b came back loading
by itself: its name was still on the wanted list from before. A model that
leaves the catalog leaves the list too.

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-11 20:50:57 +02:00
1 parent 3858114ada
commit 3c626cdc96
2 files changed
+31

No files matched your search

@@ -482,6 +482,13 @@ func (r *Reconciler) stopReplicasOfRemovedModels(ctx context.Context) {
gone = append(gone, rep)
}
}
// And whether it was wanted: a model removed and added again, to change
// its entry, came back loading as if just asked for.
for model := range r.wanted {
if _, ok := cat.Resolve(model); !ok {
delete(r.wanted, model)
}
}
r.mu.Unlock()
for _, rep := range gone {
@@ -1337,6 +1337,30 @@ func TestAModelRemovedWhileRunningIsStopped(t *testing.T) {
}
}
func TestAnOnDemandModelRemovedAndAddedAgainIsNotLoadedUnasked(t *testing.T) {
// The VLM, removed and added again to give it a licence, came back
// loading on its own: still on the wanted list from before its removal.
h := newHarness(t, testModel(1), gpuNode("1", 4))
h.r.cat.Store(twoOnDemandModels(t))
h.r.Want("llama")
h.r.Reconcile(t.Context())
h.markReady()
only := mustResolve(t, h, "second")
without, err := catalog.New([]catalog.Model{only})
if err != nil {
t.Fatal(err)
}
h.r.cat.Store(without)
for range 3 {
h.r.Reconcile(t.Context())
}
h.r.cat.Store(twoOnDemandModels(t))
if n := h.r.baseFor(mustResolve(t, h, "llama")); n != 0 {
t.Errorf("added again, it wants %d replicas before anybody asked", n)
}
}
// --- on-demand loading and idle eviction ---
func onDemandModel(idle time.Duration) catalog.Model {