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.
test(local-models): map a real localmodels 0.1.0.dev38 library status
Dongdong Chen0de81d589fe3
diff --git a/apps/computer/local-daemon/internal/localmodels/status_test.go b/apps/computer/local-daemon/internal/localmodels/status_test.gonew file mode 100644index 00000000..e05ab33d--- /dev/null+++ b/apps/computer/local-daemon/internal/localmodels/status_test.go@@ -0,0 +1,69 @@+package localmodels++import (+ "encoding/json"+ "os"+ "slices"+ "testing"+ "time"+)++// testdata/library-status-dev38.json is what localmodels 0.1.0.dev38 printed+// for library status --json on a Linux computer with one GPU and nothing+// downloaded, with the GPU's UUID zeroed.+func TestMapStatusKeepsTheModelCardOfARealDev38Status(t *testing.T) {+ encoded, err := os.ReadFile("testdata/library-status-dev38.json")+ if err != nil {+ t.Fatal(err)+ }+ // A row with a load record also carries the prefill speed, as+ // round(prompt_tokens_per_second, 1); nothing here has been loaded.+ var document map[string]any+ if err := json.Unmarshal(encoded, &document); err != nil {+ t.Fatal(err)+ }+ rows := document["models"].([]any)+ moe := rows[2].(map[string]any)+ moe["state"], moe["pi_model"] = "idle", "localmodels-library/qwen3-6-35b-a3b"+ moe["tokens_per_second"], moe["prompt_tokens_per_second"] = 151.3, 2840.6+ encoded, err = json.Marshal(document)+ if err != nil {+ t.Fatal(err)+ }++ snapshot, err := mapStatus(encoded, time.Now())+ if err != nil {+ t.Fatal(err)+ }+ if snapshot.ToolVersion != "0.1.0.dev38" || len(snapshot.Models) != 4 {+ t.Fatalf("snapshot = %s, %d models", snapshot.ToolVersion, len(snapshot.Models))+ }+ dense := modelState(snapshot, "qwen3.8-27b:UD-Q4_K_M")+ if dense == nil || dense.Family != "qwen" || dense.Publisher != "Qwen" || dense.Architecture != "dense" ||+ dense.Parameters != "27B" || dense.ActiveParameters != "" || dense.License != "Apache-2.0" ||+ dense.SourceURL != "https://huggingface.co/unsloth/Qwen3.8-27B-GGUF" ||+ !slices.Equal(dense.Capabilities, []string{"vision"}) || !dense.Recommended {+ t.Fatalf("dense model = %+v", dense)+ }+ mixture := modelState(snapshot, "qwen3.6-35b-a3b:UD-Q4_K_M")+ if mixture == nil || mixture.Architecture != "moe" || mixture.Parameters != "35B" || mixture.ActiveParameters != "3B" ||+ mixture.PromptTokensPerSecond == nil || *mixture.PromptTokensPerSecond != 2840.6 ||+ mixture.TokensPerSecond == nil || *mixture.TokensPerSecond != 151.3 || mixture.Recommended {+ t.Fatalf("moe model = %+v", mixture)+ }++ // The snapshot sends the contract's names.+ sent, err := json.Marshal(mixture)+ if err != nil {+ t.Fatal(err)+ }+ var fields map[string]any+ if err := json.Unmarshal(sent, &fields); err != nil {+ t.Fatal(err)+ }+ for _, name := range []string{"family", "publisher", "architecture", "parameters", "active_parameters", "license", "source_url", "capabilities", "prompt_tokens_per_second"} {+ if _, ok := fields[name]; !ok {+ t.Errorf("snapshot model has no %s: %s", name, sent)+ }+ }+}diff --git a/apps/computer/local-daemon/internal/localmodels/testdata/library-status-dev38.json b/apps/computer/local-daemon/internal/localmodels/testdata/library-status-dev38.jsonnew file mode 100644index 00000000..8a235636--- /dev/null+++ b/apps/computer/local-daemon/internal/localmodels/testdata/library-status-dev38.json@@ -0,0 +1,136 @@+{+ "schema": "localmodels.library-status/v1",+ "tool_version": "0.1.0.dev38",+ "observed_at": "2026-11-17T20:37:38+00:00",+ "host": {+ "platform": "linux",+ "arch": "x86_64",+ "os_label": "Ubuntu 22.04.4 LTS",+ "engine_label": "llama.cpp b11370 · CUDA",+ "ram_total_bytes": 540599123968,+ "disk_free_bytes": 64756662272,+ "gpus": [+ {+ "index": 0,+ "uuid": "GPU-00000000-0000-0000-0000-000000000000",+ "name": "NVIDIA RTX PRO 6000 Blackwell Workstation Edition",+ "total_bytes": 102641958912,+ "free_bytes": 57470353408+ }+ ]+ },+ "pools": [+ {+ "id": "gpu:0",+ "total_bytes": 102641958912,+ "used_bytes": 45171605504,+ "holders": []+ },+ {+ "id": "system",+ "total_bytes": 432479299174,+ "used_bytes": 368425566208,+ "holders": []+ }+ ],+ "models": [+ {+ "id": "qwen3.8-27b:UD-Q4_K_M",+ "name": "Qwen3.8 27B (UD-Q4_K_M)",+ "description": "The best all-round model for agent work: strong with tools and code, reads images, and stays fast in long conversations.",+ "quant": "UD-Q4_K_M",+ "context_tokens": 200000,+ "vision": true,+ "download_bytes": 17395586656,+ "memory_bytes": 27467364919,+ "fit": "gpu",+ "recommended": true,+ "availability": {+ "downloadable": true+ },+ "pool": "gpu:0",+ "state": "absent",+ "family": "qwen",+ "publisher": "Qwen",+ "architecture": "dense",+ "parameters": "27B",+ "license": "Apache-2.0",+ "source_url": "https://huggingface.co/unsloth/Qwen3.8-27B-GGUF",+ "capabilities": ["vision"]+ },+ {+ "id": "qwen3.8-27b-iq3s:UD-IQ3_S",+ "name": "Qwen3.8 27B (UD-IQ3_S)",+ "description": "A smaller build of Qwen3.8 27B for 16 GB graphics cards and 32 GB Macs; reads images and answers nearly as well.",+ "quant": "UD-IQ3_S",+ "context_tokens": 200000,+ "vision": true,+ "download_bytes": 12972029536,+ "memory_bytes": 21205168695,+ "fit": "gpu",+ "recommended": false,+ "availability": {+ "downloadable": true+ },+ "pool": "gpu:0",+ "state": "absent",+ "family": "qwen",+ "publisher": "Qwen",+ "architecture": "dense",+ "parameters": "27B",+ "license": "Apache-2.0",+ "source_url": "https://huggingface.co/unsloth/Qwen3.8-27B-GGUF",+ "capabilities": ["vision"]+ },+ {+ "id": "qwen3.6-35b-a3b:UD-Q4_K_M",+ "name": "Qwen3.6 35B-A3B (UD-Q4_K_M)",+ "description": "A fast model for everyday agent tasks that reads images and handles long conversations.",+ "quant": "UD-Q4_K_M",+ "context_tokens": 200000,+ "vision": true,+ "download_bytes": 23566209952,+ "memory_bytes": 26700936177,+ "fit": "gpu",+ "recommended": false,+ "availability": {+ "downloadable": true+ },+ "pool": "gpu:0",+ "state": "absent",+ "family": "qwen",+ "publisher": "Qwen",+ "architecture": "moe",+ "parameters": "35B",+ "active_parameters": "3B",+ "license": "Apache-2.0",+ "source_url": "https://huggingface.co/unsloth/Qwen3.6-35B-A3B-MTP-GGUF",+ "capabilities": ["vision"]+ },+ {+ "id": "qwen3.6-35b-a3b:UD-IQ4_XS",+ "name": "Qwen3.6 35B-A3B (UD-IQ4_XS)",+ "description": "A fast model for everyday agent tasks that reads images and handles long conversations.",+ "quant": "UD-IQ4_XS",+ "context_tokens": 200000,+ "vision": true,+ "download_bytes": 19111859104,+ "memory_bytes": 22351442929,+ "fit": "gpu",+ "recommended": false,+ "availability": {+ "downloadable": true+ },+ "pool": "gpu:0",+ "state": "absent",+ "family": "qwen",+ "publisher": "Qwen",+ "architecture": "moe",+ "parameters": "35B",+ "active_parameters": "3B",+ "license": "Apache-2.0",+ "source_url": "https://huggingface.co/unsloth/Qwen3.6-35B-A3B-MTP-GGUF",+ "capabilities": ["vision"]+ }+ ]+}diff --git a/apps/web/src/features/local-models/local-models-page.test.tsx b/apps/web/src/features/local-models/local-models-page.test.tsxindex b0799be7..c34a95cc 100644--- a/apps/web/src/features/local-models/local-models-page.test.tsx+++ b/apps/web/src/features/local-models/local-models-page.test.tsx@@ -1,5 +1,6 @@import { QueryClient, QueryClientProvider } from "@tanstack/react-query";import {+ cleanup,fireEvent,render,screen,@@ -21,7 +22,14 @@ import { teamHubErrorResponse } from "@/test/teamhub-test-server";import { LocalModelsPage } from "./local-models-page";import type { LocalModelsView } from "./local-models-queries";-import { gb, gpuPool, labView, macView } from "./local-models-test-support";+import {+ gb,+ gpuPool,+ labView,+ localModel,+ macView,+ modelView,+} from "./local-models-test-support";const tenantId = "tenant-northstar";const viewPath =@@ -238,6 +246,54 @@ describe("LocalModelsPage", () => {);});+ it("marks the model the Computer recommends, whatever its fit", async () => {+ // localmodels recommends what its stack would install: on a small Mac a+ // ladder model, on a small card a fallback that runs from system memory.+ const absent = (+ id: string,+ name: string,+ fit: "system" | "unified",+ recommended: boolean,+ ) =>+ modelView(+ localModel({+ download_bytes: gb(2.6),+ family: "other",+ fit,+ id,+ name,+ pool: fit === "system" ? "system" : "unified",+ recommended,+ }),+ );+ const fixture = setup([+ macView({+ models: [+ absent("lfm3-1.7b:Q8_0", "LFM3 1.7B", "unified", false),+ absent("spark-x2.6-4b:Q4_K_M", "Spark-X2.6 4B", "unified", true),+ ],+ }),+ labView({+ computer: { ...labView().computer, computer_id: "computer-win" },+ models: [absent("qwen3.5-9b:Q4_K_M", "Qwen3.5 9B", "system", true)],+ }),+ ]);+ renderPage(fixture, "?computer=computer-mac");+ await findModels();+ expect(statuses()).toEqual([+ "Spark-X2.6 4B: Not downloaded · 2.6 GB · Recommended",+ "LFM3 1.7B: Not downloaded · 2.6 GB",+ ]);++ cleanup();+ renderPage(fixture, "?computer=computer-win");+ await waitFor(() =>+ expect(statuses()).toEqual([+ "Qwen3.5 9B: Not downloaded · 2.6 GB · Recommended",+ ]),+ );+ });+it("expands one row at a time to show a model's details", async () => {renderPage(setup());await findModels();