@simplexai/localmodels-win32-x64 0.1.0-dev.69 → 0.1.0-dev.71.1

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 (24) hide show
  1. package/bootstrap.identity +1 -1
  2. package/bootstrap.sha256 +23 -23
  3. package/modules/localmodels/__init__.py +1 -1
  4. package/modules/localmodels/app.py +35 -7
  5. package/modules/localmodels/catalog.json +617 -0
  6. package/modules/localmodels/engine_adapters/suite_plan.py +4 -2
  7. package/modules/localmodels/library_poly.py +6 -1
  8. package/modules/localmodels/library_status.py +6 -0
  9. package/modules/localmodels/stack_capacity.py +37 -1
  10. package/modules/localmodels/stack_cli.py +1 -0
  11. package/modules/localmodels/stack_hardware.py +18 -16
  12. package/modules/localmodels/stack_plan.py +21 -0
  13. package/modules/localmodels/stack_progress.py +15 -0
  14. package/modules/localmodels/stack_run.py +25 -2
  15. package/modules/localmodels/stack_suite.py +54 -12
  16. package/modules/localmodels/suite.py +12 -2
  17. package/modules/{simplex_localmodels-0.1.0.dev69.dist-info → simplex_localmodels-0.1.0.dev71+hotfix.1.dist-info}/METADATA +1 -1
  18. package/modules/{simplex_localmodels-0.1.0.dev69.dist-info → simplex_localmodels-0.1.0.dev71+hotfix.1.dist-info}/RECORD +20 -20
  19. package/package.json +1 -1
  20. package/tool.json +1 -1
  21. /package/modules/{simplex_localmodels-0.1.0.dev69.dist-info → simplex_localmodels-0.1.0.dev71+hotfix.1.dist-info}/WHEEL +0 -0
  22. /package/modules/{simplex_localmodels-0.1.0.dev69.dist-info → simplex_localmodels-0.1.0.dev71+hotfix.1.dist-info}/entry_points.txt +0 -0
  23. /package/modules/{simplex_localmodels-0.1.0.dev69.dist-info → simplex_localmodels-0.1.0.dev71+hotfix.1.dist-info}/licenses/NOTICE +0 -0
  24. /package/modules/{simplex_localmodels-0.1.0.dev69.dist-info → simplex_localmodels-0.1.0.dev71+hotfix.1.dist-info}/licenses/localmodels/HERMES-LICENSE +0 -0
@@ -10,7 +10,7 @@ from __future__ import annotations
10
10
  from dataclasses import replace
11
11
 
12
12
  from localmodels import catalog as cat
13
- from localmodels import component, context_policy, gpu_specs, llm_rank, metal
13
+ from localmodels import component, context_policy, gpu_specs, llm_rank, metal, suite
14
14
  from localmodels.context_policy import AGENT, AgentPosture, cache_floor_bytes, posture_for
15
15
  from localmodels.deploy import DEFAULT_BASE_DIR
16
16
  from localmodels.engine_adapters import llama_cpp
