okami.mom/strata

git clone https://git.nkp.pet/okami.mom/strata

Niko1221Merge f-ds-out ac306afb2 into f-own-intaff3a132f

main
1.0 KiB20 linesraw
1/**
2 * Which remembered model the host starts by itself when it comes up (STRATA_REAL_ENGINE=1): the one loaded last, else the current one.
3 * A remembered DeepSeek model (Strata 0.2.13 and earlier; strata_control/retired.py) is not started: the approved refusal goes to the host
4 * log, as every autostart failure does, and nothing is written - the remembered value stays in the settings file exactly as it was.
5 */
6export const DEEPSEEK_ID = /deepseek/i;
7
8export function refusalLine(id) {
9  return `autostart failed: ${id} is a DeepSeek model. This version of Strata no longer runs DeepSeek models, so it was not started.`;
10}
11
12/** The model id to start, or null. Reads `state` only; `log` gets the refusal line for a DeepSeek id. */
13export function autostartModel(state, env = process.env, log = (line) => console.error(line)) {
14  const id = env.STRATA_REAL_ENGINE === '1' ? (state?.loaded ?? state?.current ?? null) : null;
15  if (id && DEEPSEEK_ID.test(String(id))) {
16    log(refusalLine(id));
17    return null;
18  }
19  return id;
20}