@simplexai/localmodels-linux-x64 0.1.0-dev.44 → 0.1.0-dev.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/bootstrap.identity +1 -1
  2. package/bootstrap.sha256 +59 -63
  3. package/modules/localmodels/__init__.py +1 -1
  4. package/modules/localmodels/__main__.py +0 -1
  5. package/modules/localmodels/bifrost_checks.py +3 -127
  6. package/modules/localmodels/bifrost_clients.py +1 -1
  7. package/modules/localmodels/bifrost_config.py +2 -2
  8. package/modules/localmodels/bifrost_pi.py +1 -1
  9. package/modules/localmodels/budget.py +16 -1
  10. package/modules/localmodels/catalog.json +15 -50
  11. package/modules/localmodels/catalog_recipes.py +1 -1
  12. package/modules/localmodels/engines-strata-poly-0.1.45-poly.9.json +41 -1
  13. package/modules/localmodels/gateway.py +50 -15
  14. package/modules/localmodels/gateway_accept.py +8 -5
  15. package/modules/localmodels/gateway_bifrost.py +13 -12
  16. package/modules/localmodels/gateway_cli.py +5 -2
  17. package/modules/localmodels/gateway_requests.py +9 -2
  18. package/modules/localmodels/harness.py +38 -11
  19. package/modules/localmodels/harness_gateway.py +1 -1
  20. package/modules/localmodels/hosts.py +7 -20
  21. package/modules/localmodels/library_gateway.py +12 -9
  22. package/modules/localmodels/library_pricing.py +1 -5
  23. package/modules/localmodels/npm_transport.py +62 -54
  24. package/modules/localmodels/recommend.py +1 -1
  25. package/modules/localmodels/recommend_cli.py +2 -2
  26. package/modules/localmodels/remote_ops.py +14 -6
  27. package/modules/localmodels/remote_ops_download.py +1 -1
  28. package/modules/localmodels/remote_ops_verify.py +0 -33
  29. package/modules/localmodels/runtime_install.py +2 -1
  30. package/modules/localmodels/runtime_io.py +149 -34
  31. package/modules/localmodels/source_byok.py +6 -3
  32. package/modules/localmodels/source_cli.py +8 -1
  33. package/modules/localmodels/stack.py +1 -5
  34. package/modules/localmodels/stack_args.py +6 -8
  35. package/modules/localmodels/stack_binding.py +3 -3
  36. package/modules/localmodels/stack_compose.py +3 -8
  37. package/modules/localmodels/stack_events.py +2 -1
  38. package/modules/localmodels/stack_plan.py +1 -4
  39. package/modules/localmodels/stack_ports.py +0 -1
  40. package/modules/localmodels/stack_run.py +15 -30
  41. package/modules/localmodels/stack_suite.py +23 -46
  42. package/modules/localmodels/stack_summary.py +0 -1
  43. package/modules/localmodels/stack_try.py +3 -92
  44. package/modules/localmodels/stack_up.py +7 -3
  45. package/modules/localmodels/stack_update.py +5 -5
  46. package/modules/localmodels/stack_view_apply.py +1 -1
  47. package/modules/localmodels/stack_view_sandbox.py +0 -2
  48. package/modules/localmodels/stack_view_text.py +0 -1
  49. package/modules/localmodels/stack_view_words.py +0 -1
  50. package/modules/localmodels/suite.py +4 -7
  51. package/modules/localmodels/tui_dialogs.py +0 -1
  52. package/modules/localmodels/web/view/view.css +0 -3
  53. package/modules/{simplex_localmodels-0.1.0.dev44.dist-info → simplex_localmodels-0.1.0.dev45.dist-info}/METADATA +1 -1
  54. package/modules/{simplex_localmodels-0.1.0.dev44.dist-info → simplex_localmodels-0.1.0.dev45.dist-info}/RECORD +56 -60
  55. package/package.json +1 -1
  56. package/tool.json +1 -1
  57. package/modules/localmodels/bifrost_search.py +0 -66
  58. package/modules/localmodels/gateway_search.py +0 -223
  59. package/modules/localmodels/search-ddgs-9.16.1.txt +0 -222
  60. package/modules/localmodels/search_server.py +0 -474
  61. /package/modules/{simplex_localmodels-0.1.0.dev44.dist-info → simplex_localmodels-0.1.0.dev45.dist-info}/WHEEL +0 -0
  62. /package/modules/{simplex_localmodels-0.1.0.dev44.dist-info → simplex_localmodels-0.1.0.dev45.dist-info}/entry_points.txt +0 -0
  63. /package/modules/{simplex_localmodels-0.1.0.dev44.dist-info → simplex_localmodels-0.1.0.dev45.dist-info}/licenses/NOTICE +0 -0
  64. /package/modules/{simplex_localmodels-0.1.0.dev44.dist-info → simplex_localmodels-0.1.0.dev45.dist-info}/licenses/localmodels/HERMES-LICENSE +0 -0
@@ -3224,7 +3224,7 @@
3224
3224
  "2026-11-05-ornith-8gb-ab-local118",
3225
3225
  "2026-11-11-strata-poly-install-local118"
3226
3226
  ],