@@ -23,6 +23,7 @@ from localmodels.estimator import (
23
23
  from localmodels.plan_envelope import PlanError
24
24
  from localmodels.planning.budget import gib
25
25
  from localmodels.probe import GPU, HostFacts
26
+ from localmodels.records import Plan
26
27
  from localmodels.stack_plan import CapacityFit, Hardware, StackOptions
27
28
 
28
29
  WDDM_NOTE = (
@@ -48,6 +49,41 @@ def decision_reserve(card_budget_bytes: int, options: StackOptions) -> int:
48
49
  return min(fitting) if fitting else 0
49
50
 
50
51
 
52
+ def start_floor(part: Plan) -> int:
53
+ """The least free VRAM a part's engine starts in, 0 when its recipe sets none. A PolyStrata
54
+ expert cache shrinks to what is free above ``launch.min_vram_free_bytes``, so its
55
+ ``vram_bytes`` is a ceiling. A plan saved before plans carried the floor takes the catalog
56
+ recipe's by model id."""
57
+ launch = part["launch"]
58
+ if "min_vram_free_bytes" in launch:
59
+ return int(str(launch["min_vram_free_bytes"]))
60
+ try:
61
+ recipe = suite.recipe(part["model"].get("id", ""))
62
+ except PlanError:
63
+ return 0
64
+ return suite.gpu_bytes(recipe, str(launch.get("vision", "off")))[1]
65
+
66
+
67
+ def start_need(vram_bytes: int, floor: int, card: GPU, options: StackOptions | None) -> int:
68
+ """Free VRAM a GPU part needs on ``card`` to start: the one measure for planning a shared
69
+ Strata card, every recipe (stack_suite), the check before ``stack apply`` starts a part and
70
+ ``stack up``.
71
+ ``options`` adds the smallest decision model kept beside the LLM (``stack apply``'s LLM and
72
+ planning); ``stack up`` starts each part on its own and passes None.
73
+
74
+ With a floor (``start_floor``): the floor, the decision reserve and VRAM_MARGIN. The engine's
75
+ own ``--vram-reserve-mib`` already keeps the display and its overshoot out of the expert
76
+ cache, so the 1 GiB agent reserve is not added again. Without one, ``vram_bytes`` with the
77
+ agent reserve (``stack apply``) or VRAM_MARGIN (``stack up``), as before."""
78
+ reserve = (
79
+ decision_reserve(component.auto_budget(card["total_bytes"]), options) if options else 0
80
+ )
81
+ if floor > 0:
82
+ return floor + reserve + component.VRAM_MARGIN
83
+ margin = AGENT_VRAM_RESERVE_BYTES if options is not None else component.VRAM_MARGIN
84
+ return vram_bytes + margin + reserve
85
+
86
+
51
87
  def device(facts: HostFacts, index: int) -> GPU:
52
88
  """Card ``index`` of ``cards``: an NVIDIA card, or a Mac's Metal GPU."""
53
89
  found = metal.device(facts)
@@ -147,6 +147,7 @@ def apply_cli(
147
147
  plan_id=plan_id,
148
148
  attempt_id=attempt_ids[-1] if attempt_ids else None,
149
149
  cause=stack_run.cause_of(exc, started=bool(attempt_ids)),
150
+ counts=stack_run.cause_counts(exc),
150
151
  )
151
152
 
152
153
  def emit_progress(event: stack_events.ProgressEvent) -> None:
@@ -10,7 +10,6 @@ from typing import Any, cast
10
10
  from localmodels import catalog as cat
11
11
  from localmodels import (
12
12
  catalog_recipes,
13
- component,
14
13
  gpu_specs,
15
14
  llm_rank,
16
15
  metal,
@@ -20,7 +19,6 @@ from localmodels import (
20
19
  suite,
21
20
  )
22
21
  from localmodels.context_policy import AgentPosture, posture_for
23
- from localmodels.estimator import AGENT_VRAM_RESERVE_BYTES
24
22
  from localmodels.planning.budget import (
25
23
  gib,
26
24
  holders,
@@ -33,6 +31,8 @@ from localmodels.records import Plan
33
31
  from localmodels.stack_capacity import decision_reserve as decision_reserve
34
32
  from localmodels.stack_capacity import device as device
35
33
  from localmodels.stack_capacity import llm_budget as llm_budget
34
+ from localmodels.stack_capacity import start_floor as start_floor
35
+ from localmodels.stack_capacity import start_need as start_need
36
36
  from localmodels.stack_picks import picks
37
37
  from localmodels.stack_plan import (
38
38
  Card,
@@ -41,6 +41,7 @@ from localmodels.stack_plan import (
41
41
  LlmFit,
42
42
  StackError,
43
43
  StackOptions,
44
+ VramShortError,
44
45
  default_options,
45
46
  platform_error,
46
47
  )
@@ -181,7 +182,8 @@ def check_shared_start(
181
182
  part: Plan, facts: HostFacts, *, options: StackOptions | None = None
182
183
  ) -> None:
183
184
  """Recheck free VRAM before starting. Shared or not, an unknown owner of other GPU work no
184
- longer refuses (roadmap decision 60): the card's free memory, less the margins, decides."""
185
+ longer refuses (roadmap decision 60): the card's free memory against ``start_need`` decides;
186
+ too little raises VramShortError (STACK_VRAM_INSUFFICIENT)."""
185
187
  from localmodels import hosts, stack_lifecycle
186
188
 
187
189
  for record in hosts.records("local"):
@@ -198,24 +200,24 @@ def check_shared_start(
198
200
  and rows[0]["health"] in ("ok", "ready")
199
201
  ):
200
202
  return # The verified healthy backend is already resident; no new allocation.
201
- needed = int(str(part["launch"].get("vram_bytes") or 0))
203
+ vram = int(str(part["launch"].get("vram_bytes") or 0))
204
+ floor = start_floor(part)
202
205
  assigned = cast(list[dict[str, Any]], part["placement"].get("gpus") or [])
203
- if needed <= 0 or not assigned:
206
+ if vram <= 0 or not assigned:
204
207
  raise StackError("the GPU-sharing model has no VRAM budget or no approved GPU placement")
205
208
  for target in assigned:
206
209
  card = next((g for g in facts.get("gpus") or [] if g["uuid"] == target["uuid"]), None)
207
- reserve = (
208
- decision_reserve(component.auto_budget(card["total_bytes"]), options)
209
- if card and options
210
- else 0
211
- )
212
- margin = AGENT_VRAM_RESERVE_BYTES if options is not None else component.VRAM_MARGIN
213
- if card is None or card["free_bytes"] < needed + margin + reserve:
214
- free = gib(card["free_bytes"]) if card else "no such card"
210
+ if card is None:
215
211
  raise StackError(
216
- f"free VRAM too low for the approved shared model ({free} free, "
217
- f"{gib(needed + margin + reserve)} needed); close programs that use the GPU "
218
- "and retry"
212
+ "the approved GPU of the model is not on this computer now; plan again"
213
+ )
214
+ needed = start_need(vram, floor, card, options)
215
+ if card["free_bytes"] < needed:
216
+ raise VramShortError(
217
+ f"free VRAM too low for the approved model ({gib(card['free_bytes'])} free, "
218
+ f"{gib(needed)} needed); close programs that use the GPU and retry",
219
+ free_bytes=card["free_bytes"],
220
+ required_bytes=needed,
219
221
  )
220
222
 
221
223
 
@@ -86,8 +86,29 @@ class StackReplanError(StackGuardError, PlanError):
86
86
  """A guarded rebuild still satisfies the existing PlanError catch contract."""
87
87
 
88
88
 
89
+ class VramShortError(StackGuardError):
90
+ """Too little free VRAM to start an approved GPU part; carries only the two byte counts."""
91
+
92
+ def __init__(self, message: str, *, free_bytes: int, required_bytes: int) -> None:
93
+ super().__init__(
94
+ message,
95
+ cause_code="STACK_VRAM_INSUFFICIENT",
96
+ public_message="free VRAM is too low to start the model; close programs that use "
97
+ "the GPU and retry",
98
+ )
99
+ self.free_bytes = free_bytes
100
+ self.required_bytes = required_bytes
101
+
102
+
89
103
  def guard_details(exc: BaseException) -> dict[str, object]:
90
104
  """Project only typed guard metadata; the lower event layer validates its values."""
105
+ if isinstance(exc, VramShortError):
106
+ return {
107
+ "causeCode": exc.cause_code,
108
+ "changedFields": exc.changed_fields,
109
+ "freeBytes": exc.free_bytes,
110
+ "requiredBytes": exc.required_bytes,
111
+ }
91
112
  if isinstance(exc, StackGuardError):
92
113
  return {"causeCode": exc.cause_code, "changedFields": exc.changed_fields}
93
114
  return {}
@@ -18,6 +18,16 @@ __all__ = ["JsonlObserver", "ProgressObserver", "PublicProgress", "forward", "re
18
18
 
19
19
  # Shared section names; approval.py continues to own the authorization checks.
20
20
  ERROR_PLAN_FIELDS = frozenset(STACK_PLAN_SECTIONS)
21
+ _MAX_SAFE_INT = (1 << 53) - 1 # JavaScript's safe integer range
22
+
23
+
24
+ def byte_counts(metadata: Mapping[str, object]) -> dict[str, int]:
25
+ """``freeBytes`` and ``requiredBytes`` of a STACK_VRAM_INSUFFICIENT guard, only when both
26
+ are plain non-negative integers in JavaScript's safe range; else none."""
27
+ counts = {key: metadata.get(key) for key in ("freeBytes", "requiredBytes")}
28
+ if all(type(v) is int and 0 <= v <= _MAX_SAFE_INT for v in counts.values()):
29
+ return {key: int(str(v)) for key, v in counts.items()}
30
+ return {}
21
31
 
22
32
 
23
33
  class JsonlObserver:
@@ -84,11 +94,13 @@ def error(code: int, details: Mapping[str, object] | None = None) -> int:
84
94
  cause = "STACK_APPLY_INTERRUPTED" if code == 130 else "STACK_APPLY_FAILED"
85
95
  category = "interrupted" if code == 130 else "execution"
86
96
  fields: list[str] | None = None
97
+ counts: dict[str, int] = {}
87
98
  guards = {
88
99
  "STACK_PLAN_CHANGED",
89
100
  "STACK_APPROVAL_MISMATCH",
90
101
  "STACK_REPLAN_FAILED",
91
102
  "STACK_APPLY_LOCKED",
103
+ "STACK_VRAM_INSUFFICIENT",
92
104
  }
93
105
  metadata = details if isinstance(details, Mapping) else {}
94
106
  cause_code = metadata.get("causeCode")
@@ -105,6 +117,8 @@ def error(code: int, details: Mapping[str, object] | None = None) -> int:
105
117
  ):
106
118
  cause, category = cause_code, "guard"
107
119
  fields = [field for field in changed if field in ERROR_PLAN_FIELDS] or None
120
+ if cause_code == "STACK_VRAM_INSUFFICIENT":
121
+ counts = byte_counts(metadata)
108
122
  event = {
109
123
  "schema": "localmodels.stack-error/v1",
110
124
  "event": "error",
@@ -112,6 +126,7 @@ def error(code: int, details: Mapping[str, object] | None = None) -> int:
112
126
  "category": category,
113
127
  "causeCode": cause,
114
128
  **({"changedFields": fields} if fields is not None else {}),
129
+ **counts,
115
130
  }
116
131
  print(json.dumps(event), flush=True)
117
132
  return code
@@ -11,7 +11,7 @@ from datetime import datetime, timezone
11
11
  from typing import Any, Literal
12
12
  from uuid import UUID, uuid4
13
13
 
14
- from localmodels import console, hosts
14
+ from localmodels import console, hosts, stack_progress
15
15
  from localmodels.approval import digest
16
16
  from localmodels.contracts import decode
17
17
  from localmodels.plan_envelope import utc_now
@@ -25,6 +25,7 @@ from localmodels.stack_plan import (
25
25
  StackRecord,
26
26
  command,
27
27
  deployments,
28
+ guard_details,
28
29
  )
29
30
 
30
31
  RunState = Literal["running", "completed", "failed", "interrupted"]
@@ -452,6 +453,10 @@ CAUSES = {
452
453
  "STACK_REPLAN_FAILED": "planning again from this computer's current state failed; "
453
454
  "run stack plan again on this computer",
454
455
  "STACK_APPLY_LOCKED": "another stack apply is running",
456
+ # Raised before a GPU part starts, also after execution began; free_bytes and
457
+ # required_bytes say by how much.
458
+ "STACK_VRAM_INSUFFICIENT": "free VRAM is too low to start the model; close programs that "
459
+ "use the GPU and retry",
455
460
  "STACK_APPLY_INTERRUPTED": "interrupted",
456
461
  "STACK_APPLY_REJECTED": "the plan could not be loaded or checked; "
457
462
  "run the same command without --json to see why",
@@ -583,6 +588,10 @@ def component_failure(record: StackRecord) -> tuple[list[str], tuple[str, str]]
583
588
  return failed, ("STACK_COMPONENT_FAILED", CAUSES["STACK_COMPONENT_FAILED"])
584
589
 
585
590
 
591
+ # Guard codes that keep their own cause when raised after execution started.
592
+ _AFTER_START = frozenset({"STACK_VRAM_INSUFFICIENT"})
593
+
594
+
586
595
  def cause_of(exc: BaseException, *, started: bool) -> tuple[str, str]:
587
596
  """(cause code, fixed message) for an apply that raised ``exc``: a guard's own code (and its
588
597
  literal public sentence when it has one), else interrupted, failed after starting, or
@@ -590,13 +599,25 @@ def cause_of(exc: BaseException, *, started: bool) -> tuple[str, str]:
590
599
  if isinstance(exc, KeyboardInterrupt):
591
600
  return "STACK_APPLY_INTERRUPTED", CAUSES["STACK_APPLY_INTERRUPTED"]
592
601
  code = getattr(exc, "cause_code", None)
593
- if isinstance(code, str) and code in CAUSES and not started:
602
+ if isinstance(code, str) and code in CAUSES and (not started or code in _AFTER_START):
594
603
  public = getattr(exc, "public_message", "")
595
604
  return code, public if isinstance(public, str) and public else CAUSES[code]
596
605
  code = "STACK_APPLY_FAILED" if started else "STACK_APPLY_REJECTED"
597
606
  return code, CAUSES[code]
598
607
 
599
608
 
609
+ def cause_counts(exc: BaseException) -> dict[str, int]:
610
+ """``free_bytes`` and ``required_bytes`` of a STACK_VRAM_INSUFFICIENT guard, else none."""
611
+ if getattr(exc, "cause_code", None) != "STACK_VRAM_INSUFFICIENT":
612
+ return {}
613
+ counts = stack_progress.byte_counts(guard_details(exc))
614
+ return (
615
+ {"free_bytes": counts["freeBytes"], "required_bytes": counts["requiredBytes"]}
616
+ if counts
617
+ else {}
618
+ )
619
+
620
+
600
621
  def machine_result(
601
622
  record: StackRecord | None,
602
623
  state: str,
@@ -606,6 +627,7 @@ def machine_result(
606
627
  attempt_id: str | None = None,
607
628
  plan: StackPlan | None = None,
608
629
  cause: tuple[str, str] | None = None,
630
+ counts: Mapping[str, int] | None = None,
609
631
  ) -> int:
610
632
  view = project(record, plan)
611
633
  if record is not None and (view is None or (state == "completed" and not view["ok"])):
@@ -644,6 +666,7 @@ def machine_result(
644
666
  else {}
645
667
  ),
646
668
  **({"cause_code": cause[0], "message": cause[1]} if cause else {}),
669
+ **(counts if cause and counts else {}),
647
670
  },
648
671
  separators=(",", ":"),
649
672
  )
@@ -32,6 +32,7 @@ from localmodels.planning.budget import (
32
32
  from localmodels.planning.llm_ram import prompt_cache_bytes, prompt_cache_fit
33
33
  from localmodels.probe import GPU, HostFacts
34
34
  from localmodels.records import Plan
35
+ from localmodels.stack_capacity import start_need
35
36
  from localmodels.stack_plan import (
36
37
  HARNESS_RAM,
37
38
  RAM_FLOOR,
@@ -262,10 +263,12 @@ def _suite_gpu(
262
263
  gpu: int | None = None,
263
264
  *,
264
265
  share_gpu: bool = False,
266
+ free_needed: Callable[[GPU], int] | None = None,
265
267
  ) -> GPU:
266
268
  """The card of the running Strata LLM, else the best idle card (``gpu``: only that one). A
267
269
  running plan without a GPU (WHI-169: a synthetic or CPU plan of the same name) runs on no
268
- suite card."""
270
+ suite card. Shared, a card at least ``need`` large passes with ``free_needed(card)`` free,
271
+ at least what the check before start will ask (``stack_capacity.start_need``)."""
269
272
  placed = running["placement"].get("gpus") if running is not None else None
270
273
  cards_of_running = (
271
274
  [c for c in placed if isinstance(c, dict)] if isinstance(placed, list) else []
@@ -290,21 +293,53 @@ def _suite_gpu(
290
293
  free = gib(mac["free_bytes"])
291
294
  raise StackError(f"{llm['id']} needs {gib(need)} of unified memory, {free} is free")
292
295
  return mac
293
- candidates = sharing_cards(facts, need) if share_gpu else idle_cards(facts, need)
296
+ if share_gpu and free_needed is not None:
297
+ candidates = [
298
+ g
299
+ for g in sharing_cards(facts, 0)
300
+ if g["total_bytes"] >= need and g["free_bytes"] >= free_needed(g)
301
+ ]
302
+ else:
303
+ candidates = sharing_cards(facts, need) if share_gpu else idle_cards(facts, need)
294
304
  cards = [g for g in candidates if gpu is None or g["index"] == gpu]
295
- if not cards:
296
- held_by = holders(facts)
305
+ if cards:
306
+ return cards[0]
307
+ which = "an" if gpu is None else f"GPU {gpu} to be an"
308
+ if share_gpu and free_needed is not None:
297
309
  seen = "; ".join(
298
- f"GPU {g['index']} {gib(g['total_bytes'])}"
299
- + "".join(f", {why}" for why in held_by.get(g["uuid"], ["idle"]))
300
- for g in facts.get("gpus") or []
310
+ f"GPU {g['index']} {gib(g['total_bytes'])}, {gib(g['free_bytes'])} free"
311
+ + (f" of {gib(free_needed(g))} needed" if g["total_bytes"] >= need else "")
312
+ for g in sharing_cards(facts, 0)
301
313
  )
302
- which = "an" if gpu is None else f"GPU {gpu} to be an"
303
314
  raise StackError(
304
- f"{llm['id']} needs {which} NVIDIA GPU with no compute processes and at least "
305
- f"{gib(need)} of memory; this host: {seen or 'no NVIDIA GPU'}"
315
+ f"{llm['id']} needs {which} NVIDIA GPU of at least {gib(need)} with enough free "
316
+ f"VRAM for it; this host: {seen or 'no NVIDIA GPU'}"
306
317
  )
307
- return cards[0]
318
+ held_by = holders(facts)
319
+ seen = "; ".join(
320
+ f"GPU {g['index']} {gib(g['total_bytes'])}"
321
+ + "".join(f", {why}" for why in held_by.get(g["uuid"], ["idle"]))
322
+ for g in facts.get("gpus") or []
323
+ )
324
+ raise StackError(
325
+ f"{llm['id']} needs {which} NVIDIA GPU with no compute processes and at least "
326
+ f"{gib(need)} of memory; this host: {seen or 'no NVIDIA GPU'}"
327
+ )
328
+
329
+
330
+ def _free_to_plan(recipe: suite.SuiteRecipe, card: GPU, options: StackOptions) -> int:
331
+ """The free VRAM a shared ``card`` needs for the recipe: never less than ``stack apply`` asks
332
+ before it starts it (``stack_capacity.start_need`` on its plan's ``vram_bytes`` and floor
333
+ there, with the picture reader this card gets and the decision reserve), and never less
334
+ than the recipe's ``vram_bytes``. A PolyStrata floor is enough to start, not to run at
335
+ speed: on a card another program is using, Windows pages the expert cache in and out
336
+ (MR !781 homewin acceptance, 2026-12-01: 6.5 GiB free decoded about 11 tok/s), so shared
337
+ planning keeps the full-cache size until the engine sizes its cache by the real free VRAM."""
338
+ reader = vision.strata_mode(
339
+ options.get("vision", "off"), card["total_bytes"], bool(recipe.get("vision"))
340
+ )
341
+ vram, floor = suite.gpu_bytes(recipe, reader)
342
+ return max(int(recipe.get("vram_bytes", 0)), start_need(vram, floor, card, options))
308
343
 
309
344
 
310
345
  def strata_parts(
@@ -334,7 +369,14 @@ def strata_parts(
334
369
  unified = metal.supported(facts) and llm_recipe["runtime"] == "strata-poly"
335
370
  need = unified_bytes(llm_recipe) if unified else int(llm_recipe.get("vram_bytes", 0))
336
371
  gpu = _suite_gpu(
337
- facts, llm_recipe, need, running_llm, options.get("gpu"), share_gpu=options["share_gpu"]
372
+ facts,
373
+ llm_recipe,
374
+ need,
375
+ running_llm,
376
+ options.get("gpu"),
377
+ share_gpu=options["share_gpu"],
378
+ # A shared card: at least what stack apply checks before it starts the LLM.
379
+ free_needed=None if unified else (lambda card: _free_to_plan(llm_recipe, card, options)),
338
380
  )
339
381
  # Strata's own free margin, the decision model, and its growth.
340
382
  reserve = STRATA_FREE_MIB + ((vram + DECISION_VRAM_GROWTH) >> 20) if vram else STRATA_FREE_MIB
@@ -32,7 +32,7 @@ from localmodels.engines import (
32
32
  from localmodels.plan_envelope import MODELSCOPE_URL, PlanError
33
33
  from localmodels.probe import GPU, HostFacts
34
34
  from localmodels.records import Plan, ReleaseEngine
35
- from localmodels.vision import StrataVision
35
+ from localmodels.vision import StrataVision, strata_gpu_mib
36
36
 
37
37
  GIB = 1 << 30
38
38
  # Engines that keep a MoE model's experts in host RAM beside a GPU cache: Strata, and PolyStrata's
@@ -127,7 +127,8 @@ class SuiteRecipe(cat.ComponentRecipe, total=False):
127
127
  prefer_over_llama: bool
128
128
  # Minimum live free VRAM (bytes) for library pricing on cards with desktop WDDM overhead.
129
129
  min_vram_free_bytes: int
130
- # Optional model-card metadata so validated strata-poly LLMs can be exposed in ``library``.
130
+ # Optional model-card metadata so validated/opt-in strata-poly LLMs can be exposed in ``library``.
131
+ library: bool
131
132
  display_name: str
132
133
  description: str
133
134
  family: str
@@ -231,6 +232,15 @@ def unbounded(plan: Plan) -> Plan:
231
232
  return plan
232
233
 
233
234
 
235
+ def gpu_bytes(r: SuiteRecipe, reader: str) -> tuple[int, int]:
236
+ """``(vram_bytes, min_vram_free_bytes)`` of the recipe's plan with picture reader ``reader``:
237
+ a reader on the GPU adds its VRAM to both. The floor is 0 when the recipe sets none; for
238
+ PolyStrata ``vram_bytes`` is the expert cache's ceiling and the floor the least it starts in."""
239
+ added = strata_gpu_mib(r.get("vision") or {}, reader) << 20
240
+ floor = int(r.get("min_vram_free_bytes") or 0)
241
+ return int(r.get("vram_bytes", 0)) + added, (floor + added if floor else 0)
242
+
243
+
234
244
  def bounded_ram(part: Plan) -> int:
235
245
  """What a bounded service may hold before the kernel reclaims from it: MemoryHigh, else
236
246
  MemoryMax, else the recipe's estimate."""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: simplex-localmodels
3
- Version: 0.1.0.dev69
3
+ Version: 0.1.0.dev71+hotfix.1
4
4
  Summary: Detect hardware, recommend and install a verified local model stack
5
5
  License-Expression: LicenseRef-Proprietary
6
6
  License-File: NOTICE
@@ -1,7 +1,7 @@
1
1
  localmodels/HERMES-LICENSE,sha256=ghVW5jNnlkUKuFLTdRF7SKSIfnHSVXlP1jGNmZgqWrY,1070
2
- localmodels/__init__.py,sha256=khqJtoiaFZaICaRb6_iCaabHvIWjIR7xzSyg3bHgi_M,171
2
+ localmodels/__init__.py,sha256=7Sqx0btndzocv3jMyNgK9IIl4PqxuyipcjSCYcIVsfc,180
3
3
  localmodels/__main__.py,sha256=8w8WmbiHQ_9XPwgI3aE0mnLTcnES_aTf7_ZZLOCal5g,28224
4
- localmodels/app.py,sha256=3j5Ng4hgPJUymhxMFKiGLv_nxMs6nJZf6abHaVhZg8Q,20306
4
+ localmodels/app.py,sha256=ZPJgyeYJUOYHvPFzQsnTAUhIDF5Oa7zY8FDtEFj0Jjc,21382
5
5
  localmodels/apple_sensors.py,sha256=V6R5miqUzlr02INOHTW1matd6KsasWjDj_zDZi52-ds,15469
6
6
  localmodels/approval.py,sha256=5E2ytq3tMjDFfDsWsLNtzoOsXowRM1sJeYlCoDLvH0E,14094
7
7
  localmodels/asr_audio.py,sha256=U8vJEKl6-5CAV0t79ZZwZzArBngXijlI1zA_vmV7eaA,4450
@@ -16,7 +16,7 @@ localmodels/bifrost_config.py,sha256=MW4oB5-I9muDmaGQumgtd0Htq-zzHd7Df4v55UPe8AE
16
16
  localmodels/bifrost_log.py,sha256=OyCQyeeoJX7olC0WHJ5chgcKq-qCUQZAHDCyYZiIbNk,6506
17
17
  localmodels/bifrost_models.py,sha256=xNBRk7h_cLCF9bGMKMssZ5oNj6hP_PzqQdEvRpTfLV0,9677
18
18
  localmodels/bifrost_pi.py,sha256=QjIYnjZGicI_1c2yi9kw1Hr0zMxQsuIjdmcMM9qIgr0,5535
19
- localmodels/catalog.json,sha256=XzZimBZkFTpXiOqOWlJcSqOVHDdCWbqfrVzV8q96BSI,354079
19
+ localmodels/catalog.json,sha256=MQLo4pBOE8J1NjxnwjXOx-fKQJ7dw3r8IojseF5qRpc,377066
20
20
  localmodels/catalog.py,sha256=qt8Wn3p0csMZeMqei79_Fpk2OH3LEaANeBlbseIBDo8,24096
21
21
  localmodels/catalog_add.py,sha256=k5gqV6QRanPTyLTsQflioCWrM7d00sBw6jHczUf0DsE,12718
22
22
  localmodels/catalog_license.py,sha256=KYYZcrW3LzP5IYQwwkC_z2jPKi-GmWowJ8QrNhyj_xE,1561
@@ -50,7 +50,7 @@ localmodels/engine_adapters/auxiliary.py,sha256=JMegRxfNkKq1iNK9Xp0GXASOp01GB3sS
50
50
  localmodels/engine_adapters/base.py,sha256=6P_jtfP0Pr290pKbygTvyb0q12ypMSbORialOfwFT-o,1666
51
51
  localmodels/engine_adapters/llama_cpp.py,sha256=m9X_ZfwGjXz_lRpWfGIVOPQ6VoetHOsMVLAwuTh36DE,19947
52
52
  localmodels/engine_adapters/strata_poly.py,sha256=MiTC_Vm3m8lr33DTZdpaPBDrf7iNzkwiq8a-ZsDn3y4,2314
53
- localmodels/engine_adapters/suite_plan.py,sha256=A6XDJq60hVfA0sMBZ7a3-EgGRp4b5ZkhPY-uqNLiC9s,15721
53
+ localmodels/engine_adapters/suite_plan.py,sha256=B33WRU9oA_TuQaqTL5q3ifRZlJTIe6HsKHvOHfERkWU,15834
54
54
  localmodels/engines-b11583.json,sha256=rrjv_B-gh3Uq7ktxvlEz_Jmcs7FaCxFCn6WiT2HlqbM,6006
55
55
  localmodels/engines-b12588-mix-c0c3de8.json,sha256=hkUt26VFhMm8fqiP31ka-wBX-gaYeeqaeHCg410qy-Q,4885
56
56
  localmodels/engines-b12757-mix-ef2df21.json,sha256=wjH3SydnhRhuRYNtAZ5Zsg1dtMqnGFf1I-Fg0byg8TA,4745
@@ -107,12 +107,12 @@ localmodels/library_jobs.py,sha256=SvTAhZVGI7f90AyWMUUAlmpoo9upXp2tKxSFSH2AQCY,3
107
107
  localmodels/library_kept.py,sha256=XCdLE4_0VW3dwY1RqmS6mi-kXh9WBlvJ37ANh24rB4s,5853
108
108
  localmodels/library_model.py,sha256=jwby4RitzmELeIaK8iXm-NCCXiMnXc20fawX8sHkxis,20772
109
109
  localmodels/library_order.py,sha256=-tJeGHBY1emWSa6i6JNYakvRSKOJ2olTdOyYjDW5OEA,8446
110
- localmodels/library_poly.py,sha256=stwJr3bDzzvRniM_DwhYsPKlBnLS12BYZeK22UWzFYA,13866
110
+ localmodels/library_poly.py,sha256=zdMcSZ-8kLesMwkxMoMhiQNmVe8fc5waDA_25qH2aY4,14134
111
111
  localmodels/library_pricing.py,sha256=33ZlRUJlcumrza4w3Ql8AMGlkwpYmRgS8kutFzGK8jU,24493
112
112
  localmodels/library_serve.py,sha256=4LXx_SQblZIlUys4hvmYA2VpgkZEkBRXBldB9gQ1bh0,34584
113
113
  localmodels/library_smoke.py,sha256=AMD3PAj0ZW8EeT0z-h1UdSvy-2bHEyoRkbG1eSj4hNI,12208
114
114
  localmodels/library_state.py,sha256=oor930P-uES5v3uUDdlA3t8DRSxwJX8Z5rdJPaX2O9g,19679
115
- localmodels/library_status.py,sha256=BsWqvOF4LSdEFM1dubQRVfA7IQv6yhrbsGoI8esA3ck,43444
115
+ localmodels/library_status.py,sha256=JPT218I0Tmn5eQLdMqEjTudLZCbru0kF1AKIm7_muek,43773
116
116
  localmodels/llm_rank.py,sha256=kQzDdDWUv4swAtepYYh7DFyh3_l3nvwfpHUaqrqiuiw,18337
117
117
  localmodels/magpie_legacy.py,sha256=xrzfcTOPEST4D-eaC5-7Zn-81McvcmFYrTKRxUm60UA,7413
118
118
  localmodels/magpie_setup.py,sha256=0kdT2noj006pzwPkPpGmrM_OxtGGFEO1HEXFyGR8UHE,29887
@@ -211,10 +211,10 @@ localmodels/stack_args.py,sha256=dVJTHdWUVOKeVIpwtsMzkFWbSiAA-lgU3rQkrhllfeU,297
211
211
  localmodels/stack_auto.py,sha256=MFhBJDi04_B98TS7e4A94mPiev8Xu8srJIEiSaEebjc,18208
212
212
  localmodels/stack_aux_gpu.py,sha256=oVQxkTnT75NrhHeDxiPLwR1tK8Lik9BjJTyg42kFodM,6724
213
213
  localmodels/stack_binding.py,sha256=1wjyZBB0ciPS7l4N9vaNkg9f6-1YJr389FHC16h3m0k,12753
214
- localmodels/stack_capacity.py,sha256=6kqY78dsWivz04-c4lCFYjJv326sXXpx24ISMg-mE0A,9097
214
+ localmodels/stack_capacity.py,sha256=NuQ28BQXWJ1BWsaABcYbkmkgPKNcNjKL6rBXy5YLLYk,10947
215
215
  localmodels/stack_card.py,sha256=R61DI1M-_nEgzbU-cTYj1CuBHNr9BOjP8vxA8IQGuQs,7793
216
216
  localmodels/stack_cleanup.py,sha256=Q-G8Z-R0KwQ9J3J536C-9WBmiZBXmP4F5P2nFtju8hU,17012
217
- localmodels/stack_cli.py,sha256=7uTE_vlmhJxsPUo3ot1IJ2xpt8PV8uvw4zIevtlC_2w,11571
217
+ localmodels/stack_cli.py,sha256=_FV8_rdAp6KrIswiLwCU2PpMa7E08-M1TONgE3WIw98,11619
218
218
  localmodels/stack_client_settings.py,sha256=HcDe86zTYGBbfp9gLYG_WF_DydPeIPnaKLY787rCFR8,4239
219
219
  localmodels/stack_clients.py,sha256=r-W-kfU1B6a2aVb-QCxZy1Xh5y39KMhhVNjlSIvh-W4,10677
220
220
  localmodels/stack_compose.py,sha256=6y6f2d07xmHGa74J1yCXfmhOpTV7M51QemiF_OD3bnA,32727
@@ -225,7 +225,7 @@ localmodels/stack_doctor.py,sha256=tkrhAKCtxBHDaspSxlnXwQM3B9vqn-_sh6EANFAnok8,2
225
225
  localmodels/stack_down.py,sha256=M3B8vbFmKtMjZ1-ir1ZpTIkQrM-S_hrCkhcG6s6SNuw,9120
226
226
  localmodels/stack_events.py,sha256=e2pQrMhFz3UJQ7_xnbtO60FRjRhZ9CcgnYP3kpRUVRk,12023
227
227
  localmodels/stack_gpu_memory.py,sha256=VZ-mGRizxJ-eFB_7abnWzKLzVorL7PppNef2p_Y2nAY,2785
228
- localmodels/stack_hardware.py,sha256=-b1pfO9YI_RwDtgJ1Ul19BC1m3JLfN95YJ5i6_xikj8,25196
228
+ localmodels/stack_hardware.py,sha256=2Ml_WWj_XoPq94Ny4tlJ14i1dRI2wV_GBuHNwdkkDRg,25283
229
229
  localmodels/stack_hardware_text.py,sha256=CCayxS1eXI8Xhi33nlmHlNtez7j3PvLidXq_b3goVOQ,9629
230
230
  localmodels/stack_journal.py,sha256=jhxRyjU_RUTqUrdxkpCzUz03Iwjtt0rf26lWtcTidV0,7481
231
231
  localmodels/stack_ledger.py,sha256=6mPVWqof0TLCaaDG0LhpClnzg05HtTSIZfRa5AEtYg0,17330
@@ -234,10 +234,10 @@ localmodels/stack_mcp.py,sha256=Zhd8NGZBSIAx3cEAXeGOFbQERYUlKE85QOdz2gzrxrQ,2859
234
234
  localmodels/stack_memory.py,sha256=G01xipoY8iSO4KSaflKH49RSZAVvkuoBdjydGcHDLFs,31148
235
235
  localmodels/stack_mlx.py,sha256=DNJb-PaWKLFhGs6-hQCTnicZEjKoLS9iFqQM1leqF0Q,10097
236
236
  localmodels/stack_picks.py,sha256=D-CKl0ifL0gq_X1DO8tWm8fAO4wuwiiiuR9EeFaVeKA,9248
237
- localmodels/stack_plan.py,sha256=00YhoeQnmLLA82fc6NoCbY2DeNawV-EWt2XFMSHCO44,28537
237
+ localmodels/stack_plan.py,sha256=kiQKfvY_1x81PQ26tlK5fAU0r6RY4ecppf3gRzDznuI,29326
238
238
  localmodels/stack_ports.py,sha256=LM1oRToTHgAU2FaY729QAakmbvU-nJiQK2dQnatlM-I,8673
239
239
  localmodels/stack_preflight.py,sha256=SDNr4qXRDwkeuEtzWsAtiG_hXGDsDc6azqKsFRjknG0,26615
240
- localmodels/stack_progress.py,sha256=lYFxVUSAGkfEutoY9V_L6pe_WEAwVGB0trVewWIhHlE,4038
240
+ localmodels/stack_progress.py,sha256=Rj-mQ7Q0QaGosGfkSARzst0ud0ASnOw5ngUt2JdQ0oo,4770
241
241
  localmodels/stack_remove.py,sha256=XGM4GnsjVi5FFxbTDm_T3IW9vjos-CdFkYcFnaO-Tpc,16353
242
242
  localmodels/stack_research.py,sha256=xvdUigkLS1CLEUYKth0WZbpb4VlbRLpHwyrUaw9KwgA,27724
243
243
  localmodels/stack_research_demo.py,sha256=S-A1vUYhem763ZlozlIC6u8f_jAYYgd8s6QfSAPltrY,4612
@@ -245,8 +245,8 @@ localmodels/stack_research_plan.py,sha256=63dsvfbsW6NpVMNfm0FyW7TPa2OvSjYmIc3mIQ
245
245
  localmodels/stack_review.py,sha256=RfWtflCW7l21v3FpwKuOD6BkODBErEl521QK_zUPi1g,7335
246
246
  localmodels/stack_rollback.py,sha256=Cncl0_DxUayhmNPiDDLz0W0ckPTjd2_e2vJT0h3VOJY,12591
247
247
  localmodels/stack_route.py,sha256=x1TE4rPWkRHhsxffCF5HIFFj_h7imT4q6YmQpJpa6Cw,13292
248
- localmodels/stack_run.py,sha256=1frQtXOVTXlbKQtlP45Mk1B-M5IGYBtvmbMkMtEpQUA,29062
249
- localmodels/stack_suite.py,sha256=STubYIkGYSFyPypfRYBuO8onHVY9Th_1OEA7VytVsD0,33286
248
+ localmodels/stack_run.py,sha256=6SrFwUESgqnCVbjL-2jLYXzjV3EWLbxBxigcwyx_hjQ,30042
249
+ localmodels/stack_suite.py,sha256=h8--L4A_Uwcqhutx7GKR4YZomhQn62aE8mHZTqrI9go,35463
250
250
  localmodels/stack_summary.py,sha256=8QpzusExAY12_BlXzMosQ3xCRZUHFWDEszeoVBcXs2c,12558
251
251
  localmodels/stack_try.py,sha256=ILtFc0yNaAFxQSaES4sKMBjStovZUenPoOPH2o3n4R4,17332
252
252
  localmodels/stack_try_client.py,sha256=Qt6w4ElbNRZbczGfz210SZSmi9Z_njNAmRP9PdncqyU,8719
@@ -281,7 +281,7 @@ localmodels/startlux-decide-83fe6c7d.txt,sha256=qiSW7jH1MQAJB95w_xF5CdJMB9mJtzFd
281
281
  localmodels/strata-poly-serve-0.2.20-poly.1.txt,sha256=lBWJKdzxPR4Ym45VKuP2RvxIR2fk1H7s8sN8v0cTCBY,21425
282
282
  localmodels/strata-poly-serve-0.2.20-poly.7.txt,sha256=Z4ajNV4sfshw4haQkaD7AXP1XQSdDe_j50edrPXlxbQ,36043
283
283
  localmodels/strata_poly_server.py,sha256=yahM-k5N-tgVEPxvERx9t2kp1WbNlsSfr9xfjlRH9bE,6015
284
- localmodels/suite.py,sha256=bSTCT9DtokizB4PeJ2tNya2NbvRyI4gFhGxr_a_i3t4,11150
284
+ localmodels/suite.py,sha256=i4P5n-xhLrpewbNKZhBlLFweHF-VM45Z_tTBgtMVlyM,11743
285
285
  localmodels/telemetry_math.py,sha256=AqUwN6cBBWYJDIfGA7cDvKQ57YXBcAcXED6qrqmV4A8,19357
286
286
  localmodels/tool_archive.py,sha256=Ir4tLWMDx3FFA7vnLV1HiOsHC5k59uyB69lH60X1P4s,4403
287
287
  localmodels/tools.json,sha256=P8U9DprgAOe46BtKFKHjYnw2ZRfr052iKu2qgd-6_SU,67351
@@ -313,9 +313,9 @@ localmodels/web/view/view.css,sha256=BJ0JuMNyj9a51EiiwHvmM8NrEJrh8oP7HzSfrHBwwX0
313
313
  localmodels/web/view/view.js,sha256=WzAe2f-GTVFmnhM6EXXrTVZh20frhX7Mskl_vA1_eb8,115973
314
314
  localmodels/win_probe.py,sha256=hFNeocVK62i_v741e38Z56LWm5zp_y9PfotqZo926z8,7151
315
315
  localmodels/windows_job.py,sha256=075FQtmz8yphvGXMQmSnQwGw6rbzAqMPQ-h46emyKNY,3058
316
- simplex_localmodels-0.1.0.dev69.dist-info/licenses/NOTICE,sha256=GslWIybnsKOhUvDrZw2Cq9EDjqlxoFdEU2gsaKXuW44,3417
317
- simplex_localmodels-0.1.0.dev69.dist-info/licenses/localmodels/HERMES-LICENSE,sha256=ghVW5jNnlkUKuFLTdRF7SKSIfnHSVXlP1jGNmZgqWrY,1070
318
- simplex_localmodels-0.1.0.dev69.dist-info/WHEEL,sha256=1dD_GoEqEIxQ7VnrUExgdj_eExY4b4UgfR0iBlGKVac,80
319
- simplex_localmodels-0.1.0.dev69.dist-info/entry_points.txt,sha256=OjBZISrGAXgRMRDqrq-m26_nLFmNZNNhbLtJiunIgfc,59
320
- simplex_localmodels-0.1.0.dev69.dist-info/METADATA,sha256=jQvrL4_jkn6758gxc99_i8vL_e5biOXQ2z1K-DDJwIc,312
321
- simplex_localmodels-0.1.0.dev69.dist-info/RECORD,,
316
+ simplex_localmodels-0.1.0.dev71+hotfix.1.dist-info/licenses/NOTICE,sha256=GslWIybnsKOhUvDrZw2Cq9EDjqlxoFdEU2gsaKXuW44,3417
317
+ simplex_localmodels-0.1.0.dev71+hotfix.1.dist-info/licenses/localmodels/HERMES-LICENSE,sha256=ghVW5jNnlkUKuFLTdRF7SKSIfnHSVXlP1jGNmZgqWrY,1070
318
+ simplex_localmodels-0.1.0.dev71+hotfix.1.dist-info/WHEEL,sha256=1dD_GoEqEIxQ7VnrUExgdj_eExY4b4UgfR0iBlGKVac,80
319
+ simplex_localmodels-0.1.0.dev71+hotfix.1.dist-info/entry_points.txt,sha256=OjBZISrGAXgRMRDqrq-m26_nLFmNZNNhbLtJiunIgfc,59
320
+ simplex_localmodels-0.1.0.dev71+hotfix.1.dist-info/METADATA,sha256=DgFE7UxZWPHAWkP7lFK79rKBgur-8wdiHo3GC2oO_b0,321
321
+ simplex_localmodels-0.1.0.dev71+hotfix.1.dist-info/RECORD,,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simplexai/localmodels-win32-x64",
3
- "version": "0.1.0-dev.69",
3
+ "version": "0.1.0-dev.71.1",
4
4
  "license": "UNLICENSED",
5
5
  "files": [
6
6
  "**/*"