admin: surface CMF worker threads + GPU toggle in Settings

Expose the two speed knobs in the /admin Settings panel instead of TOML-only:
- [cmf].gpu (new) -> exports CMF_GPU=1 to the managed cortiq serve (Metal/wgpu).
  On Apple Silicon decode is memory-bandwidth bound so this is ~neutral for
  generation (helps prefill); off by default.
- [cmf].threads (added earlier) now has a UI number input.

- config.rs: CmfCfg.gpu bool (serde default false).
- cmf_runtime.rs: spawn_serve sets CMF_GPU=1 when gpu is on.
- admin/mod.rs: put_settings flags needs_restart on threads/gpu change (the
  server is spawned once at startup with those env vars).
- settings.js: threads input + gpu checkbox + save payload + speed hint.
- i18n en/ru: threads/gpu/speedNote keys (other locales fall back to en, as the
  whole cmf section already does there).
This commit is contained in:
infosave2007
2026-07-08 16:18:31 +03:00
parent 16a3e209b6
commit 0040efc948
6 changed files with 32 additions and 4 deletions
+8 -3
View File
@@ -655,9 +655,14 @@ async fn put_settings(State(state): State<SharedState>, Json(b): Json<SettingsBo
cfg.cache = v;
}
if let Some(v) = b.cmf {
// manage_server / local_model changes apply on restart (the server is
// spawned at startup); local_only / router routing apply immediately.
if v.manage_server != cfg.cmf.manage_server || v.local_model != cfg.cmf.local_model {
// manage_server / local_model / threads / gpu apply on restart (the server
// is spawned once at startup with those env vars); local_only / router
// routing apply immediately.
if v.manage_server != cfg.cmf.manage_server
|| v.local_model != cfg.cmf.local_model
|| v.threads != cfg.cmf.threads
|| v.gpu != cfg.cmf.gpu
{
needs_restart = true;
}
cfg.cmf = v;