db87e014f2c53cdcf4c4e10c2d3cd41393ba3cb6
3
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
f3681b90c3 |
gui: the Agents page says a model's load by the picked model and in its picker (axelburks on Discord)
axelburks (Discord #feedback) could see a model's load only on its provider's page, too deep to judge which model to pick on the Agents page. A plugin's reported load (magpie.load) now shows there too, as the same quiet grey badge the provider page uses: - by the picked model in each agent's model row, before the chevron; - on each row of that row's model picker, after the speed. GET /api/model-loads (speeds.go) answers every fresh load (LoadFresh, 5 minutes) by "provider/model" lowercased, the ref /api/model-speeds uses: plugin.FreshLoads copies the fresh entries under one lock, and provider.ModelLoads keys them by magpie's provider id, the user's own listed id too (ModelIDs), with model@size falling back to its model as ModelLoad does. With no plugin reporting it is one lock and an empty map. The page reads it when a model picker opens and with the Agents page's 15s drift check, each throttled to once per 30s, and the drift read only while a row shows a magpie model. No new poll; /api/state and Option are unchanged. The core script stays under its budget (1,533,802) by shortening comments in the picker and agent-row code; no budget raised. The route is named in the CLI's route list (read-only, U) like model-speeds. Run at this head (rebased on origin/main b4073c06a; the rebase onto |
||
|
|
7503beee72 |
plugin, settings: a model's load goes past 100% for a vendor that queues (axelburks on Discord)
axelburks, on v0.1.2547: their vendor queues, so a model's load can be
past 100%, even 200%. magpie clamped every load to 100, and Busy models
last allowed 1-99 only.
- host.js reportLoad and plugin.noteLoads keep a load from 0 up. The
floor is still 0, null still clears it, and a sanity cap of 10000
(LOAD_MOST, plugin.LoadMost) keeps an absurd value from reaching the
UI or the trace.
- settings.BusyLoad takes 1 to 9999 (BusyLoadMost-1). The segment
choices stay Off/50/70/80/90, and a value set in settings.json (150)
shows as its own choice, as before.
- The editor's badge reads "180%". It is a badge, not a bar, so nothing
assumed 100 wide; the test checks it stays on one line.
- Docs: site plugins page (en, zh, ja) Values and Routing bullets, and
provider-plugins.md and gateway-routing.md.
Run on mote via mote-run, on origin/main 8d8df0639+ rebased:
- go test ./internal/plugin ./internal/gateway ./internal/settings -run
'ModelLoad|TestBusy' -v: all pass. TestPluginReportsModelLoad has
over:250 kept and huge:1e9 at 10000. TestBusyModelGoesBehind has 180
behind 120 at a threshold of 150, and 10000 refused.
- Broken by hand in a copy, with the old 100 clamps and the 99 limit:
TestPluginReportsModelLoad red ("ModelLoad(over) = 100; want 250"),
TestBusyModelGoesBehind red (150 refused).
- node --test model-load (with Queued 180% in every language, Chromium
and WebKit, 420 and 900, plus Over 150% picked at 420) and i18n-keys:
46/46 pass. go test ./internal/gui -run Budget: ok.
- gofmt -l: empty. GOOS=linux go vet -tags nogui and GOOS=windows go
vet on plugin, settings and gateway: ok.
Not run before the push (owner: push and tag first): go test ./... and
the whole GUI suite. They are queued on mote behind another session's
suite.
|
||
|
|
8d8df06399 |
plugin, gateway: a plugin reports its models' load, and busy models can go last (axelburks on Discord)
axelburks (Discord #feedback): an in-house vendor queues requests to
its busy models, and the plugin could only put the load in the model's
name, which changed only when magpie re-read the list.
- A provider plugin calls input.magpie.load(provider, {"<model id>":
0-100 | null}) whenever it likes, from its own timer. host.js
(reportLoad) clamps each number to 0-100, null clears a model, every
other value is dropped, at most 1000 a call, and it returns the count
taken. A provider that isn't a string or loads that isn't an object
throws a TypeError. It goes to Go as an unasked {event:"load"}.
- internal/plugin/load.go keeps each by provider and lowercased model
id. ModelLoad answers unknown once a load is older than LoadFresh
(5 minutes), never idle. model@size falls back to its model.
- The provider editor shows it by the model as a grey ctx badge
("87%", titled "87% busy now, as its plugin says").
- Settings > Network and sharing > Busy models last (settings.BusyLoad,
POST /api/settings/busy-load, Off by default, over 50/70/80/90% or
1-99 by hand): restLast puts a model reported over it behind the
ready candidates, ahead of the resting. The trace row has busy:<load>.
At a new turn affine moves a conversation off it (Why "busy",
busyBehind); within a turn it stays. after, readyForNew and leastHeld
skip it. Unknown load, a lone candidate, or all busy: nothing moves.
- Docs: site plugins page (en, zh, ja) "Model load" section and input
table; docs/subsystems provider-plugins.md and gateway-routing.md.
Run, all on mote via mote-run at a42736807's tree rebased on
origin/main
|