Every setting of a served model from the mirror page, and its replicas per profile
CI / test (push) Successful in 10m51s

The row of a served model leads to its card, which now changes its context
and longest answer, its cards, its replicas on each profile with a profile
on CPUs to add and its speed beside, stops, starts and restarts it, and
removes it with its files or without. Stopped on the row stops the model
rather than setting its scaling to nothing. The console gains Replicas per
profile, and ctl models shows the counts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Ilker ManapandClaude Opus 5.5 committed 2026-11-03 09:40:06 +01:00
1 parent e23732fbbb
commit 1a3f385be4
15 files changed
+721 -20

No files matched your search

+31
View File
@@ -108,6 +108,23 @@ type modelUse struct {
// Declared models are read from server.yaml on every start, so a mode
// changed here would revert; the page says where to change it instead.
Declared bool
// What its card changes beside: the context and longest answer, whether
// it is stopped, its profile on cards and the cards a replica takes.
ContextLength, MaxOutput int
Stopped bool
GPUProfile string
GPUs int
// Profiles are where its replicas run and, Split, how many on each.
Profiles []profileUse
Split bool
// CanCPU says a profile on CPUs can be added — a llama.cpp model with
// none — reserving CPUMemoryGB and NewCPUCores, answering about
// CPUSpeed tokens a second on CPUSpeedNode.
CanCPU bool
CPUMemoryGB int
NewCPUCores int
CPUSpeed float64
CPUSpeedNode string
}
// mirrorRow is one model version as the page shows it.
@@ -324,6 +341,18 @@ func (p *AccountPages) RegisterAdminMirror(mux *http.ServeMux, d MirrorDeps) {
if name == "" || (mode != modeAlways && mode != modeOnDemand && mode != modeStopped) {
return "", errors.New(l.T("mirror.err.choose_mode"))
}
// Stopped is the model kept as it was, and started again so:
// not its scaling set to nothing, which forgot what it was —
// and its replicas per profile with it.
if mode == modeStopped {
if _, err := d.Catalog.Stop(ctx, name, admin.Email); err != nil {
return "", err
}
return l.T("mirror.msg.stopped", name), nil
}
if _, err := d.Catalog.Start(ctx, name, admin.Email); err == nil && mode == modeAlways {
return l.T("mirror.msg.model_started", name), nil
}
replicas, _ := strconv.Atoi(r.FormValue("replicas"))
sc := scalingFor(mode, replicas, 0)
if _, err := d.Catalog.Scale(ctx, name, sc, admin.Email); err != nil {
@@ -339,6 +368,7 @@ func (p *AccountPages) RegisterAdminMirror(mux *http.ServeMux, d MirrorDeps) {
}))
mux.HandleFunc("POST /admin/mirror/replicas", p.mirrorAction(m, p.setModel))
p.registerModelSettings(mux, m)
mux.HandleFunc("POST /admin/mirror/adapters", p.mirrorAction(m, p.setAdapters))
mux.HandleFunc("POST /admin/mirror/serve", p.mirrorAction(m,
@@ -565,6 +595,7 @@ func (p *AccountPages) renderMirror(w http.ResponseWriter, r *http.Request,
if len(m.Profiles) > 0 {
u.MemoryGB, u.CPUCores = m.Profiles[0].MinMemoryGB, m.Profiles[0].CPUCores
}
p.describeProfiles(&u, m, d.Rows[i].Status)
if v, ok := views[m.Name]; ok {
u.Fleet, u.Ready, u.Wanted = true, v.Ready, v.Desired
u.Parked, u.Unplaceable = v.Parked, v.Unplaceable