@simplexai/localmodels-darwin-arm64 0.1.0-dev.49 → 0.1.0-dev.51

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 (67) hide show
  1. package/bootstrap.identity +1 -1
  2. package/bootstrap.sha256 +65 -59
  3. package/modules/localmodels/__init__.py +1 -1
  4. package/modules/localmodels/catalog.json +2395 -9
  5. package/modules/localmodels/deploy.py +29 -134
  6. package/modules/localmodels/download-mirrors.json +47 -0
  7. package/modules/localmodels/engines-strata-poly-0.2.19-poly.1.json +79 -0
  8. package/modules/localmodels/engines-strata-poly-0.2.20-poly.1.json +132 -0
  9. package/modules/localmodels/gateway.py +23 -6
  10. package/modules/localmodels/gateway_bifrost.py +6 -2
  11. package/modules/localmodels/harness.py +8 -2
  12. package/modules/localmodels/harness_gateway.py +78 -17
  13. package/modules/localmodels/harness_probe.py +43 -23
  14. package/modules/localmodels/hosts.py +52 -5
  15. package/modules/localmodels/library_floor.py +76 -0
  16. package/modules/localmodels/library_gateway.py +17 -1
  17. package/modules/localmodels/library_jobs.py +38 -6
  18. package/modules/localmodels/library_model.py +5 -0
  19. package/modules/localmodels/library_poly.py +273 -0
  20. package/modules/localmodels/library_pricing.py +24 -35
  21. package/modules/localmodels/library_serve.py +7 -0
  22. package/modules/localmodels/library_state.py +16 -0
  23. package/modules/localmodels/library_status.py +114 -29
  24. package/modules/localmodels/llm_rank.py +14 -0
  25. package/modules/localmodels/magpie_windows.py +312 -0
  26. package/modules/localmodels/plan_envelope.py +234 -3
  27. package/modules/localmodels/probe.py +1 -1
  28. package/modules/localmodels/process_identity.py +19 -9
  29. package/modules/localmodels/process_identity_darwin.py +155 -0
  30. package/modules/localmodels/remote_ops.py +11 -0
  31. package/modules/localmodels/remote_ops_download.py +30 -5
  32. package/modules/localmodels/remote_ops_service.py +11 -13
  33. package/modules/localmodels/reuse.py +13 -6
  34. package/modules/localmodels/runtime_cli.py +8 -8
  35. package/modules/localmodels/runtime_install.py +25 -1
  36. package/modules/localmodels/runtime_io.py +32 -18
  37. package/modules/localmodels/setup_inspection.py +83 -79
  38. package/modules/localmodels/setup_inspection_harness.py +147 -0
  39. package/modules/localmodels/setup_text.py +12 -0
  40. package/modules/localmodels/setup_upgrade.py +11 -1
  41. package/modules/localmodels/stack.py +3 -1
  42. package/modules/localmodels/stack_auto.py +6 -2
  43. package/modules/localmodels/stack_cli.py +39 -0
  44. package/modules/localmodels/stack_clients.py +1 -1
  45. package/modules/localmodels/stack_compose.py +12 -43
  46. package/modules/localmodels/stack_down.py +25 -16
  47. package/modules/localmodels/stack_hardware.py +12 -1
  48. package/modules/localmodels/stack_picks.py +28 -13
  49. package/modules/localmodels/stack_plan.py +55 -3
  50. package/modules/localmodels/stack_remove.py +3 -1
  51. package/modules/localmodels/stack_suite.py +80 -20
  52. package/modules/localmodels/strata-poly-serve-0.2.19-poly.1.txt +428 -0
  53. package/modules/localmodels/{strata-poly-serve-0.1.45-poly.9.txt → strata-poly-serve-0.2.20-poly.1.txt} +2 -2
  54. package/modules/localmodels/strata_poly_server.py +33 -2
  55. package/modules/localmodels/suite.py +45 -4
  56. package/modules/localmodels/tool_archive.py +4 -0
  57. package/modules/localmodels/vision.py +4 -2
  58. package/modules/localmodels/win_probe.py +24 -7
  59. package/modules/{simplex_localmodels-0.1.0.dev49.dist-info → simplex_localmodels-0.1.0.dev51.dist-info}/METADATA +1 -1
  60. package/modules/{simplex_localmodels-0.1.0.dev49.dist-info → simplex_localmodels-0.1.0.dev51.dist-info}/RECORD +62 -56
  61. package/package.json +1 -1
  62. package/tool.json +1 -1
  63. package/modules/localmodels/engines-strata-poly-0.1.45-poly.9.json +0 -75
  64. /package/modules/{simplex_localmodels-0.1.0.dev49.dist-info → simplex_localmodels-0.1.0.dev51.dist-info}/WHEEL +0 -0
  65. /package/modules/{simplex_localmodels-0.1.0.dev49.dist-info → simplex_localmodels-0.1.0.dev51.dist-info}/entry_points.txt +0 -0
  66. /package/modules/{simplex_localmodels-0.1.0.dev49.dist-info → simplex_localmodels-0.1.0.dev51.dist-info}/licenses/NOTICE +0 -0
  67. /package/modules/{simplex_localmodels-0.1.0.dev49.dist-info → simplex_localmodels-0.1.0.dev51.dist-info}/licenses/localmodels/HERMES-LICENSE +0 -0
