models: stop batching first-paint reads through the engine (page was slow)

The /admin/api/batch aggregator fans every sub-path to the PRIMARY ENGINE. After
moving cache-stats/cached-models/downloads to the coderai-system worker and
settings to the front, batching them still sent them to the (busy) engine — so the
models page kept loading its data from the slow engine.

Those endpoints now route to fast targets (front + system worker), so the batch's
connection-saving no longer applies and was actually the bottleneck. The models
page now loads each first-paint read directly to its correct target: settings →
front, cache-stats/cached-models/downloads → coderai-system, only models/
quantize-status → engine. The main model cards come from cached-models (system
worker), so the list paints fast even mid-generation.
Co-Authored-By: 's avatarClaude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011DDv7BchtZQWsnPG6Jm49m
parent b9bf7b18
......@@ -2783,22 +2783,17 @@ setInterval(async () => {
if (sig !== _quantSig) { _quantSig = sig; loadCachedModels(); }
}, 5000);
// Collapse the first-paint engine reads into ONE batched request (fetched
// concurrently server-side by the front) so the page load doesn't fire ~10 calls
// that saturate the browser's per-host connection limit and freeze during a
// generation. pageFetch() in these loaders transparently serves from the bundle.
(async () => {
await bootstrapPage([
'/admin/api/settings', '/admin/api/cache-stats', '/admin/api/cached-models',
'/admin/api/models', '/admin/api/quantize-status', '/admin/api/downloads',
]);
loadGlobalSettings();
// Engine/card info first so per-model card tags render on first paint, then
// re-render once it resolves (covers the fetch resolving after the list).
_loadEngineInfo().then(() => loadCachedModels());
refreshLocal();
pollDownloads(); // one-shot; reuses the batched bundle
})();
// First-paint loads. These now hit fast targets directly: settings → the front,
// cache-stats/cached-models/downloads → the coderai-system worker, and only
// models/quantize-status → the engine. Since most are fast there's no need to
// batch them through the engine (which was actually dragging the page back onto
// the busy engine), so each call goes straight to its correct target.
loadGlobalSettings();
// Engine/card info first so per-model card tags render on first paint, then
// re-render once it resolves (covers the fetch resolving after the list).
_loadEngineInfo().then(() => loadCachedModels());
refreshLocal();
pollDownloads();
// Toggle the acceleration / TurboQuant sections as model types are checked/unchecked.
document.querySelectorAll('.cfg-type-cb').forEach(cb =>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment