Skip to content

Linger is An Open-Source Personal Agent That Runs Fully on Your PC. We aim to break Big Tech’s grip on AI by bringing powerful local AI to everyday computers through efficient model–harness co-design, so everyone can run their own.

fix(desktop): offer the local model only with the Pi runtime

claude-opus-5-5-medium97ec36ea41a6
diff --git a/apps/desktop/AGENTS.md b/apps/desktop/AGENTS.md
index b8928546..59ac56b1 100644
--- a/apps/desktop/AGENTS.md
+++ b/apps/desktop/AGENTS.md
@@ -125,6 +125,10 @@ Gateway and runs Agents. The daemon exits with the app.
`local-models` is the planned model served by Pi, shown with the model,
GPU, memory and download, plus the tool's caveat when it has one;
otherwise the named runtime, with the tool's reason for no local model.
+ Under Customize the local model runs only behind Pi: with another runtime
+ it is greyed (`aria-disabled`, still focusable), does not toggle, and says
+ "Local models are only available with the Pi runtime."; choosing another
+ runtime clears it, and choosing Pi offers it again.
When the tool reports local models blocked now (`stack.state:
"blocked-now"`: the model fits the hardware, but other programs hold the
memory it needs now; a tool before that field marks it by `basis:
diff --git a/apps/desktop/src/shell/setup-page.test.ts b/apps/desktop/src/shell/setup-page.test.ts
index 92ddd109..943b8d4b 100644
--- a/apps/desktop/src/shell/setup-page.test.ts
+++ b/apps/desktop/src/shell/setup-page.test.ts
@@ -429,6 +429,70 @@ describe("setup page Quick Install recommendation", () => {
"Recommended for this computer: Local model + Pi",
);
});
+ it("offers the local model only with the Pi runtime", async () => {
+ const { run } = await openPage(welcome(capable), "welcome");
+ // Quick Install follows the tool's pick: Pi with the local model.
+ expect($("plan-summary").textContent).toBe(
+ "Recommended for this computer: Local model + Pi",
+ );
+ $("local-customize").click();
+ const option = (value: string) =>
+ document.querySelector<HTMLButtonElement>(
+ `[data-plan="runtime"] [data-value="${value}"]`,
+ )!;
+ const local = $("local-model") as HTMLButtonElement;
+ expect(local.getAttribute("aria-disabled")).toBe("false");
+ expect(local.hasAttribute("aria-describedby")).toBe(false);
+ expect($("local-pi-only").hidden).toBe(true);
+ for (const runtime of ["codex", "claude"]) {
+ option(runtime).click();
+ // Greyed, still focusable, and it says why.
+ expect(local.getAttribute("aria-checked")).toBe("false");
+ expect(local.getAttribute("aria-disabled")).toBe("true");
+ expect(local.disabled).toBe(false);
+ expect(local.getAttribute("aria-describedby")).toBe("local-pi-only");
+ expect($("local-pi-only").hidden).toBe(false);
+ expect($("local-pi-only").textContent).toBe(
+ "Local models are only available with the Pi runtime.",
+ );
+ // Clicking or pressing it does not pick it, nor switch the runtime.
+ local.click();
+ expect(local.getAttribute("aria-checked")).toBe("false");
+ expect(option(runtime).getAttribute("aria-checked")).toBe("true");
+ }
+ // Pi alone: the local model is off until chosen again.
+ option("pi").click();
+ expect(local.getAttribute("aria-disabled")).toBe("false");
+ expect($("local-pi-only").hidden).toBe(true);
+ expect(local.getAttribute("aria-checked")).toBe("false");
+ local.click();
+ expect(local.getAttribute("aria-checked")).toBe("true");
+ $("local-install").click();
+ await vi.waitFor(() =>
+ expect(installed(run)).toEqual([{ op: "local.start", runtime: "local" }]),
+ );
+ });
+
+ it("keeps a held local model on hold with Pi and says Pi is needed otherwise", async () => {
+ await openPage(welcome(held), "welcome");
+ $("local-customize").click();
+ const local = $("local-model") as HTMLButtonElement;
+ // Codex is the tool's pick here.
+ expect(local.disabled).toBe(true);
+ expect($("local-pi-only").hidden).toBe(false);
+ document
+ .querySelector<HTMLButtonElement>(
+ '[data-plan="runtime"] [data-value="pi"]',
+ )!
+ .click();
+ expect($("local-pi-only").hidden).toBe(true);
+ expect(local.getAttribute("aria-disabled")).toBe("false");
+ // Pi does not lift the hold: the model still waits for free memory.
+ expect(local.disabled).toBe(true);
+ expect($("local-sub").textContent).toBe(
+ "On hold: close other programs, then Check again.",
+ );
+ });
});
describe("setup page download progress", () => {
diff --git a/apps/desktop/src/shell/setup.html b/apps/desktop/src/shell/setup.html
index f450c04d..ca546dff 100644
--- a/apps/desktop/src/shell/setup.html
+++ b/apps/desktop/src/shell/setup.html
@@ -392,6 +392,7 @@
cursor: pointer;
}
button:disabled,
+ button[aria-disabled="true"],
select:disabled {
opacity: 0.45;
cursor: not-allowed;
@@ -777,7 +778,7 @@
border-color 140ms ease,
background-color 140ms ease;
}
- .pick:hover:not(:disabled) {
+ .pick:hover:not(:disabled):not([aria-disabled="true"]) {
border-color: #c4c4bc;
}
.pick[aria-checked="true"] {
@@ -1396,7 +1397,10 @@
<div class="choice local" id="local-row" hidden>
<div class="text">
<strong>Local model</strong
- ><span class="sub" id="local-sub"></span>
+ ><span class="sub" id="local-sub"></span
+ ><span class="sub" id="local-pi-only" hidden
+ >Local models are only available with the Pi runtime.</span
+ >
</div>
<button
type="button"
@@ -1944,8 +1948,8 @@
: value.slice(0, 18) + "…" + value.slice(-27);
// Quick Install installs what the localmodels tool recommends for this
// computer once it has checked; until then (or when it cannot check)
- // the installer picks. The local model runs tasks through Pi, so
- // choosing it chooses Pi.
+ // the installer picks. The tool's local-models pick runs through Pi,
+ // so it implies Pi.
const defaults = () => {
const models = state.localServer.localModels;
const pick = models.state === "checked" && models.recommendation;
@@ -2348,6 +2352,9 @@
}
$("keys-note").textContent = "Applies when the installation runs.";
const shown = model || held;
+ const runtime =
+ plan.runtime === "recommended" ? recommended.runtime : plan.runtime;
+ const piOnly = !!shown && runtime !== "pi";
$("local-row").hidden = !shown;
$("local-model").hidden = !shown;
$("local-recheck").hidden = !held || !local.available;
@@ -2384,6 +2391,13 @@
String(plan.localModel),
);
$("local-model").disabled = busy || !model;
+ // The local model runs only behind Pi: with another runtime it
+ // stays focusable, greyed and says so, but does not toggle.
+ $("local-pi-only").hidden = !piOnly;
+ $("local-model").setAttribute("aria-disabled", String(piOnly));
+ if (piOnly)
+ $("local-model").setAttribute("aria-describedby", "local-pi-only");
+ else $("local-model").removeAttribute("aria-describedby");
}
$("runtime-sub").textContent = known
? "Recommended: " + RUNTIMES[recommended.runtime] + "."
@@ -2764,10 +2778,10 @@
run({ op: "local.recheck" }, "local-error"),
);
$("local-model").addEventListener("click", () => {
+ // Only Pi runs the local model; choose Pi first.
+ if ($("local-model").getAttribute("aria-disabled") === "true") return;
picked = true;
- plan = plan.localModel
- ? { ...plan, localModel: false }
- : { ...plan, runtime: "pi", localModel: true };
+ plan = { ...plan, localModel: !plan.localModel };
render();
});
$("open").addEventListener("click", () => run({ op: "finish" }));