3227
- "memory_estimate_bytes": 21474836480,
3227
+ "memory_estimate_bytes": 9663676416,
3228
3228
  "files": [
3229
3229
  {
3230
3230
  "path": "Qwen3.6-35B-A3B-UD-Q3_K_M.gguf",
@@ -3259,7 +3259,7 @@
3259
3259
  "STRATA_ENGINE_READY_S": "1800"
3260
3260
  },
3261
3261
  "profile": {
3262
- "exe": "{engine_dir}/strata-poly",
3262
+ "exe": "{engine}",
3263
3263
  "args": [
3264
3264
  "--model",
3265
3265
  "{model}",
@@ -3272,7 +3272,9 @@
3272
3272
  "--vram-reserve-mib",
3273
3273
  "{vram_reserve_mib}",
3274
3274
  "--tail-skip",
3275
- "0"
3275
+ "0",
3276
+ "--ram-experts-mib",
3277
+ "6144"
3276
3278
  ],
3277
3279
  "cwd": "{deploy_dir}",
3278
3280
  "tokenizer": "{deploy_dir}/tokenizer",
@@ -3280,7 +3282,8 @@
3280
3282
  "display_name": "Qwen3.6-35B-A3B UD-Q3_K_M",
3281
3283
  "log": "{deploy_dir}/engine.log",
3282
3284
  "lib_dirs": [
3283
- "{engine_dir}"
3285
+ "{engine_dir}",
3286
+ "{engine_dir}/nvidia/cu13/bin/x86_64"
3284
3287
  ],
3285
3288
  "host": "127.0.0.1",
3286
3289
  "parallel": 1,
@@ -3300,7 +3303,7 @@
3300
3303
  ],
3301
3304
  "health_path": "/health",
3302
3305
  "verify_timeout_s": 1800,
3303
- "note": "Qwen3.6-35B-A3B UD-Q3_K_M on PolyStrata's strata-poly engine (0.1.45-poly.9) for 8 GB cards with 32 GB of memory: the engine fills the card with the experts it uses most and keeps the rest in host RAM, so a 35B model with 3B active runs where the weights do not fit. 64K window, one request at a time, --tail-skip 0 (upstream's default of 6 skips expert rows).\nSP9I (2026-11-11, this engine build, installed by stack apply into an 8 GB share of a 96 GB card): acceptance 9/9, whole-card peak 7626 MiB during a 59.5K-token prompt with this recipe's 1152 MiB reserve (8138 MiB with 640, too close to an 8 GB card's 8192), anonymous memory at most 2.7 GiB, 100 tok/s after the 59.5K prompt on server-class CPU and memory. No real 8 GB card or desktop CPU was measured; speed there will be lower (upstream: 42-46 tok/s after 64K on an RTX 4070 Laptop).\nIts memory is mostly page cache of the GGUF; the service ceiling bounds it, and --conversation-cache-mib auto parks idle conversations inside that ceiling.\nGreedy output is not bit-reproducible between requests: the split of experts between card and CPU follows use (SPOLY).\nText only: the picture reader (strata-vision) is not in the engine build, so image input is off for this recipe.",
3306
+ "note": "Qwen3.6-35B-A3B UD-Q3_K_M on PolyStrata's strata-poly engine (0.1.45-poly.9) for 8 GB cards with 32 GB of memory: the engine fills the card with the experts it uses most and keeps the rest in host RAM, so a 35B model with 3B active runs where the weights do not fit. 64K window, one request at a time, --tail-skip 0 (upstream's default of 6 skips expert rows).\nSP9I (2026-11-11, this engine build, installed by stack apply into an 8 GB share of a 96 GB card): acceptance 9/9, whole-card peak 7626 MiB during a 59.5K-token prompt with this recipe's 1152 MiB reserve (8138 MiB with 640, too close to an 8 GB card's 8192), anonymous memory at most 2.7 GiB, 100 tok/s after the 59.5K prompt on server-class CPU and memory. No real 8 GB card or desktop CPU was measured; speed there will be lower (upstream: 42-46 tok/s after 64K on an RTX 4070 Laptop).\n--ram-experts-mib 6144 holds 6 GiB of the experts outside VRAM in RAM and leaves the rest in the file cache. Measured 2026-11-20 on an RTX 4070 Laptop (8 GB) with 32 GB, Windows 11, this engine build started with this recipe's planned command: 2.9 GiB of experts in VRAM, 10.8 GiB outside; engine working set at most 7.6 GiB and private memory at most 10.0 GiB during a 64K-token prompt; the 9 GiB memory estimate Windows plans are priced by is that working set and the server's with a margin, since Windows prices against available physical memory; 52 tok/s in a short chat, 46 tok/s after the 64K prompt, 69 tok/s over a 1,024-token answer.\nIts memory is mostly page cache of the GGUF; the service ceiling bounds it, and --conversation-cache-mib auto parks idle conversations inside that ceiling.\nGreedy output is not bit-reproducible between requests: the split of experts between card and CPU follows use (SPOLY).\nText only: the picture reader (strata-vision) is not in the engine build, so image input is off for this recipe.",
3304
3307
  "quality": {
3305
3308
  "score": 35,
3306
3309
  "sources": [
@@ -3367,7 +3370,7 @@
3367
3370
  "STRATA_ENGINE_READY_S": "1800"
3368
3371
  },
3369
3372
  "profile": {
3370
- "exe": "{engine_dir}/strata-poly",
3373
+ "exe": "{engine}",
3371
3374
  "args": [
3372
3375
  "--model",
3373
3376
  "{model}",
@@ -3380,7 +3383,9 @@
3380
3383
  "--vram-reserve-mib",
3381
3384
  "{vram_reserve_mib}",
3382
3385
  "--tail-skip",
3383
- "0"
3386
+ "0",
3387
+ "--ram-experts-mib",
3388
+ "6144"
3384
3389
  ],
3385
3390
  "cwd": "{deploy_dir}",
3386
3391
  "tokenizer": "{deploy_dir}/tokenizer",
@@ -3388,7 +3393,8 @@
3388
3393
  "display_name": "Qwen3.6-35B-A3B UD-Q4_K_M",
3389
3394
  "log": "{deploy_dir}/engine.log",
3390
3395
  "lib_dirs": [
3391
- "{engine_dir}"
3396
+ "{engine_dir}",
3397
+ "{engine_dir}/nvidia/cu13/bin/x86_64"
3392
3398
  ],
3393
3399
  "host": "127.0.0.1",
3394
3400
  "parallel": 1,
@@ -3408,7 +3414,7 @@
3408
3414
  ],
3409
3415
  "health_path": "/health",
3410
3416
  "verify_timeout_s": 1800,
3411
- "note": "Qwen3.6-35B-A3B UD-Q4_K_M on PolyStrata's strata-poly engine (0.1.45-poly.9) for 12 GB cards with 32 GB of memory: the engine fills the card with the experts it uses most and keeps the rest in host RAM, so a 35B model with 3B active runs where the weights do not fit. 64K window, one request at a time, --tail-skip 0 (upstream's default of 6 skips expert rows).\nSP9I (2026-11-11, this engine build, installed by stack apply into a 12 GB share of a 96 GB card): acceptance 9/9 with this recipe's 1280 MiB reserve, whole-card peak 11682 MiB during a 59.5K-token prompt (11788 MiB with 1152, 12 MiB above the card less 512 MiB); cgroup peak up to 26.9 GB under a 28 GB ceiling, nearly all page cache, anonymous memory at most 2.7 GiB; 94-104 tok/s after the 59K prompt on server-class CPU and memory. No real 12 GB card or desktop CPU was measured.\nIts memory is mostly page cache of the GGUF; the service ceiling bounds it, and --conversation-cache-mib auto parks idle conversations inside that ceiling.\nGreedy output is not bit-reproducible between requests: the split of experts between card and CPU follows use (SPOLY).\nText only: the picture reader (strata-vision) is not in the engine build, so image input is off for this recipe.",
3417
+ "note": "Qwen3.6-35B-A3B UD-Q4_K_M on PolyStrata's strata-poly engine (0.1.45-poly.9) for 12 GB cards with 32 GB of memory: the engine fills the card with the experts it uses most and keeps the rest in host RAM, so a 35B model with 3B active runs where the weights do not fit. 64K window, one request at a time, --tail-skip 0 (upstream's default of 6 skips expert rows).\nSP9I (2026-11-11, this engine build, installed by stack apply into a 12 GB share of a 96 GB card): acceptance 9/9 with this recipe's 1280 MiB reserve, whole-card peak 11682 MiB during a 59.5K-token prompt (11788 MiB with 1152, 12 MiB above the card less 512 MiB); cgroup peak up to 26.9 GB under a 28 GB ceiling, nearly all page cache, anonymous memory at most 2.7 GiB; 94-104 tok/s after the 59K prompt on server-class CPU and memory. No real 12 GB card or desktop CPU was measured.\n--ram-experts-mib 6144 as in the Q3 recipe. Measured 2026-11-20 on an RTX 4090 D held to a 12 GB card's budget, Linux, this engine build started with this recipe's planned command in a 9 GiB cgroup: 7.1 GiB of experts in VRAM, 11.6 GiB outside; engine resident memory at most 7.9 GiB, anonymous memory at most 2.3 GiB; 33 tok/s in a short chat, 22 tok/s after a 64K-token prompt, 50 tok/s over a 1,024-token answer. The memory estimate and the service ceilings are unchanged.\nIts memory is mostly page cache of the GGUF; the service ceiling bounds it, and --conversation-cache-mib auto parks idle conversations inside that ceiling.\nGreedy output is not bit-reproducible between requests: the split of experts between card and CPU follows use (SPOLY).\nText only: the picture reader (strata-vision) is not in the engine build, so image input is off for this recipe.",
3412
3418
  "quality": {
3413
3419
  "score": 36,
3414
3420
  "sources": [
@@ -3854,47 +3860,6 @@
3854
3860
  },
3855
3861
  "note": "Kokoro-82M v1.0 FP32 ONNX (thewh1teagle/kokoro-onnx release model-files-v1.0, an export of hexgrad/Kokoro-82M) for debugging and tests: stack plan installs it only on --tts, never under --aux auto; not a product capability. tts_server.py serves OpenAI-style POST /v1/audio/speech (WAV only, 24 kHz mono, at most 2000 characters, one synthesis at a time) in the kokoro-tts-0.6.1.txt venv behind auth_proxy.py; 54 voices, z* through misaki's Chinese G2P, others through espeak-ng. FP32 is faster than INT8 on CPU (lab-12021 2026-10-16: RTF 0.55-0.57 at 2 threads vs 1.63). local-118 2026-10-27, 2 threads: 2.5 s English in 1.4 s, 2000 Chinese characters (408 s audio) in 177 s, peak RSS 1.77 GiB. Magpie has no /v1/audio/speech route, so clients call the service directly. Real stack apply --tts acceptance on lab-12021 2026-10-27 (evidence/2026-10-27-tts-stack-apply-lab12021); thread/load tuning on local-118 the same day: 2 threads holds for all lengths, 4 threads ~1.5x on long text but needs CPUQuota=400%, peak RSS 2037 MiB sits ~10 MiB under MemoryHigh=2G (evidence/2026-10-27-tts-kokoro-tuning-local118)."
3856
3862
  },
3857
- {
3858
- "id": "ddgs-search",
3859
- "task": "search",
3860
- "runtime": "ddgs-cpu",
3861
- "version": "9.16.1",
3862
- "repo": "deedy5/ddgs",
3863
- "revision": "v9.16.1",
3864
- "license": "MIT",
3865
- "license_url": "https://pypi.org/project/ddgs/9.16.1/",
3866
- "status": "candidate",
3867
- "tasks": [
3868
- "search"
3869
- ],
3870
- "evidence": [
3871
- "evidence/2026-10-31-search-ddgs-lab12021/REPORT.md"
3872
- ],
3873
- "memory_estimate_bytes": 104857600,
3874
- "venv": "search-ddgs-9.16.1.txt",
3875
- "venv_bytes": 52428800,
3876
- "alias": "ddgs",
3877
- "contract": "search",
3878
- "port": 18390,
3879
- "threads": 1,
3880
- "limits": {
3881
- "MemoryHigh": "100M",
3882
- "MemoryMax": "150M",
3883
- "CPUQuota": "100%"
3884
- },
3885
- "argv": [
3886
- "{engine}",
3887
- "-I",
3888
- "{search_server}",
3889
- "--host",
3890
- "127.0.0.1",
3891
- "--port",
3892
- "{port}"
3893
- ],
3894
- "health_path": "/health",
3895
- "files": [],
3896
- "note": "Free web search for Magpie, on by default in stack plan (--no-search leaves it out). search_server.py answers Magpie's searxng search API (GET /search?q=&format=json, SearXNG results) on loopback in the search-ddgs-9.16.1.txt venv, through ddgs with primp's browser TLS fingerprint: DuckDuckGo first, then yahoo, brave and mojeek, one engine at a time; an engine that failed rests 120 s. stack apply adds Magpie's own You.com search API (no key, 100 searches a day) after it: when the service answers 502 (no engine answered) Magpie asks You.com, and asks searxng first again next time (checked with Magpie 0.1.1296, 2026-10-31). No engine needs a key, so the service holds no secret, takes no API key and listens on 127.0.0.1 only; queries leave the computer for those engines. Plain HTTP clients get DuckDuckGo's anti-bot page from lab-12021, and ddgs itself is throttled after a burst (202 anti-bot page, brave 429), so results vary with the engines' rate limits. lab-12021 2026-10-31 (evidence/2026-10-31-search-ddgs-lab12021): stack apply installed and verified it (7 results via yahoo, 13 s; ~30 MB resident) and Magpie 3425 took it as its searxng API, but after a day of probing that IP every engine was throttled (2 of 5 searches answered), so it stays a candidate until results hold over time."
3897
- },
3898
3863
  {
3899
3864
  "id": "d3-edge-q8",
3900
3865
  "task": "decision",
@@ -17,7 +17,7 @@ SCHEMA_VERSION = 3
17
17
  STATUSES = ("candidate", "validated", "deprecated")
18
18
  PLATFORMS = ("linux", "darwin", "win32") # validated_on: Linux, Apple Silicon Macs, Windows
19
19
  EFFORT_LEVELS = ("low", "medium", "high") # reasoning_effort values a gateway may send, in order
20
- TASKS = tuple("llm vision decision embedding reranker stt tts search privacy-span".split())
20
+ TASKS = tuple("llm vision decision embedding reranker stt tts privacy-span".split())
21
21
  # Model-card families Linger's LocalModelFamily knows (its contract); "other" for the rest.
22
22
  FAMILIES = tuple("qwen gemma llama openai deepseek mistral phi glm kimi claude grok other".split())
23
23
  SCALE = r"[1-9][0-9]*(\.[0-9]+)?[BM]" # a parameter scale as a model's name states it: 27B, 1.7B
@@ -3,7 +3,7 @@
3
3
  "tag": "strata-poly-0.1.45-poly.9",
4
4
  "commit": "v0.1.45-poly.9",
5
5
  "source": "https://github.com/simplexai-labs/PolyStrata/releases/tag/v0.1.45-poly.9",
6
- "note": "PolyStrata 0.1.45-poly.9 (MIT, commit 83a7a332), built by this project on 2026-11-11 because upstream publishes only a Windows engine. The engine archive holds the strata-poly binary, PolyStrata's Python server (serve/) and tokenizer tool (tools/) as released, their licenses and BUILD.json; the second archive holds the CUDA 13.0.3 runtime libraries the binary loads (libcublas, libcublasLt, libcudart), under NVIDIA's license. Both unpack into one directory, which the service puts on LD_LIBRARY_PATH. Built in nvidia/cuda:13.0.3-devel-ubuntu22.04 without a GPU, with upstream's Windows release flags: -DSTRATA_PORTABLE=ON (AVX2 CPU baseline) and CUDA architectures 75, 80, 86, 89 and 120 (RTX 20, 30, 40 and 50 series). Needs an NVIDIA driver for CUDA 13.0 (580 or newer), glibc 2.34 and libstdc++ 12 (Ubuntu 22.04, Debian 12 or newer). The picture reader (strata-vision) is not built. Sources: PolyStrata tag archive sha256 eeeb605b..., llama.cpp 3cf03257 archive sha256 cbe23c59... (the full digests are in BUILD.json).",
6
+ "note": "PolyStrata 0.1.45-poly.9 (MIT, commit 83a7a332), built by this project on 2026-11-11 because upstream publishes only a Windows engine. The engine archive holds the strata-poly binary, PolyStrata's Python server (serve/) and tokenizer tool (tools/) as released, their licenses and BUILD.json; the second archive holds the CUDA 13.0.3 runtime libraries the binary loads (libcublas, libcublasLt, libcudart), under NVIDIA's license. Both unpack into one directory, which the service puts on LD_LIBRARY_PATH. Built in nvidia/cuda:13.0.3-devel-ubuntu22.04 without a GPU, with upstream's Windows release flags: -DSTRATA_PORTABLE=ON (AVX2 CPU baseline) and CUDA architectures 75, 80, 86, 89 and 120 (RTX 20, 30, 40 and 50 series). Needs an NVIDIA driver for CUDA 13.0 (580 or newer), glibc 2.34 and libstdc++ 12 (Ubuntu 22.04, Debian 12 or newer). The picture reader (strata-vision) is not built. Sources: PolyStrata tag archive sha256 eeeb605b..., llama.cpp 3cf03257 archive sha256 cbe23c59... (the full digests are in BUILD.json). The Windows build is upstream's own release zip (strata-poly.exe, CUDA 13.0, the same CUDA architectures), which holds no server: the tag archive beside it supplies serve/ and tools/, and NVIDIA's cuBLAS 13.0.2.14 wheel (the version upstream's setup.py installs on Windows) supplies cublas64_13.dll under nvidia/cu13/bin/x86_64, the directory the recipes' lib_dirs put on the engine's PATH.",
7
7
  "builds": [
8
8
  {
9
9
  "platform": "linux",
@@ -30,6 +30,46 @@
30
30
  "size_bytes": 422462968
31
31
  }
32
32
  ]
33
+ },
34
+ {
35
+ "platform": "win32",
36
+ "arch": "x64",
37
+ "backend": "cuda",
38
+ "min_cuda": "13.0",
39
+ "binary": "strata-poly.exe",
40
+ "assets": [
41
+ {
42
+ "name": "strata-poly-windows-x64-66af087edd486c6d.zip",
43
+ "url": "https://github.com/simplexai-labs/PolyStrata/releases/download/v0.1.45-poly.9/strata-poly-windows-x64-66af087edd486c6d.zip",
44
+ "sha256": "68b344cc4cbaa4afedbe292d3b26ad778801de2ac9c2fbc0cff531b58e4bae92",
45
+ "size_bytes": 170179677,
46
+ "npm_copy": {
47
+ "package": "@simplexai/engine-strata-poly-windows-x64-66af087edd486c6d",
48
+ "version": "0.0.0-sha256-68b344cc4cbaa4af"
49
+ }
50
+ },
51
+ {
52
+ "name": "polystrata-0.1.45-poly.9-source.tar.gz",
53
+ "url": "https://github.com/simplexai-labs/PolyStrata/archive/refs/tags/v0.1.45-poly.9.tar.gz",
54
+ "sha256": "eeeb605b26e7e5d06bf4990b1ed14d2f0ae857d9bc304243593561cd740d5505",
55
+ "size_bytes": 25580808,
56
+ "members": [
57
+ "serve/",
58
+ "tools/",
59
+ "LICENSE"
60
+ ],
61
+ "npm_copy": {
62
+ "package": "@simplexai/engine-polystrata-0.1.45-poly.9-source",
63
+ "version": "0.0.0-sha256-eeeb605b26e7e5d0"
64
+ }
65
+ },
66
+ {
67
+ "name": "nvidia_cublas-13.0.2.14-py3-none-win_amd64.whl",
68
+ "url": "https://files.pythonhosted.org/packages/f3/91/bda39230b7a4c102bb724c21b50823efc63544490a885fea0b604911c0ab/nvidia_cublas-13.0.2.14-py3-none-win_amd64.whl",
69
+ "sha256": "5f7a90456b1392db60e28719547ba6e00696bfa81304b6887cf287f9edf2c1d7",
70
+ "size_bytes": 401887280
71
+ }
72
+ ]
33
73
  }
34
74
  ]
35
75
  }