@@ -9,15 +9,20 @@ from __future__ import annotations
9
9
  import json
10
10
  import os
11
11
  import secrets
12
- import urllib.error
13
- import urllib.parse
14
- import urllib.request
15
12
  from collections.abc import Callable
16
13
  from dataclasses import dataclass
17
- from typing import TypedDict
18
14
 
19
15
  from localmodels import catalog as cat
20
- from localmodels import chat_template, hf_repo, hosts, metal, region, stack_debug, vision
16
+ from localmodels import (
17
+ chat_template,
18
+ hf_repo,
19
+ hosts,
20
+ metal,
21
+ plan_envelope,
22
+ region,
23
+ stack_debug,
24
+ vision,
25
+ )
21
26
  from localmodels.budget import (
22
27
  Placement,
23
28
  agent_budget,
@@ -50,14 +55,16 @@ from localmodels.engines import (
50
55
  )
51
56
  from localmodels.estimator import PhysicsRefusal, as_loaded, eager
52
57
  from localmodels.plan_envelope import (
58
+ HubUnreachableError,
53
59
  PlanError,
60
+ catalog_pins,
54
61
  deployment,
55
62
  hub_url,
56
- plan_envelope,
57
63
  require_disk,
58
64
  require_free_port,
59
65
  utc_now,
60
66
  )
67
+ from localmodels.plan_envelope import plan_envelope as build_plan_envelope
61
68
  from localmodels.probe import HostFacts
62
69
  from localmodels.records import (
63
70
  FinishedRecord,
@@ -105,7 +112,8 @@ class GpuConflictError(PlanError):
105
112
  super().__init__(
106
113
  f"{placement.label} runs services this tool does not own "
107
114
  f"({', '.join(placement.conflicts)}); to share it, pass --placement "
108
- f"{placement.id} and consent to sharing before apply"
115
+ f"{placement.id} and consent to sharing before apply",
116
+ cause_code="GPU_CONFLICT",
109
117
  )
110
118
 
111
119
 
@@ -129,144 +137,25 @@ class AgentMemoryError(PlanError):
129
137
  """The agent planner's refusal, with the same capacity figures used to admit a model."""
130
138
 
131
139
  def __init__(self, message: str, refused: PhysicsRefusal, memory: str) -> None:
132
- super().__init__(message)
140
+ super().__init__(message, cause_code="MEMORY_INSUFFICIENT")
133
141
  self.needed_bytes = refused.needed_bytes
134
142
  self.available_bytes = refused.available_bytes
135
143
  self.memory = memory
136
144
 
137
145
 
138
146
  def _hf_get(url: str) -> object:
139
- """One Hub API document. A Hub that cannot be reached is a refusal that says how to go on:
140
- home networks often reach a mirror but not huggingface.co (the Mac mini, 2026-11-12)."""
141
- req = urllib.request.Request(url, headers={"User-Agent": "localmodels-plan"})
142
- try:
143
- with urllib.request.urlopen(req, timeout=20) as r:
144
- return json.load(r)
145
- except urllib.error.HTTPError:
146
- raise # the Hub answered: a missing repo or revision is the caller's to report
147
- except OSError as exc: # URLError and timeouts
148
- host = urllib.parse.urlsplit(url).netloc
149
- raise PlanError(
150
- f"cannot reach {host} to look up the model files ({getattr(exc, 'reason', exc)}); "
151
- "name a reachable Hub with --hf-endpoint URL or HF_ENDPOINT (a mirror such as "
152
- "https://hf-mirror.com), or plan from the catalog's pins with --offline"
153
- ) from exc
147
+ return plan_envelope.hf_get(url)
154
148
 
155
149
 
156
150
  def hub_get(api: str, path: str, *, mint: bool = False) -> object:
157
- """One Hub API document. A lookup checked against a catalog pin asks the Hubs
158
- region.hub_endpoints orders (in cn hf-mirror.com first) and moves to the other when one
159
- cannot be reached, switching the region. A lookup that ``mint``s a SHA256 pin asks ``api``
160
- alone: the default Hugging Face or the user's own Hub, never the mirror. A Hub that
161
- answered (an HTTP error) is final."""
162
- endpoints = [api.rstrip("/")] if mint else region.hub_endpoints(api)
163
- for index, endpoint in enumerate(endpoints):
164
- try:
165
- doc = _hf_get(endpoint + path)
166
- except PlanError as exc:
167
- if index + 1 < len(endpoints):
168
- continue
169
- if mint and not region.explicit_hub(api):
170
- what = path.split("/api/models/")[-1]
171
- raise PlanError(region.MINT_REFUSAL.format(what=what)) from exc
172
- raise
173
- if index:
174
- region.fallback_to(region.side_of_endpoint(endpoint))
175
- return doc
176
- raise AssertionError("unreachable Hub loop")
177
-
178
-
179
- class Revision(TypedDict):
180
- sha: str
181
-
182
-
183
- class LfsFile(TypedDict):
184
- size: int
185
- oid: str
186
-
187
-
188
- class TreeEntry(TypedDict):
189
- path: str
190
-
191
-
192
- class OptionalTreeEntry(TreeEntry, total=False):
193
- lfs: LfsFile
151
+ return plan_envelope.hub_get(api, path, mint=mint, fetch=_hf_get)
194
152
 
195
153
 
196
154
  def resolve_files(assets: list[tuple[str, cat.AssetFile]], api: str) -> list[PinnedFile]:
197
- """Pin each asset to a commit and its LFS SHA256 via the Hub API. The catalog records sizes,
198
- and digests only for files it pins; a file whose size disagrees with the catalog is refused
199
- (the pricing would lie), and so is one whose content differs from its catalog pin."""
200
- revisions: dict[tuple[str, str, bool], str] = {}
201
- trees: dict[tuple[str, str, str, bool], dict[str, OptionalTreeEntry]] = {}
202
- pinned: list[PinnedFile] = []
203
- for repo, asset in assets:
204
- mint = asset.sha256 is None # the Hub's answer becomes the pin: trusted Hub only
205
- key = (repo, asset.revision, mint)
206
- if key not in revisions:
207
- doc = decode(
208
- hub_get(
209
- api,
210
- f"/api/models/{repo}/revision/{urllib.parse.quote(asset.revision)}",
211
- mint=mint,
212
- ),
213
- Revision,
214
- )
215
- revisions[key] = doc["sha"]
216
- commit = revisions[key]
217
- directory = asset.path.rsplit("/", 1)[0] if "/" in asset.path else ""
218
- tkey = (repo, commit, directory, mint)
219
- if tkey not in trees:
220
- path = f"/api/models/{repo}/tree/{commit}" + (
221
- f"/{urllib.parse.quote(directory)}" if directory else ""
222
- )
223
- entries = hub_get(api, path, mint=mint)
224
- if not isinstance(entries, list):
225
- raise PlanError("Hub tree must be an array")
226
- parsed = [decode(e, OptionalTreeEntry) for e in entries]
227
- trees[tkey] = {e["path"]: e for e in parsed}
228
- entry = trees[tkey].get(asset.path)
229
- if entry is None or not entry.get("lfs"):
230
- raise PlanError(f"{asset.path} not found in {repo}@{commit[:12]}")
231
- if int(entry["lfs"]["size"]) != asset.size_bytes:
232
- raise PlanError(
233
- f"{asset.path} size {entry['lfs']['size']} != catalog size {asset.size_bytes}"
234
- )
235
- if asset.sha256 is not None and entry["lfs"]["oid"] != asset.sha256:
236
- raise PlanError(f"{asset.path} on the Hub has a SHA256 the catalog does not pin")
237
- pinned.append(
238
- {
239
- "repo": repo,
240
- "path": asset.path,
241
- "revision": commit,
242
- "size_bytes": asset.size_bytes,
243
- "sha256": entry["lfs"]["oid"],
244
- "local_name": asset.local_name,
245
- }
246
- )
247
- return pinned
155
+ return plan_envelope.resolve_files(assets, api, fetch_hub=hub_get)
248
156
 
249
157
 
250
- def catalog_pins(assets: list[tuple[str, cat.AssetFile]], _api: str) -> list[PinnedFile]:
251
- """Each asset at the commit and SHA256 the catalog pins, asking the Hub nothing: the resolver
252
- for a plan made offline. A file the catalog does not pin is refused, never guessed."""
253
- pinned: list[PinnedFile] = []
254
- for repo, asset in assets:
255
- if asset.sha256 is None:
256
- raise PlanError(
257
- f"catalog pins no commit and SHA256 for {repo}/{asset.path}; cannot plan it offline"
258
- )
259
- pinned.append(
260
- {
261
- "repo": repo,
262
- "path": asset.path,
263
- "revision": asset.revision,
264
- "size_bytes": asset.size_bytes,
265
- "sha256": asset.sha256,
266
- "local_name": asset.local_name,
267
- }
268
- )
269
- return pinned
158
+ __all__ = ["HubUnreachableError", "catalog_pins"]
270
159
 
271
160
 
272
161
  def _choose_agent_placement(
@@ -376,8 +265,14 @@ def _choose_placement(
376
265
  fallbacks.append((now.decision.spill_bytes, placement, now))
377
266
  if not fallbacks:
378
267
  if capacity and all(p.backend == "cpu" for p in capacity):
379
- raise PlanError(f"{entry.display_name} exceeds free system memory (CPU deployment)")
380
- raise PlanError(f"{entry.display_name} exceeds free GPU memory and system memory")
268
+ raise PlanError(
269
+ f"{entry.display_name} exceeds free system memory (CPU deployment)",
270
+ cause_code="MEMORY_INSUFFICIENT",
271
+ )
272
+ raise PlanError(
273
+ f"{entry.display_name} exceeds free GPU memory and system memory",
274
+ cause_code="MEMORY_INSUFFICIENT",
275
+ )
381
276
  _, placement, now = min(fallbacks, key=lambda t: t[0])
382
277
  return placement, now
383
278
 
@@ -520,7 +415,7 @@ def build_plan(
520
415
  agent_posture=options.agent is not None and facts["platform"] != "win32",
521
416
  )
522
417
 
523
- return plan_envelope(
418
+ return build_plan_envelope(
524
419
  host_id,
525
420
  facts,
526
421
  where,
@@ -10,6 +10,18 @@
10
10
  "repo": "ConwayResearch/Underdog-Saluki-27B-1.0",
11
11
  "path": "mmproj-Underdog-Saluki-27B-1.0-F16.gguf"
12
12
  },
13
+ "92cee27ae5bbadcd732416a0f7a7f0acc092399dbbe8f5a5efa707c2ec0a49d7": {
14
+ "repo": "ISTA-DASLab/Qwen3.8-Flash-Next-GSQ-RCO-GGUF",
15
+ "path": "IQ2_XS/Qwen3.8-Flash-Next-GSQ-RCO-IQ2_XS-00001-of-00002.gguf"
16
+ },
17
+ "316b46f3a2dbd68c900f43136ab9449f9dcc3725dfd8c794847c204bc161e113": {
18
+ "repo": "ISTA-DASLab/Qwen3.8-Flash-Next-GSQ-RCO-GGUF",
19
+ "path": "IQ2_XS/Qwen3.8-Flash-Next-GSQ-RCO-IQ2_XS-00002-of-00002.gguf"
20
+ },
21
+ "4c1eb2ceb4915e1192f4f386021897bde56a97f40a0bb78bb86465e0f7d2aca3": {
22
+ "repo": "ISTA-DASLab/Qwen3.8-Flash-Next-GSQ-RCO-GGUF",
23
+ "path": "IQ3_S/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_S-00001-of-00002.gguf"
24
+ },
13
25
  "b1a82259702816a5330d7bd7607cd9676b11780e79ff7348c21103ff3ce49bd0": {
14
26
  "repo": "ISTA-DASLab/Qwen3.8-Flash-Next-GSQ-RCO-GGUF",
15
27
  "path": "mmproj-Qwen3.8-Flash-Next-BF16.gguf"
@@ -134,6 +146,34 @@
134
146
  "repo": "unsloth/DeepSeek-V4-Flash-0731-GGUF",
135
147
  "path": "dspark-DeepSeek-V4-Flash-0731-Q8_0.gguf"
136
148
  },
149
+ "bd7ef0865adf119b5183e45e741c629bafa649769b33b5ebf689bb4bcc4690d6": {
150
+ "repo": "unsloth/Inkling-2-Mini-GGUF",
151
+ "path": "Inkling-2-Mini-UD-IQ3_XXS.gguf"
152
+ },
153
+ "f90c5a4df44d335ac9f9eea2a15c31d6c5a377b1b3cd9ff7fc2cf123f3cdf7e1": {
154
+ "repo": "unsloth/Inkling-2-Mini-GGUF",
155
+ "path": "Inkling-2-Mini-UD-Q4_K_M.gguf"
156
+ },
157
+ "b42841608ea380ddde5a3f1125081357128a3c71b80d006246de4e31292fc6c1": {
158
+ "repo": "unsloth/Inkling-2-Mini-GGUF",
159
+ "path": "Mainline_Support/Inkling-2-Mini-UD-Q2_K_XL.gguf_file"
160
+ },
161
+ "e2d03e8c92ac21cff0e3309b95f40dfd27d1825184f0d2bc09db249797273639": {
162
+ "repo": "unsloth/Inkling-2-Mini-GGUF",
163
+ "path": "Mainline_Support/Inkling-2-Mini-UD-Q3_K_XL.gguf_file"
164
+ },
165
+ "e64276656f072e9b2197a61723667cbdb71da66a716ffd966e572c21088f3cd3": {
166
+ "repo": "unsloth/Inkling-2-Mini-GGUF",
167
+ "path": "Mainline_Support/Inkling-2-Mini-UD-Q4_K_XL.gguf_file"
168
+ },
169
+ "2c165c78790e78a3f45a2d1e9e931083e52ee69d45ff2a0dc9c281fdf1a666e7": {
170
+ "repo": "unsloth/Inkling-2-Mini-GGUF",
171
+ "path": "mmproj-BF16.gguf"
172
+ },
173
+ "3bff75ffeb2d6e0371ba7bd42e30d26a7d98aea681fa44b03b5a20891cfa2c5f": {
174
+ "repo": "unsloth/Inkling-2-Mini-GGUF",
175
+ "path": "mmproj-F16.gguf"
176
+ },
137
177
  "0f2cbdc4f578b5a53f521bcb1a5f5297cd54ea72ebf6c8ce80b570cc5645bac1": {
138
178
  "repo": "unsloth/Nemotron-3-Nano-30B-A3B-GGUF",
139
179
  "path": "Nemotron-3-Nano-30B-A3B-IQ4_XS.gguf"
@@ -210,5 +250,12 @@
210
250
  "repo": "unsloth/Qwen3.8-Flash-Next-GGUF",
211
251
  "path": "mmproj-BF16.gguf"
212
252
  }
253
+ },
254
+ "unmirrored": {
255
+ "322e194ff79741c7baa497c240f677f54b201b0efab44ca8e50f122b39123482": {
256
+ "repo": "unsloth/Qwen3.8-27B-GGUF",
257
+ "path": "Qwen3.8-27B-UD-Q4_K_M.gguf",
258
+ "reason": "modelscope master has a different sha256/size"
259
+ }
213
260
  }
214
261
  }
@@ -0,0 +1,79 @@
1
+ {
2
+ "schema": "localmodels.engine-lock/v1",
3
+ "tag": "strata-poly-0.2.19-poly.1",
4
+ "commit": "v0.2.19-poly.1",
5
+ "source": "https://github.com/simplexai-labs/PolyStrata/releases/tag/v0.2.19-poly.1",
6
+ "note": "PolyStrata 0.2.19-poly.1 (MIT, tag v0.2.19-poly.1), built by this project on 2026-11-23 because upstream publishes only a Windows engine. The engine archive holds the strata-poly and strata-vision binaries, PolyStrata's Python server (serve/, strata_control/, strata_cli/, setup.py) and tokenizer tools (tools/strata_tokenizer.py, tools/gguf_reader.py) as released, LICENSE.PolyStrata and BUILD.json; the companion CUDA 13.0.3 runtime archive (reused from 0.1.45-poly.9, built from the same nvidia/cuda:13.0.3-devel-ubuntu22.04 digest) holds libcublas, libcublasLt and 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), plus -DSTRATA_VISION_CUDA=ON for strata-vision. Needs an NVIDIA driver for CUDA 13.0 (580 or newer), glibc 2.34 and libstdc++ 12 (Ubuntu 22.04, Debian 12 or newer); neither binary links libgomp. Source: PolyStrata v0.2.19-poly.1 tag archive sha256 994e20bd... (full digests in BUILD.json). The Windows build is upstream's own release zip (strata-poly.exe and strata-vision.exe, CUDA 13.0, same CUDA architectures, importing only cublas64_13.dll and KERNEL32.dll), paired with the tag archive's terminal/ server packages and NVIDIA's cuBLAS 13.0.2.14 wheel (nvidia/cu13/bin/x86_64 on lib_dirs).",
7
+ "builds": [
8
+ {
9
+ "platform": "linux",
10
+ "arch": "x64",
11
+ "backend": "cuda",
12
+ "min_cuda": "13.0",
13
+ "min_glibc": "2.34",
14
+ "binary": "strata-poly",
15
+ "assets": [
16
+ {
17
+ "name": "strata-poly-0.2.19-poly.1-linux-x64-cuda13.tar.gz",
18
+ "url": "https://d2ikbbcl3j6jz9.cloudfront.net/cli/localmodels/engines/strata-poly/0.2.19-poly.1/strata-poly-0.2.19-poly.1-linux-x64-cuda13.tar.gz",
19
+ "sha256": "2247984d9c99acebf2a8f7a917365da326e93ab066e15885961477596bc77a7a",
20
+ "size_bytes": 74988874,
21
+ "npm_copy": {
22
+ "package": "@simplexai/engine-strata-poly-0.2.19-poly.1-linux-x64-cuda13",
23
+ "version": "0.0.0-sha256-2247984d9c99aceb"
24
+ }
25
+ },
26
+ {
27
+ "name": "cudart-strata-poly-linux-x64-cuda13.0.3.tar.gz",
28
+ "url": "https://d2ikbbcl3j6jz9.cloudfront.net/cli/localmodels/engines/strata-poly/0.1.45-poly.9/cudart-strata-poly-linux-x64-cuda13.0.3.tar.gz",
29
+ "sha256": "189c3a9fb5fd5f87331ffcedf03d5469c2a9c91f46379299ee6ea277364f05d2",
30
+ "size_bytes": 422462968
31
+ }
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-605522f294c7a21a.zip",
43
+ "url": "https://github.com/simplexai-labs/PolyStrata/releases/download/v0.2.19-poly.1/strata-poly-windows-x64-605522f294c7a21a.zip",
44
+ "sha256": "c9b2e256514db91fda67a06243e8ef89c434c4b8327effd5a126dc3c093bcb75",
45
+ "size_bytes": 72788413,
46
+ "npm_copy": {
47
+ "package": "@simplexai/engine-strata-poly-windows-x64-605522f294c7a21a",
48
+ "version": "0.0.0-sha256-c9b2e256514db91f"
49
+ }
50
+ },
51
+ {
52
+ "name": "polystrata-0.2.19-poly.1-source.tar.gz",
53
+ "url": "https://github.com/simplexai-labs/PolyStrata/archive/refs/tags/v0.2.19-poly.1.tar.gz",
54
+ "sha256": "994e20bdc7a4de32c7c53a5802a4fb5eba2277da3932f0f091ead47f1ca69342",
55
+ "size_bytes": 46661873,
56
+ "members": [
57
+ "terminal/serve/",
58
+ "terminal/strata_control/",
59
+ "terminal/strata_cli/",
60
+ "terminal/tools/strata_tokenizer.py",
61
+ "terminal/tools/gguf_reader.py",
62
+ "terminal/setup.py",
63
+ "LICENSE"
64
+ ],
65
+ "npm_copy": {
66
+ "package": "@simplexai/engine-polystrata-0.2.19-poly.1-source",
67
+ "version": "0.0.0-sha256-994e20bdc7a4de32"
68
+ }
69
+ },
70
+ {
71
+ "name": "nvidia_cublas-13.0.2.14-py3-none-win_amd64.whl",
72
+ "url": "https://files.pythonhosted.org/packages/f3/91/bda39230b7a4c102bb724c21b50823efc63544490a885fea0b604911c0ab/nvidia_cublas-13.0.2.14-py3-none-win_amd64.whl",
73
+ "sha256": "5f7a90456b1392db60e28719547ba6e00696bfa81304b6887cf287f9edf2c1d7",
74
+ "size_bytes": 401887280
75
+ }
76
+ ]
77
+ }
78
+ ]
79
+ }
@@ -0,0 +1,132 @@
1
+ {
2
+ "schema": "localmodels.engine-lock/v1",
3
+ "tag": "strata-poly-0.2.20-poly.1",
4
+ "commit": "v0.2.20-poly.1",
5
+ "source": "https://github.com/simplexai-labs/PolyStrata/releases/tag/v0.2.20-poly.1",
6
+ "note": "PolyStrata 0.2.20-poly.1 (MIT, commit fdd8f0de, strata-poly engine 0.1.66), every build from its release page. Linux: strata-poly and strata-vision built from the release commit with NVIDIA's CUDA 13.0.3 toolkit (nvcc 13.0.88) and gcc 12.3 on Ubuntu 22.04, -DSTRATA_PORTABLE=ON (AVX2 CPU baseline), CUDA architectures 75, 80, 86, 89 and 120 (RTX 20, 30, 40 and 50 series); it loads the CUDA 13.0.3 runtime libraries (libcublas, libcublasLt, libcudart) of the archive already pinned for 0.1.45-poly.9, under NVIDIA's licence, and needs an NVIDIA driver for CUDA 13.0 (580 or newer), glibc 2.34 and libstdc++ 12 (Ubuntu 22.04, Debian 12 or newer). Windows: the same two programs for CUDA 13.0 and the same architectures; 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. macOS: arm64 Metal, macOS 15 or newer, with the Metal kernel sources the engine compiles when it starts (metal/). On all three the tag archive supplies PolyStrata's Python server and tokenizer tool, which have been under terminal/ since 0.2.19-poly.1: only terminal/serve/, terminal/tools/, terminal/strata_control/, terminal/strata_cli/ and LICENSE are unpacked. All archives of a build unpack into one directory. The engine no longer links ggml or llama.cpp. These recipes do not use the picture reader.",
7
+ "builds": [
8
+ {
9
+ "platform": "linux",
10
+ "arch": "x64",
11
+ "backend": "cuda",
12
+ "min_cuda": "13.0",
13
+ "min_glibc": "2.34",
14
+ "binary": "strata-poly",
15
+ "assets": [
16
+ {
17
+ "name": "strata-poly-linux-x64-cuda13-e668ba48c1712c06.tar.gz",
18
+ "url": "https://github.com/simplexai-labs/PolyStrata/releases/download/v0.2.20-poly.1/strata-poly-linux-x64-cuda13-e668ba48c1712c06.tar.gz",
19
+ "sha256": "dc15bc9f518c7d4bb3eae465913a121baa82d02fcce5b41905f1eedd0a4a7848",
20
+ "size_bytes": 76570403,
21
+ "npm_copy": {
22
+ "package": "@simplexai/engine-strata-poly-linux-x64-cuda13-e668ba48c1712c06",
23
+ "version": "0.0.0-sha256-dc15bc9f518c7d4b"
24
+ }
25
+ },
26
+ {
27
+ "name": "polystrata-0.2.20-poly.1-source.tar.gz",
28
+ "url": "https://github.com/simplexai-labs/PolyStrata/archive/refs/tags/v0.2.20-poly.1.tar.gz",
29
+ "sha256": "4efe2544631a65a07f68959dad652e8195b88f1f2edfa0c7e3c2ffd226c51628",
30
+ "size_bytes": 50152248,
31
+ "members": [
32
+ "terminal/serve/",
33
+ "terminal/tools/",
34
+ "terminal/strata_control/",
35
+ "terminal/strata_cli/",
36
+ "terminal/data/expert-profile-glm.txt",
37
+ "LICENSE"
38
+ ],
39
+ "npm_copy": {
40
+ "package": "@simplexai/engine-polystrata-0.2.20-poly.1-source",
41
+ "version": "0.0.0-sha256-4efe2544631a65a0"
42
+ }
43
+ },
44
+ {
45
+ "name": "cudart-strata-poly-linux-x64-cuda13.0.3.tar.gz",
46
+ "url": "https://d2ikbbcl3j6jz9.cloudfront.net/cli/localmodels/engines/strata-poly/0.1.45-poly.9/cudart-strata-poly-linux-x64-cuda13.0.3.tar.gz",
47
+ "sha256": "189c3a9fb5fd5f87331ffcedf03d5469c2a9c91f46379299ee6ea277364f05d2",
48
+ "size_bytes": 422462968
49
+ }
50
+ ]
51
+ },
52
+ {
53
+ "platform": "darwin",
54
+ "arch": "arm64",
55
+ "backend": "metal",
56
+ "binary": "strata-poly",
57
+ "assets": [
58
+ {
59
+ "name": "strata-poly-macos-arm64-e668ba48c1712c06.tar.gz",
60
+ "url": "https://github.com/simplexai-labs/PolyStrata/releases/download/v0.2.20-poly.1/strata-poly-macos-arm64-e668ba48c1712c06.tar.gz",
61
+ "sha256": "050c44da7676938adf3904cdf44e92a559fab1d52886499e1a2dd02836da84d1",
62
+ "size_bytes": 1136875,
63
+ "npm_copy": {
64
+ "package": "@simplexai/engine-strata-poly-macos-arm64-e668ba48c1712c06",
65
+ "version": "0.0.0-sha256-050c44da7676938a"
66
+ }
67
+ },
68
+ {
69
+ "name": "polystrata-0.2.20-poly.1-source.tar.gz",
70
+ "url": "https://github.com/simplexai-labs/PolyStrata/archive/refs/tags/v0.2.20-poly.1.tar.gz",
71
+ "sha256": "4efe2544631a65a07f68959dad652e8195b88f1f2edfa0c7e3c2ffd226c51628",
72
+ "size_bytes": 50152248,
73
+ "members": [
74
+ "terminal/serve/",
75
+ "terminal/tools/",
76
+ "terminal/strata_control/",
77
+ "terminal/strata_cli/",
78
+ "terminal/data/expert-profile-glm.txt",
79
+ "LICENSE"
80
+ ],
81
+ "npm_copy": {
82
+ "package": "@simplexai/engine-polystrata-0.2.20-poly.1-source",
83
+ "version": "0.0.0-sha256-4efe2544631a65a0"
84
+ }
85
+ }
86
+ ]
87
+ },
88
+ {
89
+ "platform": "win32",
90
+ "arch": "x64",
91
+ "backend": "cuda",
92
+ "min_cuda": "13.0",
93
+ "binary": "strata-poly.exe",
94
+ "assets": [
95
+ {
96
+ "name": "strata-poly-windows-x64-ea81920b1df9eb4a.zip",
97
+ "url": "https://github.com/simplexai-labs/PolyStrata/releases/download/v0.2.20-poly.1/strata-poly-windows-x64-ea81920b1df9eb4a.zip",
98
+ "sha256": "a615b0aac5a3182abf6e95a677a88c05fc81aeefb1edf71ac38c519aa046d575",
99
+ "size_bytes": 76744416,
100
+ "npm_copy": {
101
+ "package": "@simplexai/engine-strata-poly-windows-x64-ea81920b1df9eb4a",
102
+ "version": "0.0.0-sha256-a615b0aac5a3182a"
103
+ }
104
+ },
105
+ {
106
+ "name": "polystrata-0.2.20-poly.1-source.tar.gz",
107
+ "url": "https://github.com/simplexai-labs/PolyStrata/archive/refs/tags/v0.2.20-poly.1.tar.gz",
108
+ "sha256": "4efe2544631a65a07f68959dad652e8195b88f1f2edfa0c7e3c2ffd226c51628",
109
+ "size_bytes": 50152248,
110
+ "members": [
111
+ "terminal/serve/",
112
+ "terminal/tools/",
113
+ "terminal/strata_control/",
114
+ "terminal/strata_cli/",
115
+ "terminal/data/expert-profile-glm.txt",
116
+ "LICENSE"
117
+ ],
118
+ "npm_copy": {
119
+ "package": "@simplexai/engine-polystrata-0.2.20-poly.1-source",
120
+ "version": "0.0.0-sha256-4efe2544631a65a0"
121
+ }
122
+ },
123
+ {
124
+ "name": "nvidia_cublas-13.0.2.14-py3-none-win_amd64.whl",
125
+ "url": "https://files.pythonhosted.org/packages/f3/91/bda39230b7a4c102bb724c21b50823efc63544490a885fea0b604911c0ab/nvidia_cublas-13.0.2.14-py3-none-win_amd64.whl",
126
+ "sha256": "5f7a90456b1392db60e28719547ba6e00696bfa81304b6887cf287f9edf2c1d7",
127
+ "size_bytes": 401887280
128
+ }
129
+ ]
130
+ }
131
+ ]
132
+ }
@@ -147,7 +147,7 @@ def _serve(plan: ToolPlan) -> None:
147
147
  action = next(t for t in plan["tools"] if t["tool"] == "gateway")
148
148
  if harness_gateway.address_listening(action["path"]):
149
149
  raise HarnessError("approved gateway port still listening; no second process started")
150
- tools_dir = Path(os.path.expanduser(plan["tools_dir"]))
150
+ tools_dir = Path(os.path.expanduser(hosts.tools_dir(plan["tools_dir"])))
151
151
  tools_dir.mkdir(parents=True, exist_ok=True)
152
152
  try:
153
153
  harness_gateway.require_inactive(tools_dir)
@@ -159,15 +159,21 @@ def _serve(plan: ToolPlan) -> None:
159
159
  config = Path(env["XDG_CONFIG_HOME"]) / "magpie"
160
160
  runtime_io.private_directory(config)
161
161
  settings = config / "settings.json"
162
+ merged: dict[str, object] = {}
162
163
  if settings.exists() or settings.is_symlink():
163
164
  runtime_io.private_permissions(settings)
164
- else:
165
- runtime_io.write_private_json(
166
- settings, {"noAutoUpdate": True, "noAutoDownload": True, "redactModelOff": True}
167
- )
165
+ try:
166
+ loaded = json.loads(settings.read_text(encoding="utf-8"))
167
+ except (OSError, ValueError):
168
+ loaded = {}
169
+ if isinstance(loaded, dict):
170
+ merged = loaded
171
+ merged.update(noAutoUpdate=True, noAutoDownload=True, redactModelOff=True)
172
+ runtime_io.write_private_json(settings, merged)
173
+ magpie_bin = tool_path(plan, "magpie")
168
174
  with (tools_dir / "magpie-serve.log").open("ab") as log:
169
175
  proc = process_identity.spawn_detached(
170
- [tool_path(plan, "magpie"), "serve"],
176
+ [magpie_bin, "serve"],
171
177
  stdin=subprocess.DEVNULL,
172
178
  stdout=log,
173
179
  stderr=log,
@@ -175,6 +181,17 @@ def _serve(plan: ToolPlan) -> None:
175
181
  cwd=str(tools_dir), # not where install ran: Windows cannot delete a directory in use
176
182
  )
177
183
  harness_gateway.record_started_child(proc, tools_dir)
184
+ if "environment" not in plan:
185
+ hosts.own_gateway(plan["tools_dir"], "started", "serve")
186
+ hosts.own_magpie(
187
+ plan["tools_dir"],
188
+ {
189
+ "addr": action["path"],
190
+ "binary": magpie_bin,
191
+ "gateway_home": str(harness_probe.gateway_home(plan["tools_dir"])),
192
+ "tools_dir": str(tools_dir),
193
+ },
194
+ )
178
195
 
179
196
 
180
197
  def _await_gateway(plan: ToolPlan) -> None:
@@ -77,6 +77,9 @@ def plan_tools(
77
77
  ) -> tuple[list[ToolAction], list[str]]:
78
78
  """The pinned Bifrost binary and how its gateway runs: a systemd --user unit, or a
79
79
  background process where there is no systemd --user."""
80
+ resolved = hosts.tools_dir(tools_dir)
81
+ cleaned = resolved.rstrip("/\\")
82
+ tools_dir = cleaned if cleaned and not cleaned.endswith(":") else resolved
80
83
  lock = lock or harness.load_lock()
81
84
  if "bifrost" not in lock:
82
85
  raise HarnessError("the tool lock has no Bifrost")
@@ -100,10 +103,11 @@ def plan_tools(
100
103
  if listeners - {process_identity.current_uid()}:
101
104
  raise HarnessError(
102
105
  f"Bifrost address {addr} is held by another user's program; ask them to free it, or "
103
- "set LOCALMODELS_BIFROST_ADDR=127.0.0.1:<free port> in this terminal and plan again"
106
+ "set LOCALMODELS_BIFROST_ADDR=127.0.0.1:<free port> in this terminal and plan again",
107
+ code="gateway-port-in-use",
104
108
  )
105
109
  if listeners and not (ours and ours["addr"] == addr and owned_listener(ours)):
106
- raise HarnessError(harness_probe.bifrost_held(addr))
110
+ raise HarnessError(harness_probe.bifrost_held(addr), code="gateway-port-in-use")
107
111
  how = "unit" if systemd_user else "serve"
108
112
  gateway: ToolAction = {
109
113
  "tool": "gateway",
@@ -83,6 +83,10 @@ OWNED_WRAPPER = "# localmodels: pi wrapper"
83
83
  class HarnessError(RuntimeError):
84
84
  """A tool could not be planned, installed or wired; the message says why."""
85
85
 
86
+ def __init__(self, message: str, *, code: str | None = None) -> None:
87
+ super().__init__(message)
88
+ self.code = code
89
+
86
90
 
87
91
  class NodeLock(TypedDict):
88
92
  version: str
@@ -321,7 +325,9 @@ def plan_tools(
321
325
  """Reuse what works, install the pinned version of what is missing, never replace: Node.js,
322
326
  pi, the gateway's program (Magpie, or this tool's Bifrost) and the gateway, with no model
323
327
  behind them (``localmodels gateway``)."""
324
- tools_dir = state.get("tools_dir", tools_dir).rstrip("/")
328
+ resolved = hosts.tools_dir(state.get("tools_dir") or tools_dir)
329
+ cleaned = resolved.rstrip("/\\")
330
+ tools_dir = cleaned if cleaned and not cleaned.endswith(":") else resolved
325
331
  lock = lock or load_lock()
326
332
  bin_dir = BIN_DIR
327
333
  actions: list[ToolAction] = []
@@ -647,7 +653,7 @@ def _install_pi(
647
653
  def install_tools(plan: ToolPlan, log: Callable[[str], None] = lambda message: None) -> list[str]:
648
654
  """Install the tools the plan marks ``install``; returns the paths created (owned)."""
649
655
  lock = load_lock()
650
- tools_dir = Path(os.path.expanduser(plan["tools_dir"]))
656
+ tools_dir = Path(os.path.expanduser(hosts.tools_dir(plan["tools_dir"])))
651
657
  tools_dir.mkdir(parents=True, exist_ok=True)
652
658
  bin_dir = Path(os.path.expanduser(BIN_DIR))
653
659
  owned: list[str] = []