@simplexai/localmodels-linux-arm64 0.1.0-dev.103 → 0.1.0-dev.104

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 (139) hide show
  1. package/LICENSE +201 -0
  2. package/{modules/simplex_localmodels-0.1.0.dev103.dist-info/licenses/NOTICE → NOTICE} +42 -13
  3. package/README.md +10 -0
  4. package/bootstrap.identity +1 -1
  5. package/bootstrap.sha256 +126 -127
  6. package/modules/localmodels/__init__.py +1 -1
  7. package/modules/localmodels/catalog.json +130 -127
  8. package/modules/localmodels/catalog.py +7 -3
  9. package/modules/localmodels/catalog_recipes.py +3 -3
  10. package/modules/localmodels/cli_parser.py +3 -3
  11. package/modules/localmodels/component.py +1 -1
  12. package/modules/localmodels/console.py +1 -1
  13. package/modules/localmodels/context_policy.py +6 -5
  14. package/modules/localmodels/debug_cli.py +0 -12
  15. package/modules/localmodels/debug_mode.py +0 -6
  16. package/modules/localmodels/decode_calibration.json +3 -4
  17. package/modules/localmodels/decode_calibration.py +5 -2
  18. package/modules/localmodels/deployment_lifecycle.py +1 -1
  19. package/modules/localmodels/download-mirrors.json +1 -1
  20. package/modules/localmodels/engine_adapters/base.py +11 -1
  21. package/modules/localmodels/engine_adapters/strata_poly.py +65 -3
  22. package/modules/localmodels/engine_adapters/suite_plan.py +57 -20
  23. package/modules/localmodels/engines-b11583.json +6 -26
  24. package/modules/localmodels/engines-b12588-mix-c0c3de8.json +3 -15
  25. package/modules/localmodels/engines-b12757-mix-ef2df21.json +3 -15
  26. package/modules/localmodels/engines-prism-b12178-03ec600.json +3 -15
  27. package/modules/localmodels/engines-speechcpp-v0.11.3.json +4 -20
  28. package/modules/localmodels/engines-strata-0.1.47.json +1 -5
  29. package/modules/localmodels/engines-strata-0.1.49.2.json +1 -5
  30. package/modules/localmodels/engines-strata-0.1.59.1.json +1 -5
  31. package/modules/localmodels/engines-strata-poly-0.2.20-poly.1.json +6 -30
  32. package/modules/localmodels/engines-strata-poly-0.2.20-poly.9.json +129 -0
  33. package/modules/localmodels/engines-whisper-b5454.json +6 -30
  34. package/modules/localmodels/engines.json +13 -61
  35. package/modules/localmodels/estimator.py +10 -5
  36. package/modules/localmodels/gpu_specs.py +1 -1
  37. package/modules/localmodels/hosts.py +12 -16
  38. package/modules/localmodels/kokoro-tts-0.6.1.txt +1 -1
  39. package/modules/localmodels/library_elastic.py +135 -6
  40. package/modules/localmodels/library_kept.py +9 -1
  41. package/modules/localmodels/library_model.py +28 -1
  42. package/modules/localmodels/library_poly.py +109 -11
  43. package/modules/localmodels/library_pricing.py +12 -3
  44. package/modules/localmodels/library_serve.py +134 -67
  45. package/modules/localmodels/library_smoke.py +63 -5
  46. package/modules/localmodels/library_state.py +3 -2
  47. package/modules/localmodels/library_status.py +8 -1
  48. package/modules/localmodels/llm_rank.py +13 -8
  49. package/modules/localmodels/metal.py +1 -2
  50. package/modules/localmodels/plan_envelope.py +29 -11
  51. package/modules/localmodels/planning/budget.py +14 -12
  52. package/modules/localmodels/planning/memory_pools.py +7 -1
  53. package/modules/localmodels/privacy_acceptance.py +6 -5
  54. package/modules/localmodels/py.typed +0 -0
  55. package/modules/localmodels/quant_formats.py +1 -1
  56. package/modules/localmodels/recommend_cli.py +1 -1
  57. package/modules/localmodels/remote_ops_launchd.py +8 -1
  58. package/modules/localmodels/runtime_process.py +1 -1
  59. package/modules/localmodels/service_deployment.py +2 -4
  60. package/modules/localmodels/service_probe.py +59 -13
  61. package/modules/localmodels/setup_inspection.py +72 -70
  62. package/modules/localmodels/setup_text.py +7 -56
  63. package/modules/localmodels/sidecar_downloads.py +34 -0
  64. package/modules/localmodels/sidecar_http.py +61 -5
  65. package/modules/localmodels/sidecar_state.py +52 -2
  66. package/modules/localmodels/speech_admission.py +20 -4
  67. package/modules/localmodels/speech_catalog.py +23 -0
  68. package/modules/localmodels/speech_cli.py +10 -2
  69. package/modules/localmodels/speech_jobs.py +42 -17
  70. package/modules/localmodels/speech_server.py +182 -81
  71. package/modules/localmodels/speech_state.py +4 -1
  72. package/modules/localmodels/speech_workers.py +11 -0
  73. package/modules/localmodels/stack.py +1 -1
  74. package/modules/localmodels/stack_args.py +6 -6
  75. package/modules/localmodels/stack_auto.py +1 -1
  76. package/modules/localmodels/stack_aux_gpu.py +1 -1
  77. package/modules/localmodels/stack_cleanup.py +21 -18
  78. package/modules/localmodels/stack_cli.py +6 -2
  79. package/modules/localmodels/stack_compose.py +11 -4
  80. package/modules/localmodels/stack_debug.py +1 -2
  81. package/modules/localmodels/stack_decision.py +4 -4
  82. package/modules/localmodels/stack_doctor.py +2 -2
  83. package/modules/localmodels/stack_events.py +1 -1
  84. package/modules/localmodels/stack_gpu_memory.py +1 -1
  85. package/modules/localmodels/stack_hardware.py +3 -3
  86. package/modules/localmodels/stack_mcp.py +1 -2
  87. package/modules/localmodels/stack_picks.py +1 -1
  88. package/modules/localmodels/stack_plan.py +9 -9
  89. package/modules/localmodels/stack_ports.py +31 -4
  90. package/modules/localmodels/stack_rollback.py +1 -1
  91. package/modules/localmodels/stack_run.py +1 -1
  92. package/modules/localmodels/stack_suite.py +61 -12
  93. package/modules/localmodels/stack_view_agent.py +1 -1
  94. package/modules/localmodels/stack_view_serve.py +0 -2
  95. package/modules/localmodels/stack_view_words.py +2 -2
  96. package/modules/localmodels/stack_warm.py +2 -2
  97. package/modules/localmodels/stack_whatif.py +524 -41
  98. package/modules/localmodels/stack_whatif_html.py +903 -0
  99. package/modules/localmodels/startlux-decide-83fe6c7d.txt +2 -2
  100. package/modules/localmodels/{strata-poly-serve-0.2.20-poly.7.txt → strata-poly-serve-0.2.20-poly.9.txt} +1 -1
  101. package/modules/localmodels/strata_poly_server.py +114 -3
  102. package/modules/localmodels/suite.py +137 -5
  103. package/modules/localmodels/tts_admission.py +2 -17
  104. package/modules/localmodels/tts_catalog.py +29 -1
  105. package/modules/localmodels/tts_cli.py +23 -4
  106. package/modules/localmodels/tts_http.py +10 -4
  107. package/modules/localmodels/tts_jobs.py +49 -19
  108. package/modules/localmodels/tts_server.py +1 -1
  109. package/modules/localmodels/tts_sidecar.py +66 -28
  110. package/modules/localmodels/tts_state.py +7 -2
  111. package/modules/localmodels/vision.py +5 -3
  112. package/modules/localmodels/web/view/ASSET-SOURCES.md +4 -7
  113. package/modules/localmodels/web/view/view.css +0 -1
  114. package/modules/localmodels/web/view/view.js +2 -5
  115. package/modules/localmodels/web/whatif/app.js +730 -0
  116. package/modules/localmodels/web/whatif/page.html +1172 -0
  117. package/modules/localmodels/web/whatif/sim.js +303 -0
  118. package/modules/localmodels/windows_job.py +179 -11
  119. package/modules/simplex_localmodels-0.1.0.dev104.dist-info/METADATA +14 -0
  120. package/modules/{simplex_localmodels-0.1.0.dev103.dist-info → simplex_localmodels-0.1.0.dev104.dist-info}/RECORD +118 -114
  121. package/modules/simplex_localmodels-0.1.0.dev104.dist-info/licenses/LICENSE +201 -0
  122. package/modules/simplex_localmodels-0.1.0.dev104.dist-info/licenses/NOTICE +126 -0
  123. package/package.json +11 -2
  124. package/tool.json +1 -1
  125. package/modules/localmodels/engines-strata-poly-0.2.20-poly.7.json +0 -94
  126. package/modules/localmodels/fixtures/stack-research-demo-plan.json +0 -1059
  127. package/modules/localmodels/stack_research.py +0 -716
  128. package/modules/localmodels/stack_research_demo.py +0 -125
  129. package/modules/localmodels/stack_research_plan.py +0 -146
  130. package/modules/localmodels/web/index.html +0 -2605
  131. package/modules/localmodels/web/sizecalc/app.js +0 -1306
  132. package/modules/localmodels/web/sizecalc/calc.js +0 -269
  133. package/modules/localmodels/web/sizecalc/page.html +0 -520
  134. package/modules/localmodels/web/view/logo-claude.svg +0 -3
  135. package/modules/localmodels/web/view/logo-codex.png +0 -0
  136. package/modules/simplex_localmodels-0.1.0.dev103.dist-info/METADATA +0 -9
  137. /package/modules/{simplex_localmodels-0.1.0.dev103.dist-info → simplex_localmodels-0.1.0.dev104.dist-info}/WHEEL +0 -0
  138. /package/modules/{simplex_localmodels-0.1.0.dev103.dist-info → simplex_localmodels-0.1.0.dev104.dist-info}/entry_points.txt +0 -0
  139. /package/modules/{simplex_localmodels-0.1.0.dev103.dist-info → simplex_localmodels-0.1.0.dev104.dist-info}/licenses/localmodels/HERMES-LICENSE +0 -0
@@ -17,6 +17,7 @@ import json
17
17
  from collections.abc import Sequence
18
18
  from dataclasses import dataclass, field, replace
19
19
  from pathlib import Path, PurePosixPath
20
+ from typing import Literal
20
21
 
21
22
  from localmodels import decode_calibration, draft_spec, vision
22
23
  from localmodels.catalog_recipes import CATALOG_PATH as CATALOG_PATH
@@ -61,6 +62,7 @@ from localmodels.context_policy import (
61
62
  from localmodels.contracts import decode
62
63
  from localmodels.decode_calibration import DecodeEstimate as DecodeEstimate
63
64
  from localmodels.estimator import (
65
+ Backend,
64
66
  HardwareBudget,
65
67
  LayerKind,
66
68
  ModelProfile,
@@ -321,7 +323,9 @@ def is_nvidia_n1x_pci_id(pci_id: int) -> bool:
321
323
  return pci_id & 0xFFFF == 0x10DE and 0x2E00 <= pci_id >> 16 <= 0x2E3F
322
324
 
323
325
 
324
- def hardware_key(budget: HardwareBudget, backend: str) -> tuple[str, str, str]:
326
+ def hardware_key(
327
+ budget: HardwareBudget, backend: Backend | Literal["auto"]
328
+ ) -> tuple[str, str, str]:
325
329
  gpu_name = budget.gpu_name.partition(" (")[0]
326
330
  if budget.gpu_pci_id is not None:
327
331
  gpu_name = "NVIDIA RTX Spark N1X" if is_nvidia_n1x_pci_id(budget.gpu_pci_id) else ""
@@ -335,7 +339,7 @@ def decode_estimate(
335
339
  budget: HardwareBudget,
336
340
  *,
337
341
  spilled: bool = False,
338
- backend: str = "auto",
342
+ backend: Backend | Literal["auto"] = "auto",
339
343
  calibrated: bool = True,
340
344
  ) -> DecodeEstimate:
341
345
  bytes_per_token = max(1.0, variant.size_bytes * entry.decode_fraction)
@@ -378,7 +382,7 @@ def predicted_decode_tok_s(
378
382
  budget: HardwareBudget,
379
383
  *,
380
384
  spilled: bool = False,
381
- backend: str = "auto",
385
+ backend: Backend | Literal["auto"] = "auto",
382
386
  ) -> float:
383
387
  return decode_estimate(entry, variant, budget, spilled=spilled, backend=backend).tok_s
384
388
 
@@ -190,7 +190,7 @@ class LlamaComponentRecipe(ComponentRecipe):
190
190
 
191
191
 
192
192
  class DecisionTier(TypedDict):
193
- """One prompt cap of a decision model, measured on lab-12021 (RTX 4090 D, llama.cpp b11583)."""
193
+ """One prompt cap of a decision model, measured on a reference RTX 4090 D (llama.cpp b11583)."""
194
194
 
195
195
  context: int
196
196
  vram_bytes: int # peak of the llama-server process with a prompt of about 80% of the cap
@@ -217,13 +217,13 @@ class _DecisionOptional(TypedDict, total=False):
217
217
 
218
218
  class DecisionRecipe(LlamaComponentRecipe, _DecisionOptional):
219
219
  """A Jev-like decision model. It only ever runs on a GPU: on a CPU it is 40-70 times slower
220
- than on a GPU, which forfeits its System One role (AGENTS.md)."""
220
+ than on a GPU, which forfeits its System One role."""
221
221
 
222
222
  family: str
223
223
  commercial_use: bool # False: the weights' license restricts commercial use
224
224
  tiers: list[DecisionTier]
225
225
  board: dict[str, float] # leaderboard public and full score, snapshot named in evidence
226
- latency_ms: dict[str, float] # single-stream p50 on lab-12021: 1 and 16 questions
226
+ latency_ms: dict[str, float] # single-stream p50 on reference RTX 4090 D: 1 and 16 questions
227
227
  pros: list[str]
228
228
  cons: list[str]
229
229
 
@@ -132,13 +132,13 @@ def _devices(sub: Parsers) -> None:
132
132
  remove,
133
133
  "Forget a registered device. Its cached facts and deployment records stay in the state "
134
134
  "directory; nothing on the device changes. `local` cannot be removed.",
135
- examples=[("%(prog)s lab-241", "")],
135
+ examples=[("%(prog)s gpu-host", "")],
136
136
  )
137
137
  cli_help.document(
138
138
  devices,
139
139
  "List registered devices with their last probe. `remove ID` forgets a device; its "
140
140
  "cached facts and deployment records stay in the state directory.",
141
- examples=[("%(prog)s", ""), ("%(prog)s remove lab-241", "")],
141
+ examples=[("%(prog)s", ""), ("%(prog)s remove gpu-host", "")],
142
142
  )
143
143
 
144
144
 
@@ -163,7 +163,7 @@ def _inspect(sub: Parsers) -> None:
163
163
  "Probe a host read-only (GPUs, RAM, disk, engines, services, ports) and print the facts "
164
164
  "JSON; the facts are cached for `recommend` and plans. SSH targets are registered on "
165
165
  "their first successful probe.",
166
- examples=[("%(prog)s", "this computer"), ("%(prog)s lab-241", "an SSH host")],
166
+ examples=[("%(prog)s", "this computer"), ("%(prog)s gpu-host", "an SSH host")],
167
167
  )
168
168
  recommend = sub.add_parser("recommend", help="what fits a host: default stack, model fits")
169
169
  _host(recommend)
@@ -1,6 +1,6 @@
1
1
  """llama-server plans for Jev-like decision models (catalog components with task "decision").
2
2
 
3
- A decision model shares the LLM's card (AGENTS.md: on a CPU one request takes seconds instead of
3
+ A decision model shares the LLM's card (on a CPU one request takes seconds instead of
4
4
  tens of milliseconds, which forfeits the System One role). ``gpu_plan`` is that deployment; the CPU
5
5
  ``build_plan`` remains for the offline QA run on a computer without a GPU, which no command-line
6
6
  option reaches. A StartLux Instant model is two plans: llama-server reading the non-causal GGUF on
@@ -1,7 +1,7 @@
1
1
  """Terminal output for people and agents: color, glyphs, bars, spinners and a live region.
2
2
 
3
3
  The split follows Rich (Console, Live, Progress, Status), built on the standard library because
4
- the controller ships without third-party runtime dependencies (roadmap decision 15). Every
4
+ the controller ships without third-party runtime dependencies. Every
5
5
  feature falls back to plain, append-only lines when the stream is not a terminal, so pipes,
6
6
  CI logs and agents read stable text with no escape codes:
7
7
 
@@ -14,6 +14,7 @@ from dataclasses import dataclass, field, replace
14
14
 
15
15
  from localmodels.estimator import (
16
16
  AGENT_PROCESS_OVERHEAD_BYTES,
17
+ Backend,
17
18
  HardwareBudget,
18
19
  LayerKind,
19
20
  ModelProfile,
@@ -57,7 +58,7 @@ def window_k(tokens: int) -> str:
57
58
 
58
59
  @dataclass(frozen=True)
59
60
  class AgentPosture:
60
- """The stack's agent posture (roadmap decisions 13/21/26): ``slots`` concurrent sequences on
61
+ """The stack's agent posture: ``slots`` concurrent sequences on
61
62
  one unified KV cache, a window ladder that starts at ``floor`` and reaches ``target``, KV
62
63
  cache types tried in order, and no spilling — a model that cannot hold the floor refuses.
63
64
  The floor is 64K since decision 26 (2026-11-03): longer context is preferred, not required.
@@ -91,10 +92,10 @@ class AgentPosture:
91
92
  # (2026-10-30 user decision); it never costs the model its place on a card.
92
93
  mtp_draft_depth: int = -1
93
94
  # Where the picture reader runs (vision.READERS). "off" for every posture but stack's, which
94
- # takes images by default since roadmap decision 31 (2026-11-04); vision.priced applies it.
95
+ # takes images by default; vision.priced applies it.
95
96
  vision: str = "off"
96
97
  # The most tokens one reply may think (llama-server --reasoning-budget); 0: no cap. Stack
97
- # plans set it from their reasoning_budget option (roadmap decision 37).
98
+ # plans set it from their reasoning_budget option.
98
99
  reasoning_budget: int = 0
99
100
  # KV types the operator pinned with stack --kv (stack_debug), which Metal keeps as given.
100
101
  kv_pinned: bool = False
@@ -113,7 +114,7 @@ AGENT = AgentPosture()
113
114
  METAL_KV_TYPES: tuple[tuple[str, str], ...] = (("q8_0", "q8_0"), ("q4_0", "q4_0"))
114
115
  # Context checkpoints a Mac LLM keeps per slot (2026-11-09 user decision): each is a sequence's
115
116
  # recurrent state (27B 149.6 MiB), outside Metal's residency set and the prompt cache, so b11370's
116
- # 32 let a long agent session grow 9 GiB of pageable memory. CK8 (16gb-v3, local-118): 8 cut the
117
+ # 32 let a long agent session grow 9 GiB of pageable memory. Reference 16 GB measurement: 8 cut the
117
118
  # anon peak by 6.1 GiB with BFCL multi-turn -0.5 points [-5.0, +4.0] and agentloop 9/9 unchanged.
118
119
  METAL_CTX_CHECKPOINTS = 8
119
120
  # Spare device budget kept before stepping Metal's microbatch above DEFAULT_UBATCH:
@@ -122,7 +123,7 @@ METAL_UBATCH_HEADROOM_BYTES = 1 << 30
122
123
  METAL_PREFILL_UBATCHES: tuple[int, ...] = (PREFILL_UBATCH, 1024)
123
124
 
124
125
 
125
- def posture_for(posture: AgentPosture, backend: str) -> AgentPosture:
126
+ def posture_for(posture: AgentPosture, backend: Backend) -> AgentPosture:
126
127
  """``posture`` with the KV types the placement's backend runs at full speed. Metal runs
127
128
  without MTP (its evidence, G0-27B-MTP, is CUDA only) but keeps the prompt cache: agent loops
128
129
  are the product (2026-10-30 user decision, Macs included), so the cache's floor is part of
@@ -43,16 +43,6 @@ def add_parser(sub: argparse._SubParsersAction[argparse.ArgumentParser]) -> None
43
43
  set_cmd.add_argument("--load-ms", type=int, default=300, help="simulated warmup time")
44
44
  set_cmd.add_argument("--vram-gb", type=int, default=None, help="synthetic GPU VRAM size in GiB")
45
45
  set_cmd.add_argument("--cache-dir", default=None, help="persistent SHA256 artifact cache path")
46
- set_cmd.add_argument(
47
- "--offline-gateway",
48
- action="store_true",
49
- help="register directly in pi without starting Bifrost (simulate mode)",
50
- )
51
- set_cmd.add_argument(
52
- "--no-isolate-gateway",
53
- action="store_true",
54
- help="share the default gateway directory instead of isolating under LOCALMODELS_STATE",
55
- )
56
46
  set_cmd.add_argument(
57
47
  "--fail",
58
48
  action="append",
@@ -141,8 +131,6 @@ def cli(args: argparse.Namespace) -> int:
141
131
  "mode": args.mode,
142
132
  "download_ms": max(0, int(args.download_ms)),
143
133
  "load_ms": max(0, int(args.load_ms)),
144
- "isolate_gateway": not args.no_isolate_gateway,
145
- "offline_gateway": bool(args.offline_gateway),
146
134
  }
147
135
  if args.vram_gb is not None:
148
136
  payload["vram_gb"] = int(args.vram_gb)
@@ -52,8 +52,6 @@ class DebugConfig:
52
52
  load_ms: int = 300
53
53
  vram_gb: int | None = None
54
54
  cache_dir: str | None = None
55
- isolate_gateway: bool = True
56
- offline_gateway: bool = False
57
55
  fail: dict[str, str] = field(default_factory=dict)
58
56
 
59
57
 
@@ -96,8 +94,6 @@ def _parse_mapping(data: dict[str, Any], source: str) -> DebugConfig:
96
94
  load_ms=max(0, int(data.get("load_ms", 300))),
97
95
  vram_gb=vram_gb if vram_gb and vram_gb > 0 else None,
98
96
  cache_dir=str(cache_raw).strip() if cache_raw else None,
99
- isolate_gateway=bool(data.get("isolate_gateway", True)),
100
- offline_gateway=bool(data.get("offline_gateway", False)),
101
97
  fail=fail,
102
98
  )
103
99
 
@@ -127,8 +123,6 @@ def _parse_env(raw: str) -> DebugConfig:
127
123
  fail[step] = reason
128
124
  elif key in ("download_ms", "load_ms", "vram_gb"):
129
125
  data[key] = int(val)
130
- elif key in ("isolate_gateway", "offline_gateway"):
131
- data[key] = val.lower() not in ("0", "false", "no", "off")
132
126
  elif key == "cache_dir":
133
127
  data[key] = val
134
128
  if fail:
@@ -1,6 +1,5 @@
1
1
  {
2
- "schema_version": 2,
3
- "method": "No factor shipped. The Blackwell-only llama.cpp/CUDA MoE candidate failed the shown-pick measurement floor and its own Flash-Next training measurements; see the retained analysis.",
4
- "report": "evidence/2026-11-13-decode-calibration/REPORT.md",
5
- "factors": []
2
+ "schema_version": 2,
3
+ "method": "No factor shipped. The Blackwell-only llama.cpp/CUDA MoE candidate failed the shown-pick measurement floor and its own Flash-Next training measurements; see the retained analysis.",
4
+ "factors": []
6
5
  }
@@ -66,10 +66,13 @@ class Factor(TypedDict):
66
66
  pooled_architectures: list[str]
67
67
 
68
68
 
69
- class Calibration(TypedDict):
69
+ class _CalibrationOptional(TypedDict, total=False):
70
+ report: str
71
+
72
+
73
+ class Calibration(_CalibrationOptional):
70
74
  schema_version: int
71
75
  method: str
72
- report: str
73
76
  factors: list[Factor]
74
77
 
75
78
 
@@ -16,7 +16,7 @@ REMOVED service and directory are gone (``removed`` true); its model files an
16
16
 
17
17
  ``TRANSITIONS`` is total: every phase accepts every event, so a retried remove or purge, or a
18
18
  deploy over any earlier phase, is safe. Purging drops only the manifest entry. The permanent
19
- empty lock files ``tools/owned.lock`` (WHI-317) and ``engines/.engine.lock`` (WHI-759) are not
19
+ empty lock files ``tools/owned.lock`` and ``engines/.engine.lock`` are not
20
20
  deployment state and stay after a purge (``stack_cleanup.tidy``).
21
21
 
22
22
  A service's state word (``stack_lifecycle.liveness``: systemd ``ActiveState``, launchd or pid
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schema": "localmodels.download-mirrors/v1",
3
- "note": "Written by scripts/download_mirrors.py refresh: same SHA256 and size at master.",
3
+ "note": "SHA256-verified download mirrors for pinned model files.",
4
4
  "modelscope": {
5
5
  "4a673518b11b1c4445f9b9a9d3c40356f5ba39f6a6260dcb25f3fbfd475d9efb": {
6
6
  "repo": "ConwayResearch/Underdog-Saluki-27B-1.0",
@@ -24,9 +24,19 @@ class EngineAdapter:
24
24
  """Serve-profile flags that turn the picture reader on (``reader`` is not off)."""
25
25
  return []
26
26
 
27
- def finish_profile(self, profile: dict[str, Any], options: SuiteOptions) -> None:
27
+ def cpu_args(self, facts: HostFacts, profile: dict[str, Any]) -> list[str]:
28
+ """Serve-profile CPU threading flags added before per-card args."""
29
+ return []
30
+
31
+ def finish_profile(
32
+ self, profile: dict[str, Any], options: SuiteOptions, facts: HostFacts | None = None
33
+ ) -> None:
28
34
  """Engine defaults written into the serve profile after the recipe's own entries."""
29
35
 
36
+ def extra_limits(self, facts: HostFacts) -> dict[str, str]:
37
+ """Additional systemd ``[Service]`` limits (e.g. ``CPUWeight``) layered beneath recipe limits."""
38
+ return {}
39
+
30
40
  def device_args(self, *, apple: bool, on_gpu: bool) -> list[str]:
31
41
  """Flags that pick the engine's device, appended to the recipe's argv."""
32
42
  return []
@@ -5,12 +5,15 @@ from __future__ import annotations
5
5
 
6
6
  from typing import Any, cast
7
7
 
8
+ from localmodels import windows_job
8
9
  from localmodels.engine_adapters.base import EngineAdapter
9
10
  from localmodels.plan_envelope import PlanError
10
11
  from localmodels.probe import HostFacts
11
12
  from localmodels.records import ReleaseEngine
12
13
  from localmodels.suite import SuiteOptions, SuiteRecipe
13
14
 
15
+ POLY_LINUX_CPU_WEIGHT = "50"
16
+
14
17
 
15
18
  class StrataAdapter(EngineAdapter):
16
19
  """Strata's own engine: CUDA only."""
@@ -25,7 +28,9 @@ class StrataAdapter(EngineAdapter):
25
28
  def reader_args(self, reader: str) -> list[str]:
26
29
  return ["--vision"]
27
30
 
28
- def finish_profile(self, profile: dict[str, Any], options: SuiteOptions) -> None:
31
+ def finish_profile(
32
+ self, profile: dict[str, Any], options: SuiteOptions, facts: HostFacts | None = None
33
+ ) -> None:
29
34
  if options.reasoning_budget:
30
35
  # strata-<model>.json's default for requests that name none (Strata DETAILS, v0.2.4).
31
36
  profile["reasoning_budget_tokens"] = options.reasoning_budget
@@ -50,8 +55,65 @@ class PolyStrataAdapter(StrataAdapter):
50
55
  def reader_args(self, reader: str) -> list[str]:
51
56
  return []
52
57
 
53
- def finish_profile(self, profile: dict[str, Any], options: SuiteOptions) -> None:
58
+ def cpu_args(self, facts: HostFacts, profile: dict[str, Any]) -> list[str]:
59
+ # Leave 2-4 cores unallocated on Windows/Linux so MoE CPU expert compute does not starve
60
+ # desktop audio capture or CPU speech workers (whisper.cpp / sherpa-onnx). Apple Silicon
61
+ # runs experts on Metal unified memory and does not offload experts to CPU.
62
+ if facts["platform"] == "darwin":
63
+ return []
64
+ args = [str(item) for item in cast("list[object]", profile.get("args") or [])]
65
+ if "--threads" in args:
66
+ return []
67
+ logical = facts.get("cpu", {}).get("logical_cores")
68
+ if not isinstance(logical, int) or logical < 2:
69
+ return []
70
+ return ["--threads", str(windows_job.poly_cpu_threads(logical))]
71
+
72
+ def extra_limits(self, facts: HostFacts) -> dict[str, str]:
73
+ # Under Linux systemd-user (cgroup v2), weight PolyStrata below the default 100 so
74
+ # interactive speech workers preempt immediately while idle PolyStrata keeps full speed.
75
+ return {"CPUWeight": POLY_LINUX_CPU_WEIGHT}
76
+
77
+ def finish_profile(
78
+ self, profile: dict[str, Any], options: SuiteOptions, facts: HostFacts | None = None
79
+ ) -> None:
54
80
  # PolyStrata's server enables prompt-start warm-up only when opt-in warm_start is true,
55
- # and maps parallel: 2 to --batch 2 (WHI-1059 / WHI-1012).
81
+ # and maps parallel: 2 to --batch 2.
56
82
  profile.setdefault("warm_start", True)
57
83
  profile.setdefault("parallel", 2)
84
+ if facts is not None and facts["platform"] == "darwin":
85
+ raw_args = profile.get("args")
86
+ if isinstance(raw_args, list):
87
+ profile["args"] = _metal_unified_args([str(item) for item in raw_args])
88
+
89
+
90
+ def _metal_unified_args(args: list[str]) -> list[str]:
91
+ """Adapt discrete-GPU PolyStrata flags for Apple Silicon unified memory.
92
+
93
+ - Drop ``--ram-experts-mib``: unified memory has no separate host-RAM spill pool, so holding
94
+ spilled experts in CPU RAM competes with Metal VRAM in the same pool and collapses expert
95
+ residency.
96
+ - Select ``--metal-memory legacy`` unless explicitly overridden: PolyStrata's default
97
+ ``balanced`` policy budgets against pre-allocation free RAM (ignoring reclaimable macOS
98
+ file cache), starving Metal expert residency on 24 GB Macs (~4.5 tok/s vs ~34 tok/s with
99
+ ``legacy``, which budgets directly against ``recommendedMaxWorkingSetSize`` minus
100
+ ``--vram-reserve-mib``).
101
+ """
102
+ cleaned: list[str] = []
103
+ skip_next = False
104
+ has_metal_memory = False
105
+ for token in args:
106
+ if skip_next:
107
+ skip_next = False
108
+ continue
109
+ if token == "--ram-experts-mib":
110
+ skip_next = True
111
+ continue
112
+ if token.startswith("--ram-experts-mib="):
113
+ continue
114
+ if token == "--metal-memory" or token.startswith("--metal-memory="):
115
+ has_metal_memory = True
116
+ cleaned.append(token)
117
+ if not has_metal_memory:
118
+ cleaned.extend(["--metal-memory", "legacy"])
119
+ return cleaned
@@ -145,6 +145,40 @@ def _plan_files(
145
145
  return files
146
146
 
147
147
 
148
+ def _matching_card_args(
149
+ facts: HostFacts, r: SuiteRecipe, options: SuiteOptions
150
+ ) -> list[suite.CardArgs]:
151
+ if not options.gpu or not r.get("card_args"):
152
+ return []
153
+ # Under --gpu-memory the reserve also holds what the share leaves out of the real card
154
+ # (stack_gpu_memory.LEFT_OUT, stack_suite.poly_reserve_mib), so the room is counted on it.
155
+ left_out = int(cast("dict[str, int]", options.gpu).get("share_left_out_bytes", 0))
156
+ reserve = options.vram_reserve_mib << 20
157
+ room = options.gpu["total_bytes"] + left_out - reserve
158
+ free_room = options.gpu["free_bytes"] + left_out - reserve
159
+ return [
160
+ group
161
+ for group in r["card_args"]
162
+ if room >= group["at_least_bytes"]
163
+ and free_room >= group.get("at_least_free_bytes", 0)
164
+ and facts["platform"] in group.get("platforms", [facts["platform"]])
165
+ ]
166
+
167
+
168
+ def _effective_context(r: SuiteRecipe, matched: list[suite.CardArgs]) -> int:
169
+ base = int(r.get("context") or 0)
170
+ return max((base, *(int(group.get("context") or 0) for group in matched)), default=base)
171
+
172
+
173
+ def _set_flag(args: list[str], flag: str, value: str) -> list[str]:
174
+ out = list(args)
175
+ for idx, item in enumerate(out):
176
+ if item == flag and idx + 1 < len(out):
177
+ out[idx + 1] = value
178
+ return out
179
+ return [*out, flag, value]
180
+
181
+
148
182
  def _profile_template(
149
183
  facts: HostFacts,
150
184
  r: SuiteRecipe,
@@ -152,6 +186,8 @@ def _profile_template(
152
186
  files: list[ReusableFile],
153
187
  values: dict[str, str],
154
188
  reader: str,
189
+ matched_card_args: list[suite.CardArgs],
190
+ window: int,
155
191
  ) -> dict[str, Any]:
156
192
  """Build the rendered Strata/PolyStrata ``strata-profile.json`` template."""
157
193
  adapter = adapter_for(r["runtime"])
@@ -163,22 +199,20 @@ def _profile_template(
163
199
  profile_template["vision"] = vision.strata_section(reader, cores, exe="{vision_exe}")
164
200
  if extra := adapter.reader_args(reader):
165
201
  profile_template["args"] = [*cast("list[str]", profile_template["args"]), *extra]
166
- if options.gpu and r.get("card_args"):
167
- # Under --gpu-memory the reserve also holds what the share leaves out of the real card
168
- # (stack_gpu_memory.LEFT_OUT, stack_suite.poly_reserve_mib), so the room is counted on it.
169
- left_out = int(cast("dict[str, int]", options.gpu).get("share_left_out_bytes", 0))
170
- room = options.gpu["total_bytes"] + left_out - (options.vram_reserve_mib << 20)
202
+ if cpu_extra := adapter.cpu_args(facts, profile_template):
171
203
  profile_template["args"] = [
172
- *cast("list[str]", profile_template["args"]),
173
- *(
174
- a
175
- for group in r["card_args"]
176
- if room >= group["at_least_bytes"]
177
- and facts["platform"] in group.get("platforms", [facts["platform"]])
178
- for a in group["args"]
179
- ),
204
+ *cast("list[str]", profile_template.get("args") or []),
205
+ *cpu_extra,
180
206
  ]
181
- adapter.finish_profile(profile_template, options)
207
+ if matched_card_args:
208
+ extra_args = [a for group in matched_card_args for a in group.get("args", ())]
209
+ if extra_args:
210
+ profile_template["args"] = [*cast("list[str]", profile_template["args"]), *extra_args]
211
+ if window and window != int(r.get("context") or 0) and "args" in profile_template:
212
+ profile_template["args"] = _set_flag(
213
+ cast("list[str]", profile_template["args"]), "--max-context", str(window)
214
+ )
215
+ adapter.finish_profile(profile_template, options, facts)
182
216
  return profile_template
183
217
 
184
218
 
@@ -242,14 +276,14 @@ def _env(
242
276
  return env
243
277
 
244
278
 
245
- def _limits(r: SuiteRecipe, added_mib: int) -> dict[str, str]:
279
+ def _limits(r: SuiteRecipe, added_mib: int, extra: dict[str, str] | None = None) -> dict[str, str]:
246
280
  """The unit's ceilings, raised by what parked conversations and the picture reader add
247
281
  (both live in the engine's own cgroup); swap stays off."""
248
282
  return {
249
283
  k: f"{(suite.size_bytes(v) >> 20) + added_mib}M"
250
284
  if added_mib and k in ("MemoryHigh", "MemoryMax")
251
285
  else v
252
- for k, v in {**r.get("limits", {}), **NO_SWAP}.items()
286
+ for k, v in {**(extra or {}), **r.get("limits", {}), **NO_SWAP}.items()
253
287
  }
254
288
 
255
289
 
@@ -271,10 +305,11 @@ def _launch(
271
305
  reader: str,
272
306
  parking_mib: int,
273
307
  added_mib: int,
308
+ window: int,
274
309
  ) -> dict[str, object]:
275
310
  vram, floor = suite.gpu_bytes(r, reader)
276
311
  return {
277
- "window": r.get("context", 0),
312
+ "window": window,
278
313
  "spilled": False,
279
314
  "spill_bytes": 0,
280
315
  "reasons": [r.get("note", "")],
@@ -366,7 +401,9 @@ def build_plan(host_id: str, facts: HostFacts, r: SuiteRecipe, options: SuiteOpt
366
401
  where = deployment(r["id"], port, base, taken=hosts.deployment_dirs(host_id))
367
402
  values = _values(facts, r, options, engine, files, where)
368
403
  parking_mib = options.conversation_cache_mib if r.get("conversation_cache") else 0
369
- profile = _profile_template(facts, r, options, files, values, reader)
404
+ matched_card_args = _matching_card_args(facts, r, options)
405
+ window = _effective_context(r, matched_card_args)
406
+ profile = _profile_template(facts, r, options, files, values, reader, matched_card_args, window)
370
407
  values |= _parking_values(r, parking_mib)
371
408
  added_mib = parking_mib + vision.strata_ram_mib(r.get("vision") or {}, reader)
372
409
  plan = plan_envelope(
@@ -377,11 +414,11 @@ def build_plan(host_id: str, facts: HostFacts, r: SuiteRecipe, options: SuiteOpt
377
414
  files=files,
378
415
  engine=engine,
379
416
  placement=_placement(options, on_gpu, int(values["threads"])),
380
- launch=_launch(r, options, values, profile, reader, parking_mib, added_mib),
417
+ launch=_launch(r, options, values, profile, reader, parking_mib, added_mib, window),
381
418
  service={
382
419
  "argv": _argv(r, values, host_id, adapter.device_args(apple=apple, on_gpu=on_gpu)),
383
420
  "env": _env(r, values, adapter.library_path(engine, on_gpu=on_gpu), apple),
384
- "limits": _limits(r, added_mib),
421
+ "limits": _limits(r, added_mib, adapter.extra_limits(facts)),
385
422
  "slice": SLICE,
386
423
  "slice_limits": {**options.slice_limits, **NO_SWAP},
387
424
  },
@@ -3,7 +3,7 @@
3
3
  "tag": "b11583",
4
4
  "commit": "98801578818b26d833a1fe244870d64b0c34bb46",
5
5
  "source": "https://github.com/ggml-org/llama.cpp/releases/tag/b11583",
6
- "note": "Release asset digests from the GitHub release API, read 2026-10-20. b11583 is the first build used here with vllm-d3 support and POST /v1/systemone; decision components run its CPU builds. min_glibc is the highest GLIBC symbol version the build's binaries import (objdump -T, 2026-10-20); builds without it were not checked. The CUDA 12.8 build (read 2026-10-21) runs a decision model on the LLM's card; its cudart archive unpacks beside llama-server (RUNPATH $ORIGIN), and the 12.x runtime needs no driver newer than CUDA 13.0's. The ubuntu22.04 variant (2026-10-23) is this repository's rebuild of the same commit for hosts whose glibc is older than upstream's 2.38: scripts/build_cuda_engine.py runs the release workflow's CMake flags in nvidia/cuda:12.8.2-devel-ubuntu22.04 pinned by digest; its provenance JSON records the image, flags and toolchain, and its archives and provenance live on the project CloudFront CDN under cli/localmodels/engines/llama.cpp/b11583-cu12.8-ubuntu22.04-r3/. Every upstream Linux build links GCC's OpenMP runtime (libgomp.so.1, Debian package libgomp1; readelf NEEDED, 2026-10-23), which minimal images lack, so a plan on such a host stops instead of installing it. The ubuntu22.04-r2 rebuild (2026-10-23) carries its own libgomp.so.1 and replaces r1, which needed the system copy. The ubuntu22.04-r3 rebuild (2026-10-26) also compiles the q8_0-q4_0 FlashAttention K-V kernels (GGML_CUDA_FA_QUANTS), which the agent stack's K q8_0 / V q4_0 cache needs to decode at full speed (evidence/2026-10-25-vram-stack-probe-r3-lab12021); it replaces r2. The macOS arm64 build (digest from the release API, read 2026-10-29) is upstream's only macOS arm64 archive and has Metal: the decision model runs it on the Mac's GPU, and the CPU embedding and reranker recipes run the same build with --device none.",
6
+ "note": "Release asset digests from the GitHub release API, read 2026-10-20. b11583 is the first build used here with vllm-d3 support and POST /v1/systemone; decision components run its CPU builds. min_glibc is the highest GLIBC symbol version the build's binaries import (objdump -T, 2026-10-20); builds without it were not checked. The CUDA 12.8 build (read 2026-10-21) runs a decision model on the LLM's card; its cudart archive unpacks beside llama-server (RUNPATH $ORIGIN), and the 12.x runtime needs no driver newer than CUDA 13.0's. The ubuntu22.04 variant (2026-10-23) is this repository's rebuild of the same commit for hosts whose glibc is older than upstream's 2.38: scripts/build_cuda_engine.py runs the release workflow's CMake flags in nvidia/cuda:12.8.2-devel-ubuntu22.04 pinned by digest; its provenance JSON records the image, flags and toolchain, and its archives and provenance live on the project CloudFront CDN under cli/localmodels/engines/llama.cpp/b11583-cu12.8-ubuntu22.04-r3/. Every upstream Linux build links GCC's OpenMP runtime (libgomp.so.1, Debian package libgomp1; readelf NEEDED, 2026-10-23), which minimal images lack, so a plan on such a host stops instead of installing it. The ubuntu22.04-r2 rebuild (2026-10-23) carries its own libgomp.so.1 and replaces r1, which needed the system copy. The ubuntu22.04-r3 rebuild (2026-10-26) also compiles the q8_0-q4_0 FlashAttention K-V kernels (GGML_CUDA_FA_QUANTS), which the agent stack's K q8_0 / V q4_0 cache needs to decode at full speed; it replaces r2. The macOS arm64 build (digest from the release API, read 2026-10-29) is upstream's only macOS arm64 archive and has Metal: the decision model runs it on the Mac's GPU, and the CPU embedding and reranker recipes run the same build with --device none.",
7
7
  "builds": [
8
8
  {
9
9
  "platform": "linux",
@@ -17,11 +17,7 @@
17
17
  "name": "llama-b11583-bin-ubuntu-x64.tar.gz",
18
18
  "url": "https://github.com/ggml-org/llama.cpp/releases/download/b11583/llama-b11583-bin-ubuntu-x64.tar.gz",
19
19
  "sha256": "a4a681375770db521d15c66bd28339617b833ffc3bcc0a01ff93a883bac80438",
20
- "size_bytes": 17724487,
21
- "npm_copy": {
22
- "package": "@simplexai/engine-llama-b11583-bin-ubuntu-x64",
23
- "version": "0.0.0-sha256-a4a681375770db52"
24
- }
20
+ "size_bytes": 17724487
25
21
  }
26
22
  ],
27
23
  "min_glibc": "2.34"
@@ -38,11 +34,7 @@
38
34
  "name": "llama-b11583-bin-ubuntu-arm64.tar.gz",
39
35
  "url": "https://github.com/ggml-org/llama.cpp/releases/download/b11583/llama-b11583-bin-ubuntu-arm64.tar.gz",
40
36
  "sha256": "fc84ae8a184996ba515824fcc6f8da0fb0c26ec404a07bf1f1b407bf9528c3e2",
41
- "size_bytes": 13839236,
42
- "npm_copy": {
43
- "package": "@simplexai/engine-llama-b11583-bin-ubuntu-arm64",
44
- "version": "0.0.0-sha256-fc84ae8a184996ba"
45
- }
37
+ "size_bytes": 13839236
46
38
  }
47
39
  ]
48
40
  },
@@ -60,11 +52,7 @@
60
52
  "name": "llama-b11583-bin-ubuntu-cuda-12.8-x64.tar.gz",
61
53
  "url": "https://github.com/ggml-org/llama.cpp/releases/download/b11583/llama-b11583-bin-ubuntu-cuda-12.8-x64.tar.gz",
62
54
  "sha256": "62296a3706f02f657afbe39b8770aafdd7bb84165ab607a5cb463de5e0cecaa4",
63
- "size_bytes": 171591976,
64
- "npm_copy": {
65
- "package": "@simplexai/engine-llama-b11583-bin-ubuntu-cuda-12.8-x64",
66
- "version": "0.0.0-sha256-62296a3706f02f65"
67
- }
55
+ "size_bytes": 171591976
68
56
  },
69
57
  {
70
58
  "name": "cudart-llama-b11583-bin-ubuntu-cuda-12.8-x64.tar.gz",
@@ -87,11 +75,7 @@
87
75
  "name": "llama-b11583-bin-ubuntu22.04-r3-cuda-12.8-x64.tar.gz",
88
76
  "url": "https://d2ikbbcl3j6jz9.cloudfront.net/cli/localmodels/engines/llama.cpp/b11583-cu12.8-ubuntu22.04-r3/llama-b11583-bin-ubuntu22.04-r3-cuda-12.8-x64.tar.gz",
89
77
  "sha256": "4769908025bb3d1dfc64fbcde373931542e5baed696a282ddec3b84980e789d3",
90
- "size_bytes": 173682824,
91
- "npm_copy": {
92
- "package": "@simplexai/engine-llama-b11583-bin-ubuntu22.04-r3-cuda-12.8-x64",
93
- "version": "0.0.0-sha256-4769908025bb3d1d"
94
- }
78
+ "size_bytes": 173682824
95
79
  },
96
80
  {
97
81
  "name": "cudart-llama-b11583-bin-ubuntu22.04-r3-cuda-12.8-x64.tar.gz",
@@ -110,11 +94,7 @@
110
94
  "name": "llama-b11583-bin-macos-arm64.tar.gz",
111
95
  "url": "https://github.com/ggml-org/llama.cpp/releases/download/b11583/llama-b11583-bin-macos-arm64.tar.gz",
112
96
  "sha256": "d23832f4b847a722a64c9bf57e518c3df81dfab325942182ff17792d5d33351f",
113
- "size_bytes": 12112217,
114
- "npm_copy": {
115
- "package": "@simplexai/engine-llama-b11583-bin-macos-arm64",
116
- "version": "0.0.0-sha256-d23832f4b847a722"
117
- }
97
+ "size_bytes": 12112217
118
98
  }
119
99
  ]
120
100
  }
@@ -42,11 +42,7 @@
42
42
  "name": "app-b12588-mix-c0c3de8-linux-x64-cpu.tar.gz",
43
43
  "url": "https://github.com/unslothai/llama.cpp/releases/download/b12588-mix-c0c3de8/app-b12588-mix-c0c3de8-linux-x64-cpu.tar.gz",
44
44
  "sha256": "511b22366fa879213eb7f91016d629cdfe0054537f1c3cf46346017d968e7947",
45
- "size_bytes": 19091181,
46
- "npm_copy": {
47
- "package": "@simplexai/engine-app-b12588-mix-c0c3de8-linux-x64-cpu",
48
- "version": "0.0.0-sha256-511b22366fa87921"
49
- }
45
+ "size_bytes": 19091181
50
46
  }
51
47
  ]
52
48
  },
@@ -59,11 +55,7 @@
59
55
  "name": "llama-b12588-mix-c0c3de8-bin-macos-arm64.tar.gz",
60
56
  "url": "https://github.com/unslothai/llama.cpp/releases/download/b12588-mix-c0c3de8/llama-b12588-mix-c0c3de8-bin-macos-arm64.tar.gz",
61
57
  "sha256": "229def18e27ed740ec4f3a6508f084b25630e08d8a87ada40b00622fc496ceb8",
62
- "size_bytes": 13114900,
63
- "npm_copy": {
64
- "package": "@simplexai/engine-llama-b12588-mix-c0c3de8-bin-macos-arm64",
65
- "version": "0.0.0-sha256-229def18e27ed740"
66
- }
58
+ "size_bytes": 13114900
67
59
  }
68
60
  ]
69
61
  },
@@ -98,11 +90,7 @@
98
90
  "name": "app-b12588-mix-c0c3de8-windows-x64-cpu.zip",
99
91
  "url": "https://github.com/unslothai/llama.cpp/releases/download/b12588-mix-c0c3de8/app-b12588-mix-c0c3de8-windows-x64-cpu.zip",
100
92
  "sha256": "d80f6d21cd9a4c0a953ff3a381391b8f6f5166ba094efa72054e87a9bba1f9ab",
101
- "size_bytes": 21367159,
102
- "npm_copy": {
103
- "package": "@simplexai/engine-app-b12588-mix-c0c3de8-windows-x64-cpu",
104
- "version": "0.0.0-sha256-d80f6d21cd9a4c0a"
105
- }
93
+ "size_bytes": 21367159
106
94
  }
107
95
  ]
108
96
  }