@@ -8,6 +8,7 @@ from __future__ import annotations
8
8
  import http.client
9
9
  import json
10
10
  import os
11
+ import re
11
12
  import secrets
12
13
  import shutil
13
14
  import subprocess
@@ -15,7 +16,7 @@ import time
15
16
  from collections.abc import Callable
16
17
  from http.cookies import SimpleCookie
17
18
  from pathlib import Path
18
- from typing import TypedDict
19
+ from typing import Literal, TypedDict
19
20
 
20
21
  from localmodels import (
21
22
  gateway_accept,
@@ -34,12 +35,8 @@ from localmodels import (
34
35
  from localmodels.contracts import decode
35
36
  from localmodels.gateway_requests import PI_ACCEPT_FLAGS as PI_ACCEPT_FLAGS
36
37
  from localmodels.gateway_requests import AuxEndpoint as AuxEndpoint
38
+ from localmodels.gateway_requests import Check as Check
37
39
  from localmodels.gateway_requests import post as _post
38
- from localmodels.gateway_search import SEARCH as SEARCH
39
- from localmodels.gateway_search import Check as Check
40
- from localmodels.gateway_search import search_url as search_url
41
- from localmodels.gateway_search import unwire as unwire_search
42
- from localmodels.gateway_search import wire_search
43
40
  from localmodels.harness import (
44
41
  Endpoint,
45
42
  GatewayPlan,
@@ -69,7 +66,7 @@ AUX_PROVIDERS = {
69
66
  "rerank": "localmodels-rerank",
70
67
  "stt": "localmodels-stt",
71
68
  }
72
- WIRED = (*AUX_PROVIDERS, SEARCH)
69
+ WIRED = tuple(AUX_PROVIDERS)
73
70
  FOUNDATION_PROVIDERS = {
74
71
  AUX_PROVIDERS["embedding"],
75
72
  AUX_PROVIDERS["rerank"],
@@ -410,13 +407,6 @@ def wire(
410
407
  )
411
408
  hosts.own_gateway(tools_dir, "rule", gw["intent"])
412
409
  done.append(f"rule intent → {llm_model}:{hard} (classifier {classifier})")
413
- for ep in aux:
414
- if ep["contract"] == SEARCH:
415
- try:
416
- done += wire_search(plan, search_url(ep))
417
- except HarnessError as exc: # acceptance's search check reports it as failed
418
- done.append(f"search not wired: {exc}")
419
-
420
410
  if select_pi:
421
411
  done.append(point_pi(plan, gw["pi_model_before"], f"group/{gw['group']}"))
422
412
  done += gateway_clients.wire(plan)
@@ -565,10 +555,55 @@ def _unwire_magpie(
565
555
  gone = _magpie(target, "provider", pid, timeout=20).returncode != 0
566
556
  if gone or run(f"provider rm {pid}", "provider", "rm", pid):
567
557
  hosts.own_listed(tools_dir, "providers", pid, False)
568
- results += unwire_search(target, gw.get("search"), bool(gw.get("search_you")), tools_dir)
558
+ results += _unwire_search(target, gw.get("search"), bool(gw.get("search_you")), tools_dir)
569
559
  return results + gateway_keys.remove(target, caller_keys, tools_dir)
570
560
 
571
561
 
562
+ def _search_apis(plan: ToolPlan) -> dict[str, str]:
563
+ """Magpie's search APIs as {api: URL}. ``magpie search`` lists one per line, as
564
+ ``N. SearXNG no key <url> [off]`` or ``N. You.com no key``; the api is the name's first
565
+ word in lower case (``you``)."""
566
+ out = _magpie(plan, "search", timeout=20)
567
+ if out.returncode != 0:
568
+ raise HarnessError(f"magpie search failed (exit {out.returncode})")
569
+ found: dict[str, str] = {}
570
+ for line in out.stdout.splitlines():
571
+ match = re.match(r"\s*\d+\.\s+(\S+)(.*)$", line)
572
+ if match:
573
+ url = next((w for w in match.group(2).split() if w.startswith("http")), "")
574
+ found[match.group(1).split(".")[0].lower()] = url
575
+ return found
576
+
577
+
578
+ def _unwire_search(plan: ToolPlan, url: str | None, you: bool, tools_dir: str) -> list[Check]:
579
+ """Take out the searxng and You.com search APIs the manifest says this tool added to Magpie
580
+ for the web search service the stack used to run. A searxng someone has pointed elsewhere
581
+ since is theirs now, and only the manifest forgets it."""
582
+ if not (url or you):
583
+ return []
584
+ try:
585
+ listed = _search_apis(plan)
586
+ except HarnessError as exc:
587
+ return [{"check": "search rm", "ok": False, "detail": str(exc)}]
588
+ entries: list[tuple[str, bool, Literal["search", "search_you"]]] = []
589
+ if url:
590
+ entries.append(("searxng", listed.get("searxng") == url, "search"))
591
+ if you:
592
+ entries.append(("you", "you" in listed, "search_you"))
593
+ checks: list[Check] = []
594
+ for api, ours, field in entries:
595
+ if ours:
596
+ out = _magpie(plan, "search", "rm", api, timeout=60)
597
+ detail = " ".join((out.stdout + out.stderr).split())[-200:]
598
+ checks.append(
599
+ {"check": f"search rm {api}", "ok": out.returncode == 0, "detail": detail}
600
+ )
601
+ if out.returncode != 0:
602
+ continue
603
+ hosts.forget_search(tools_dir, field)
604
+ return checks
605
+
606
+
572
607
  # ---------------------------------------------------------------------------- acceptance
573
608
 
574
609
 
@@ -14,8 +14,14 @@ from typing import Any
14
14
 
15
15
  from localmodels import gateway_clients, harness, harness_gateway
16
16
  from localmodels.contracts import decode
17
- from localmodels.gateway_requests import PI_ACCEPT_FLAGS, AuxEndpoint, aux_answer, post, text
18
- from localmodels.gateway_search import SEARCH, Check, search_checks, search_url
17
+ from localmodels.gateway_requests import (
18
+ PI_ACCEPT_FLAGS,
19
+ AuxEndpoint,
20
+ Check,
21
+ aux_answer,
22
+ post,
23
+ text,
24
+ )
19
25
  from localmodels.harness import HarnessPlan, ToolPlan
20
26
  from localmodels.remote_ops import DECISION_QUESTION, DECISION_STATE, TOUCH_EXPECT, TOUCH_PROMPT
21
27
 
@@ -158,9 +164,6 @@ def accept(
158
164
  f"Magpie routing calls to {decider}: {before} → {after}",
159
165
  )
160
166
  for ep in aux:
161
- if ep["contract"] == SEARCH:
162
- checks += search_checks(plan, search_url(ep), timeout)
163
- continue
164
167
  pid = aux_providers[ep["contract"]]
165
168
  name = f"gateway {ep['contract']} {pid}/{ep['model']}"
166
169
  before = calls_fn(plan, pid, None)
@@ -17,7 +17,6 @@ from typing import Any
17
17
 
18
18
  from localmodels import (
19
19
  bifrost_datasheet,
20
- bifrost_search,
21
20
  bifrost_unit,
22
21
  gateway_home,
23
22
  gateway_keys,
@@ -43,8 +42,7 @@ from localmodels.bifrost_config import render_config as render_config
43
42
  from localmodels.bifrost_config import write_config as write_config
44
43
  from localmodels.bifrost_provider import origin as origin
45
44
  from localmodels.bifrost_unit import unit, unit_file, unit_for
46
- from localmodels.gateway_requests import AuxEndpoint
47
- from localmodels.gateway_search import Check
45
+ from localmodels.gateway_requests import AuxEndpoint, Check
48
46
  from localmodels.harness import (
49
47
  HarnessError,
50
48
  HarnessPlan,
@@ -53,6 +51,7 @@ from localmodels.harness import (
53
51
  ToolPlan,
54
52
  ToolState,
55
53
  )
54
+ from localmodels.runtime_io import Event
56
55
 
57
56
  _write_config = write_config
58
57
 
@@ -167,8 +166,14 @@ def adopt(
167
166
  seen["files"] = stack_clients.config_files(name, environment)
168
167
 
169
168
 
170
- def install_binary(tools_dir: Path, action: ToolAction, log: Callable[[str], None]) -> str | None:
171
- """Put the pinned binary at its planned path; returns its directory when this call made it."""
169
+ def install_binary(
170
+ tools_dir: Path,
171
+ action: ToolAction,
172
+ log: Callable[[str], None],
173
+ event: Event = lambda _: None,
174
+ ) -> str | None:
175
+ """Put the pinned binary at its planned path; returns its directory when this call made it.
176
+ ``event`` receives its download events."""
172
177
  target = Path(os.path.expanduser(action["path"]))
173
178
  artifact = action["artifacts"][0]
174
179
  if target.exists():
@@ -176,7 +181,7 @@ def install_binary(tools_dir: Path, action: ToolAction, log: Callable[[str], Non
176
181
  log(f"Bifrost {action['version']} already at {target}, reused")
177
182
  return None
178
183
  raise HarnessError(f"{target} exists and is not the pinned version; not overwritten")
179
- archive = harness._fetch(tools_dir, artifact, log)
184
+ archive = harness._fetch(tools_dir, artifact, log, event)
180
185
  target.parent.mkdir(parents=True, exist_ok=True)
181
186
  staging = target.with_name(f".{target.name}.tmp")
182
187
  staging.unlink(missing_ok=True)
@@ -476,7 +481,7 @@ def wire(
476
481
  ) -> list[str]:
477
482
  """Write the plan's config, (re)start the instance when it changed and point pi and the
478
483
  native clients at ``localmodels-agent``. A re-sync (``select_pi=False``) changes only the
479
- gateway, and keeps the providers it does not manage and the search it injects."""
484
+ gateway, and keeps the providers it does not manage."""
480
485
  gw = plan["gateway"]
481
486
  record = require_target(plan) or _record(plan, _gateway(plan)["action"])
482
487
  app = Path(record["app_dir"])
@@ -489,10 +494,9 @@ def wire(
489
494
  *AUX_PROVIDERS.values(),
490
495
  }
491
496
  managed -= {AUX_PROVIDERS["stt"]}
492
- current = (written := read_config(app)).get("providers")
497
+ current = read_config(app).get("providers")
493
498
  if isinstance(current, dict):
494
499
  keep = {k: v for k, v in current.items() if k not in managed}
495
- aux = bifrost_search.kept(aux, written)
496
500
  fast_key = None
497
501
  if gw.get("llm_fast"):
498
502
  try:
@@ -504,9 +508,6 @@ def wire(
504
508
  config = render(
505
509
  gw, llm_key, decision_key, aux, app, admin_password(app), keep, fast_key=fast_key
506
510
  )
507
- bifrost_search.inject(config, gw["llm_provider"], aux)
508
- if gw.get("llm_fast"):
509
- bifrost_search.inject(config, FAST_PROVIDER, aux)
510
511
  names = (gw["llm"]["model"], AGENT_MODEL)
511
512
  sheets = bifrost_datasheet.sheets(gw["llm_provider"], names, gw.get("context"))
512
513
  if fast := gw.get("llm_fast"):
@@ -342,9 +342,12 @@ def ensure_binary(root: Path, kind: str, event: runtime_io.Event) -> None:
342
342
  if reuse_binary(artifact, staged):
343
343
  event({"kind": "stage", "stage": f"reuse-{kind}", "state": "succeeded"})
344
344
  elif kind == "bifrost" and "npm" in artifact:
345
- from localmodels.npm_transport import install_bifrost
345
+ from localmodels.npm_transport import fetch_bifrost
346
346
 
347
- install_bifrost(artifact, staged)
347
+ # Beside the binary, not in the staging directory: a later ensure resumes it,
348
+ # and removing the gateway root removes it too.
349
+ tarball = root / f".{artifact['name']}.tgz" # versioned: no stale resume
350
+ fetch_bifrost(artifact, staged, tarball, event)
348
351
  else:
349
352
  runtime_io.download(artifact, staged, event)
350
353
  staged.chmod(0o700)
@@ -13,6 +13,14 @@ from localmodels import catalog
13
13
  from localmodels.remote_ops import RERANK_DOCS, RERANK_QUERY, RERANK_RELEVANT
14
14
 
15
15
 
16
+ class Check(TypedDict):
17
+ """One named result of a gateway step: wiring, removal or acceptance."""
18
+
19
+ check: str
20
+ ok: bool
21
+ detail: str
22
+
23
+
16
24
  class _AuxService(TypedDict):
17
25
  contract: str # one of gateway.WIRED
18
26
  url: str
@@ -21,8 +29,7 @@ class _AuxService(TypedDict):
21
29
 
22
30
 
23
31
  class AuxEndpoint(_AuxService, total=False):
24
- """A running embedding, reranker, STT or search service, with the key the gateway sends it
25
- (the search service takes none)."""
32
+ """A running embedding, reranker or STT service, with the key the gateway sends it."""
26
33
 
27
34
  fixture: dict[str, object] # STT: the recording acceptance sends
28
35
 
@@ -48,10 +48,10 @@ from localmodels.harness_probe import listener_uids as listener_uids
48
48
  from localmodels.harness_probe import shown_pi_model as shown_pi_model
49
49
  from localmodels.npm_transport import Artifact as Artifact
50
50
  from localmodels.npm_transport import ToolBuild as ToolBuild
51
- from localmodels.npm_transport import install_bifrost
51
+ from localmodels.npm_transport import fetch_bifrost
52
52
  from localmodels.remote_ops import Archive, fetch
53
53
  from localmodels.remote_ops_download import npm_copies
54
- from localmodels.runtime_io import error_cause
54
+ from localmodels.runtime_io import Event, error_cause
55
55
  from localmodels.stack_events import CombinedEvents as _CombinedEvents
56
56
  from localmodels.stack_events import ToolEvents
57
57
  from localmodels.tool_archive import (
@@ -509,15 +509,41 @@ def tool_path(plan: ToolPlan, tool: str) -> str:
509
509
  # ---------------------------------------------------------------------------- installation
510
510
 
511
511
 
512
- def _fetch(tools_dir: Path, artifact: Artifact, log: Callable[[str], None]) -> Path:
512
+ def archive_files(tools_dir: Path, artifact: Artifact) -> list[str]:
513
+ """The files ``_fetch`` may leave in ``.archives`` for ``artifact``: the archive, fetch's
514
+ verification marker and, for an npm build, its lock and the tarball with its partial
515
+ download (gone after a successful fetch). The owned manifest lists them for ``--purge``."""
516
+ path = str(tools_dir / ".archives" / artifact["name"])
517
+ suffixes = ("", ".sha256", *((".lock", ".tgz", ".tgz.part") if "npm" in artifact else ()))
518
+ return [path + suffix for suffix in suffixes]
519
+
520
+
521
+ def own_downloads(tools_dir: Path, artifacts: list[Artifact]) -> None:
522
+ """List ``artifacts``' archive files in the owned manifest before fetching them, so
523
+ ``--purge`` also finds the partial download of an install that failed or was killed."""
524
+ files = {f for a in artifacts for f in archive_files(tools_dir, a)}
525
+ hosts.update_owned(
526
+ lambda doc: doc.__setitem__("archives", sorted(set(doc["archives"]) | files)), tools_dir
527
+ )
528
+
529
+
530
+ def _fetch(
531
+ tools_dir: Path,
532
+ artifact: Artifact,
533
+ log: Callable[[str], None],
534
+ event: Event = lambda _: None,
535
+ ) -> Path:
513
536
  path = tools_dir / ".archives" / artifact["name"]
514
537
  if "npm" in artifact:
515
- if not path.is_file() or digest(str(path)) != artifact["sha256"]:
516
- path.parent.mkdir(parents=True, exist_ok=True)
517
- with tempfile.TemporaryDirectory(dir=path.parent) as temporary:
518
- staged = Path(temporary) / "bifrost-http"
519
- install_bifrost(artifact, staged)
520
- staged.replace(path)
538
+ path.parent.mkdir(parents=True, exist_ok=True)
539
+ # stack apply and source apply may fetch it at once: one writes the tarball, the other
540
+ # waits and then reuses the binary it published.
541
+ with hosts.file_lock(path.with_name(path.name + ".lock")):
542
+ if not path.is_file() or digest(str(path)) != artifact["sha256"]:
543
+ with tempfile.TemporaryDirectory(dir=path.parent) as temporary:
544
+ staged = Path(temporary) / "bifrost-http"
545
+ fetch_bifrost(artifact, staged, path.with_name(path.name + ".tgz"), event)
546
+ staged.replace(path)
521
547
  return path
522
548
  with contextlib.redirect_stdout(_Events(log)):
523
549
  _download(path, artifact)
@@ -643,6 +669,7 @@ def install_tools(plan: ToolPlan, log: Callable[[str], None] = lambda message: N
643
669
  if "bifrost" in actions and actions["bifrost"]["action"] == "install":
644
670
  from localmodels import gateway_bifrost
645
671
 
672
+ own_downloads(tools_dir, actions["bifrost"]["artifacts"])
646
673
  if made := gateway_bifrost.install_binary(tools_dir, actions["bifrost"], log):
647
674
  owned.append(made)
648
675
  if "magpie" in actions and actions["magpie"]["action"] == "install":
@@ -662,11 +689,11 @@ def install_tools(plan: ToolPlan, log: Callable[[str], None] = lambda message: N
662
689
  owned.append(str(target))
663
690
  log(f"Magpie {actions['magpie']['version']} installed: {target}")
664
691
  fetched = [
665
- str(tools_dir / ".archives" / a["name"]) + suffix
692
+ file
666
693
  for t in plan["tools"]
667
694
  if t["action"] == "install"
668
695
  for a in t["artifacts"]
669
- for suffix in ("", ".sha256") # fetch's verification marker
696
+ for file in archive_files(tools_dir, a)
670
697
  ]
671
698
  if owned or fetched:
672
699
  created: list[hosts.OwnedTool] = [{"path": p, "sha256": digest(p)} for p in owned]
@@ -20,7 +20,7 @@ from localmodels import (
20
20
  remote_ops_service,
21
21
  runtime_io,
22
22
  )
23
- from localmodels.gateway_search import Check
23
+ from localmodels.gateway_requests import Check
24
24
 
25
25
  SERVE_PID = "magpie-serve.pid" # with magpie-serve.pid.identity.json: process_identity.save
26
26
  SERVE_STOPPED = {
@@ -348,8 +348,10 @@ class OwnedBifrost(_OwnedBifrostSince20261110):
348
348
 
349
349
  class _OwnedGatewaySince20261031(TypedDict, total=False):
350
350
  caller_keys: list[str] # ids of the Magpie gateway keys (callers' keys) this tool added
351
- search: str # the searxng search API URL this tool added to Magpie's searches
352
- search_you: bool # this tool added Magpie's You.com search API, the free fallback after it
351
+ # The Magpie search APIs this tool added for the web search service the stack used to run:
352
+ # stack remove takes them out again.
353
+ search: str # the searxng search API URL
354
+ search_you: bool # Magpie's You.com search API, the free fallback after it
353
355
  bifrost: OwnedBifrost # since 2026-11-02: the Bifrost gateway this tool runs
354
356
 
355
357
 
@@ -518,26 +520,11 @@ def own_gateway(
518
520
  update_owned(change, tools_dir)
519
521
 
520
522
 
521
- def own_search(tools_dir: str | Path, url: str | None) -> None:
522
- """Record (or, with None, forget) the searxng search API this tool added to Magpie."""
523
+ def forget_search(tools_dir: str | Path, field: Literal["search", "search_you"]) -> None:
524
+ """Forget a Magpie search API this tool added for the web search service it used to run."""
523
525
 
524
526
  def change(doc: Owned) -> None:
525
- if url:
526
- doc["gateway"]["search"] = url
527
- else:
528
- doc["gateway"].pop("search", None)
529
-
530
- update_owned(change, tools_dir)
531
-
532
-
533
- def own_search_you(tools_dir: str | Path, owned: bool) -> None:
534
- """Record (or forget) that this tool added Magpie's You.com search API."""
535
-
536
- def change(doc: Owned) -> None:
537
- if owned:
538
- doc["gateway"]["search_you"] = True
539
- else:
540
- doc["gateway"].pop("search_you", None)
527
+ doc["gateway"].pop(field, None)
541
528
 
542
529
  update_owned(change, tools_dir)
543
530