Serve and update models in the background from the console, and follow them under Jobs

The console starts a serve or update job over the admin API and stays,
instead of closing to follow the download. Jobs lists them with their
progress and steps; the sidebar counts those running. ctl model serve and
update take --detach; ctl jobs lists jobs and follows one.

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 01:27:02 +02:00
1 parent d311a3ca4a
commit e12996f7dd
12 files changed
+280 -34

No files matched your search

+15 -1
View File
@@ -20,6 +20,7 @@ import (
"gitea.mynodes.xyz/ilker/llmgw/internal/config"
"gitea.mynodes.xyz/ilker/llmgw/internal/control/adminapi"
"gitea.mynodes.xyz/ilker/llmgw/internal/control/catalog"
"gitea.mynodes.xyz/ilker/llmgw/internal/control/modelserve"
"gitea.mynodes.xyz/ilker/llmgw/internal/docgen"
"gitea.mynodes.xyz/ilker/llmgw/internal/hf"
"gitea.mynodes.xyz/ilker/llmgw/internal/settings"
@@ -39,6 +40,7 @@ const (
cUsage
cQuotas
cMirror
cJobs
cLogs
cAccounts
cKeys
@@ -55,7 +57,7 @@ const (
cCount
)
var consoleLabels = [cCount]string{"Overview", "Nodes", "GPUs", "Models", "Replicas", "Usage", "Quotas", "Mirror", "Logs", "Accounts", "API keys", "Organizations", "Manual",
var consoleLabels = [cCount]string{"Overview", "Nodes", "GPUs", "Models", "Replicas", "Usage", "Quotas", "Mirror", "Jobs", "Logs", "Accounts", "API keys", "Organizations", "Manual",
"server.yaml", "Add a node", "Replicate the store", "Serve a model", "Upgrade the cluster",
"Restart all replicas", "Back up now", "Leave"}
@@ -71,6 +73,7 @@ type consoleData struct {
nodes []adminapi.NodeView
models []adminapi.ModelView
replicas []adminapi.ReplicaView
jobs []modelserve.Job
err error
}
@@ -221,6 +224,7 @@ func (m consoleModel) fetch() tea.Cmd {
_ = c.get(ctx, "/api/v1/nodes", &d.nodes)
_ = c.get(ctx, "/api/v1/models", &d.models)
_ = c.get(ctx, "/api/v1/replicas", &d.replicas)
_ = c.get(ctx, "/api/v1/jobs", &d.jobs)
return consoleDataMsg(d)
}
}
@@ -448,6 +452,9 @@ func (m consoleModel) key(k tea.KeyMsg) (tea.Model, tea.Cmd) {
m.menuD = m.quotaMenu(m.quotas[m.row])
case cMirror:
m.menuD = m.mirrorMenu(m.mirrorGroups()[m.row])
case cJobs:
m.dialog = "error"
m.dialogTitle, m.dialogText = jobDialog(m.data.jobs[m.row])
case cServe:
return m, m.fetchRepo(m.hf.models[m.row].ID)
case cAccounts:
@@ -831,6 +838,8 @@ func (m consoleModel) rowCount() int {
return len(m.quotas)
case cMirror:
return len(m.mirrorGroups())
case cJobs:
return len(m.data.jobs)
case cServe:
return len(m.hf.models)
case cAccounts:
@@ -871,6 +880,9 @@ func (m consoleModel) View() string {
if i == cSettings {
label = filepathBase(m.file)
}
if n := runningJobs(m.data.jobs); i == cJobs && n > 0 {
label += fmt.Sprintf(" (%d)", n)
}
if i == cSettings && m.doc != nil && m.doc.Changed > 0 {
label += fmt.Sprintf(" (%d)", m.doc.Changed)
}
@@ -1060,6 +1072,8 @@ func (m consoleModel) panel() (title, body, keys string) {
return "Manual", d.list(pw, m.inPanel), keys
case cMirror:
return m.mirrorPanel(pw)
case cJobs:
return m.jobsPanel(pw)
case cServe:
return m.hfPanel(pw)
case cSettings: