@simplexai/localmodels-win32-x64 0.1.0-dev.107 → 0.1.0-dev.108

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 (35) hide show
  1. package/README.md +1 -1
  2. package/bootstrap.identity +1 -1
  3. package/bootstrap.sha256 +34 -31
  4. package/modules/localmodels/__init__.py +1 -1
  5. package/modules/localmodels/catalog.json +217 -10
  6. package/modules/localmodels/catalog.py +11 -1
  7. package/modules/localmodels/catalog_recipes.py +15 -0
  8. package/modules/localmodels/engine_adapters/llama_cpp.py +11 -5
  9. package/modules/localmodels/engine_adapters/strata_poly.py +1 -1
  10. package/modules/localmodels/engines-b12973.json +248 -0
  11. package/modules/localmodels/library_cli.py +68 -1
  12. package/modules/localmodels/library_elastic.py +1 -1
  13. package/modules/localmodels/library_pricing.py +1 -2
  14. package/modules/localmodels/library_unload.py +274 -0
  15. package/modules/localmodels/probe.py +98 -7
  16. package/modules/localmodels/service_roots.py +148 -0
  17. package/modules/localmodels/service_upgrade.py +46 -1
  18. package/modules/localmodels/services_cli.py +8 -28
  19. package/modules/localmodels/speech_workers.py +4 -4
  20. package/modules/localmodels/stack_args.py +11 -4
  21. package/modules/localmodels/stack_down.py +368 -42
  22. package/modules/localmodels/stack_memory.py +1 -1
  23. package/modules/localmodels/stack_preflight.py +2 -2
  24. package/modules/localmodels/stack_view_llm.py +2 -2
  25. package/modules/localmodels/tts_backend_speechcpp.py +2 -2
  26. package/modules/localmodels/tts_workers.py +3 -3
  27. package/modules/{simplex_localmodels-0.1.0.dev107.dist-info → simplex_localmodels-0.1.0.dev108.dist-info}/METADATA +1 -1
  28. package/modules/{simplex_localmodels-0.1.0.dev107.dist-info → simplex_localmodels-0.1.0.dev108.dist-info}/RECORD +30 -27
  29. package/package.json +1 -1
  30. package/tool.json +1 -1
  31. /package/modules/{simplex_localmodels-0.1.0.dev107.dist-info → simplex_localmodels-0.1.0.dev108.dist-info}/WHEEL +0 -0
  32. /package/modules/{simplex_localmodels-0.1.0.dev107.dist-info → simplex_localmodels-0.1.0.dev108.dist-info}/entry_points.txt +0 -0
  33. /package/modules/{simplex_localmodels-0.1.0.dev107.dist-info → simplex_localmodels-0.1.0.dev108.dist-info}/licenses/LICENSE +0 -0
  34. /package/modules/{simplex_localmodels-0.1.0.dev107.dist-info → simplex_localmodels-0.1.0.dev108.dist-info}/licenses/NOTICE +0 -0
  35. /package/modules/{simplex_localmodels-0.1.0.dev107.dist-info → simplex_localmodels-0.1.0.dev108.dist-info}/licenses/localmodels/HERMES-LICENSE +0 -0
@@ -209,6 +209,8 @@ _DRIVER_RE = re.compile(r"\b(?:Driver|KMD)\s+Version\s*:\s*(\d+(?:\.\d+)*)", re.
209
209
  HOST_LIBRARIES = ("libgomp.so.1",)
210
210
  DETAIL_FIELDS = ("compute_cap", "memory.reserved", "display_active") # nvidia-smi names
211
211
  _UNLIMITED = 1 << 60 # cgroup v1 reports "no limit" as a page-aligned LONG_MAX
212
+ _PROC_SELF_CGROUP = "/proc/self/cgroup"
213
+ _V1_CPU_CONTROLLERS = ("cpu", "cpu,cpuacct", "cpuacct,cpu")
212
214
 
213
215
 
214
216
  def _run(
@@ -579,9 +581,21 @@ def environment(root: str = "/") -> str:
579
581
  return "bare" if init is not None else "unknown"
580
582
 
581
583
 
584
+ def _cgroup_rows(root: str) -> list[list[str]]:
585
+ return [r.split(":", 2) for r in (_text(_at(root, _PROC_SELF_CGROUP)) or "").splitlines()]
586
+
587
+
588
+ def _cgroup_levels(mount: str, path: str) -> list[str]:
589
+ # Without a cgroup namespace the path is the host's, mounted as a container's root: walk up.
590
+ parts = [p for p in path.strip().split("/") if p]
591
+ return [
592
+ d for n in range(len(parts), -1, -1) if os.path.isdir(d := os.path.join(mount, *parts[:n]))
593
+ ]
594
+
595
+
582
596
  def cgroup_memory(root: str = "/") -> CgroupMemory | None:
583
597
  """Memory ceiling of this process's cgroup (tightest limit-usage headroom across ancestors)."""
584
- rows = [r.split(":", 2) for r in (_text(_at(root, "/proc/self/cgroup")) or "").splitlines()]
598
+ rows = _cgroup_rows(root)
585
599
  v1 = next((r[2] for r in rows if len(r) == 3 and "memory" in r[1].split(",")), None)
586
600
  if v1 is not None:
587
601
  spec = ("/sys/fs/cgroup/memory", v1, ("memory.limit_in_bytes", "memory.usage_in_bytes"), 1)
@@ -593,11 +607,7 @@ def cgroup_memory(root: str = "/") -> CgroupMemory | None:
593
607
 
594
608
 
595
609
  def _tightest(mount: str, path: str, files: tuple[str, str], v: int) -> CgroupMemory:
596
- # Without a cgroup namespace the path is the host's, mounted as a container's root: walk up.
597
- parts = [p for p in path.strip().split("/") if p]
598
- levels = [
599
- d for n in range(len(parts), -1, -1) if os.path.isdir(d := os.path.join(mount, *parts[:n]))
600
- ]
610
+ levels = _cgroup_levels(mount, path)
601
611
  readable = bool(levels)
602
612
  best: tuple[int | None, int | None, int | None] = (None, None, None)
603
613
  for level in levels:
@@ -615,6 +625,87 @@ def _tightest(mount: str, path: str, files: tuple[str, str], v: int) -> CgroupMe
615
625
  return {"version": v, "limit_bytes": best[1], "usage_bytes": best[2], "readable": readable}
616
626
 
617
627
 
628
+ def _tighter_ratio(
629
+ current: tuple[int, int] | None, quota: int, period: int
630
+ ) -> tuple[int, int] | None:
631
+ if quota <= 0 or period <= 0:
632
+ return current
633
+ if current is None or quota * current[1] < current[0] * period:
634
+ return (quota, period)
635
+ return current
636
+
637
+
638
+ def _cgroup_v2_cpu_ratio(root: str, path: str) -> tuple[int, int] | None:
639
+ best: tuple[int, int] | None = None
640
+ for level in _cgroup_levels(_at(root, "/sys/fs/cgroup"), path):
641
+ parts = (_text(os.path.join(level, "cpu.max")) or "").split()
642
+ if len(parts) < 2 or parts[0] == "max":
643
+ continue
644
+ try:
645
+ best = _tighter_ratio(best, int(parts[0]), int(parts[1]))
646
+ except ValueError:
647
+ continue
648
+ return best
649
+
650
+
651
+ def _cgroup_v1_cpu_ratio(root: str, controller: str, path: str) -> tuple[int, int] | None:
652
+ mounts = [
653
+ _at(root, f"/sys/fs/cgroup/{name}")
654
+ for name in dict.fromkeys((controller, *_V1_CPU_CONTROLLERS))
655
+ if name in _V1_CPU_CONTROLLERS
656
+ ]
657
+ best: tuple[int, int] | None = None
658
+ for mount in mounts:
659
+ if not os.path.isdir(mount):
660
+ continue
661
+ for level in _cgroup_levels(mount, path):
662
+ raw_q = (_text(os.path.join(level, "cpu.cfs_quota_us")) or "").strip()
663
+ raw_p = (_text(os.path.join(level, "cpu.cfs_period_us")) or "").strip()
664
+ if not raw_q or not raw_p:
665
+ continue
666
+ try:
667
+ best = _tighter_ratio(best, int(raw_q), int(raw_p))
668
+ except ValueError:
669
+ continue
670
+ return best
671
+
672
+
673
+ def cgroup_cpu_quota(root: str = "/") -> int | None:
674
+ """Effective logical CPU cap from this process's cgroup v1/v2 CPU quota, or None."""
675
+ rows = _cgroup_rows(root)
676
+ best: tuple[int, int] | None = None
677
+ v1 = next(((r[1], r[2]) for r in rows if len(r) == 3 and "cpu" in r[1].split(",")), None)
678
+ if v1 is not None and (ratio := _cgroup_v1_cpu_ratio(root, v1[0], v1[1])) is not None:
679
+ best = _tighter_ratio(best, ratio[0], ratio[1])
680
+ v2 = next((r[2] for r in rows if len(r) == 3 and r[:2] == ["0", ""]), None)
681
+ if v2 is not None and (ratio := _cgroup_v2_cpu_ratio(root, v2)) is not None:
682
+ best = _tighter_ratio(best, ratio[0], ratio[1])
683
+ if best is None:
684
+ return None
685
+ quota, period = best
686
+ return max(1, (quota + period - 1) // period)
687
+
688
+
689
+ def logical_cores(root: str = "/") -> int | None:
690
+ """Effective logical CPUs for this process, capped by Linux affinity and cgroup quota."""
691
+ count = os.cpu_count()
692
+ if not sys.platform.startswith("linux"):
693
+ return count
694
+ caps: list[int] = [count] if isinstance(count, int) and count > 0 else []
695
+ getaffinity = getattr(os, "sched_getaffinity", None)
696
+ if callable(getaffinity):
697
+ try:
698
+ affinity = len(getaffinity(0))
699
+ if affinity > 0:
700
+ caps.append(affinity)
701
+ except OSError:
702
+ pass
703
+ quota = cgroup_cpu_quota(root)
704
+ if quota is not None and quota > 0:
705
+ caps.append(quota)
706
+ return min(caps) if caps else count
707
+
708
+
618
709
  def parse_field_csv(text: str) -> dict[int, str]:
619
710
  """{index: value} of an ``index,FIELD`` query; [N/A] and [Not Supported] cells left out."""
620
711
  rows = csv.reader(text.strip().splitlines(), skipinitialspace=True)
@@ -733,7 +824,7 @@ def collect(
733
824
  "libc": " ".join(platform.libc_ver()).strip(),
734
825
  },
735
826
  "python": platform.python_version(),
736
- "cpu": {"model": _cpu_model(), "logical_cores": os.cpu_count()},
827
+ "cpu": {"model": _cpu_model(), "logical_cores": logical_cores()},
737
828
  "ram": {
738
829
  **(metal_probe.ram_status() if sys.platform == "darwin" else {}),
739
830
  "total_bytes": ram_total,
@@ -0,0 +1,148 @@
1
+ """Discovery and private registry of optional ``foundations`` controller roots.
2
+
3
+ ``foundations ensure`` records its ``--root`` under ``$LOCALMODELS_STATE/foundations/roots.json``
4
+ so ``stack down --all`` can cleanly stop active controllers without requiring callers to track
5
+ every root separately. Legacy installations that predate this registry are also discovered across
6
+ standard sibling/parent layouts, strictly verified against ``control.json["stateDir"]``.
7
+ """
8
+
9
+ from __future__ import annotations
10
+
11
+ import contextlib
12
+ import json
13
+ import os
14
+ from collections.abc import Sequence
15
+ from pathlib import Path
16
+
17
+ from localmodels import hosts, service_control, service_upgrade
18
+
19
+ ROOTS_SCHEMA = "localmodels.foundations-roots/v1"
20
+
21
+
22
+ def roots_path(state_dir: Path | None = None) -> Path:
23
+ base = hosts.state_dir() if state_dir is None else state_dir
24
+ return base / "foundations" / "roots.json"
25
+
26
+
27
+ def _lock_path(state_dir: Path | None = None) -> Path:
28
+ base = hosts.state_dir() if state_dir is None else state_dir
29
+ return base / "foundations" / ".roots.lock"
30
+
31
+
32
+ def _norm_key(path: str | Path) -> str:
33
+ return os.path.normcase(os.path.realpath(os.path.expanduser(str(path))))
34
+
35
+
36
+ def _same_path(raw: object, target: Path) -> bool:
37
+ if not isinstance(raw, str) or not raw.strip():
38
+ return False
39
+ return _norm_key(raw) == _norm_key(target)
40
+
41
+
42
+ def read_registered_roots(state_dir: Path | None = None) -> list[Path]:
43
+ """Read controller roots previously registered under ``state_dir`` (ignores corrupt files)."""
44
+ path = roots_path(state_dir)
45
+ try:
46
+ raw = json.loads(path.read_text(encoding="utf-8"))
47
+ except (OSError, ValueError):
48
+ return []
49
+ entries = raw.get("roots") if isinstance(raw, dict) else raw
50
+ if not isinstance(entries, list):
51
+ return []
52
+ found: list[Path] = []
53
+ seen: set[str] = set()
54
+ for item in entries:
55
+ if not isinstance(item, str) or not item.strip():
56
+ continue
57
+ candidate = Path(os.path.expanduser(item))
58
+ if not candidate.is_absolute():
59
+ continue
60
+ key = _norm_key(candidate)
61
+ if key not in seen:
62
+ seen.add(key)
63
+ found.append(candidate)
64
+ return found
65
+
66
+
67
+ def register_root(state_dir: Path, root: Path) -> None:
68
+ """Atomically record ``root`` under ``state_dir/foundations/roots.json`` (best-effort)."""
69
+ resolved_root = Path(os.path.abspath(os.path.expanduser(str(root))))
70
+ target_key = _norm_key(resolved_root)
71
+ parent = roots_path(state_dir).parent
72
+ with contextlib.suppress(OSError, ValueError):
73
+ if not parent.exists():
74
+ parent.mkdir(parents=True, exist_ok=True)
75
+ if os.name != "nt":
76
+ parent.chmod(0o700)
77
+ with hosts.file_lock(_lock_path(state_dir)):
78
+ existing = read_registered_roots(state_dir)
79
+ if any(_norm_key(entry) == target_key for entry in existing):
80
+ return
81
+ updated = [str(entry) for entry in existing] + [str(resolved_root)]
82
+ hosts.save_private(
83
+ roots_path(state_dir),
84
+ {"schema": ROOTS_SCHEMA, "roots": updated},
85
+ )
86
+
87
+
88
+ def _legacy_candidates(state_dir: Path) -> list[Path]:
89
+ """Well-known controller root locations relative to ``state_dir`` for pre-registry installs."""
90
+ resolved = Path(os.path.abspath(os.path.expanduser(str(state_dir))))
91
+ candidates: list[Path] = [
92
+ resolved / "foundations",
93
+ resolved.parent,
94
+ resolved.parent / "model-services",
95
+ ]
96
+ if resolved.parent.parent != resolved.parent:
97
+ candidates.append(resolved.parent.parent / "model-services")
98
+ return candidates
99
+
100
+
101
+ def _matches_state_dir(candidate: Path, state_dir: Path, *, registered: bool) -> bool:
102
+ if candidate.is_symlink():
103
+ return False
104
+ control_path = candidate / "control.json"
105
+ if not control_path.is_file() or control_path.is_symlink():
106
+ return False
107
+ try:
108
+ config = service_control.read_configuration(candidate)
109
+ except (OSError, ValueError):
110
+ if not registered:
111
+ return False
112
+ lock_path = candidate / "worker.lock"
113
+ if not lock_path.exists() or lock_path.is_symlink():
114
+ return False
115
+ try:
116
+ return not service_upgrade.idle(candidate)
117
+ except OSError:
118
+ return False
119
+ return _same_path(config.get("stateDir"), state_dir)
120
+
121
+
122
+ def discover_roots(
123
+ state_dir: Path | None = None,
124
+ explicit: Sequence[Path] = (),
125
+ ) -> list[tuple[Path, bool]]:
126
+ """Return deduplicated ``(root, is_explicit)`` controller roots belonging to ``state_dir``."""
127
+ base = hosts.state_dir() if state_dir is None else state_dir
128
+ found: list[tuple[Path, bool]] = []
129
+ seen: set[str] = set()
130
+
131
+ for raw in explicit:
132
+ candidate = Path(os.path.abspath(os.path.expanduser(str(raw))))
133
+ key = _norm_key(candidate)
134
+ if key not in seen:
135
+ seen.add(key)
136
+ found.append((candidate, True))
137
+
138
+ registered = read_registered_roots(base)
139
+ registered_keys = {_norm_key(entry) for entry in registered}
140
+ for candidate in [*registered, *_legacy_candidates(base)]:
141
+ key = _norm_key(candidate)
142
+ if key in seen:
143
+ continue
144
+ if _matches_state_dir(candidate, base, registered=key in registered_keys):
145
+ seen.add(key)
146
+ found.append((candidate, False))
147
+
148
+ return found
@@ -22,8 +22,17 @@ import urllib.error
22
22
  import urllib.request
23
23
  from collections.abc import Callable
24
24
  from pathlib import Path
25
+ from typing import Any
25
26
 
26
- from localmodels import process_identity, process_windows, runtime_io, service_autostart
27
+ from localmodels import (
28
+ process_identity,
29
+ process_windows,
30
+ runtime_io,
31
+ service_autostart,
32
+ service_control,
33
+ )
34
+
35
+ STOP_SCHEMA = "localmodels.service-controller-stop/v1"
27
36
 
28
37
  GRACE = 15.0 # an install in progress finishes its current step before the worker exits
29
38
  KILL_AFTER = 10.0 # after SIGTERM, before SIGKILL
@@ -426,3 +435,39 @@ def retire_implicit_jobs(root: Path) -> None:
426
435
  CHANGED, "another model controller took the lock during the upgrade"
427
436
  ) from None
428
437
  raise
438
+
439
+
440
+ def stop_controller(root: Path) -> dict[str, Any]:
441
+ """End this root's controller and its autostart, for an uninstaller or full shutdown.
442
+
443
+ Idempotent: nothing under ``root``, or nothing running, is a successful stop.
444
+ """
445
+ result: dict[str, Any] = {
446
+ "schema": STOP_SCHEMA,
447
+ "root": str(root),
448
+ "stopped": False,
449
+ "method": None,
450
+ "autostart": "none",
451
+ }
452
+ if not (root / "control.json").is_file():
453
+ return result
454
+ try:
455
+ _stop_controller(root, result)
456
+ except (OSError, ValueError, subprocess.SubprocessError) as error:
457
+ result.update(ok=False, stopped=False, error=str(error))
458
+ if isinstance(error, ControllerError):
459
+ result["code"] = error.code
460
+ return result
461
+
462
+
463
+ def _stop_controller(root: Path, result: dict[str, Any]) -> None:
464
+ with runtime_io.private_lock(root / "ensure.lock"):
465
+ config = service_control.read_configuration(root)
466
+ config["stopped"] = True
467
+ runtime_io.write_private_json(root / "control.json", config)
468
+ running = not idle(root)
469
+ result["autostart"] = service_autostart.unregister(root)
470
+ if not running and idle(root):
471
+ return
472
+ result["stopped"] = True
473
+ result["method"] = end_controller(root) or "systemd"
@@ -19,7 +19,7 @@ from localmodels.service_control import controller_available as controller_avail
19
19
  from localmodels.service_control import read_configuration as read_configuration
20
20
  from localmodels.service_jobs import ACTIVE, ROLES, selected_roles
21
21
 
22
- STOP_SCHEMA = "localmodels.service-controller-stop/v1"
22
+ STOP_SCHEMA = service_upgrade.STOP_SCHEMA
23
23
 
24
24
 
25
25
  def stop(root: Path) -> dict[str, Any]:
@@ -27,35 +27,14 @@ def stop(root: Path) -> dict[str, Any]:
27
27
 
28
28
  Idempotent: nothing under ``root``, or nothing running, is a successful stop.
29
29
  """
30
- result: dict[str, Any] = {
31
- "schema": STOP_SCHEMA,
32
- "root": str(root),
33
- "stopped": False,
34
- "method": None,
35
- "autostart": "none",
36
- }
37
- if not (root / "control.json").is_file():
38
- return result
39
- try:
40
- _stop(root, result)
41
- except (OSError, ValueError, subprocess.SubprocessError) as error:
42
- result.update(ok=False, stopped=False, error=str(error))
43
- if isinstance(error, service_upgrade.ControllerError):
44
- result["code"] = error.code
45
- return result
30
+ return service_upgrade.stop_controller(root)
46
31
 
47
32
 
48
- def _stop(root: Path, result: dict[str, Any]) -> None:
49
- with runtime_io.private_lock(root / "ensure.lock"):
50
- config = read_configuration(root)
51
- config["stopped"] = True
52
- runtime_io.write_private_json(root / "control.json", config)
53
- running = not service_upgrade.idle(root)
54
- result["autostart"] = service_autostart.unregister(root)
55
- if not running and service_upgrade.idle(root):
56
- return
57
- result["stopped"] = True
58
- result["method"] = service_upgrade.end_controller(root) or "systemd"
33
+ def _register_controller_root(config: dict[str, Any], root: Path) -> None:
34
+ if isinstance(state_dir := config.get("stateDir"), str) and state_dir:
35
+ from localmodels import service_roots
36
+
37
+ service_roots.register_root(Path(state_dir), root)
59
38
 
60
39
 
61
40
  def ensure(
@@ -132,6 +111,7 @@ def ensure(
132
111
  runtime_io.write_private_json(config_path, config)
133
112
  config.pop("stopped", None)
134
113
  runtime_io.write_private_json(config_path, config)
114
+ _register_controller_root(config, root)
135
115
  runtime_io.private_permissions(key_path)
136
116
  key = json.loads(key_path.read_text())
137
117
  if os.name != "nt":
@@ -35,7 +35,7 @@ from localmodels import (
35
35
  speech_worker_sensevoice,
36
36
  windows_job,
37
37
  )
38
- from localmodels.probe import HostFacts
38
+ from localmodels.probe import HostFacts, logical_cores
39
39
  from localmodels.sidecar_http import (
40
40
  GPU_OOM_SIGNATURES as GPU_OOM_SIGNATURES,
41
41
  )
@@ -304,7 +304,7 @@ def whisper_argv(
304
304
  threads: int | None = None,
305
305
  ) -> list[str]:
306
306
  """Build ``whisper-server`` argv (no ``--convert``, ``-mc 0``, ``-ng`` on CPU, ``-fa`` on GPU)."""
307
- num_threads = threads if threads is not None else min(4, max(1, os.cpu_count() or 1))
307
+ num_threads = threads if threads is not None else min(4, max(1, logical_cores() or 1))
308
308
  argv = [
309
309
  binary,
310
310
  "-m",
@@ -335,7 +335,7 @@ def sensevoice_argv(
335
335
  threads: int | None = None,
336
336
  ) -> list[str]:
337
337
  """Build isolated ``speech_worker_sensevoice.py`` child worker argv."""
338
- num_threads = threads if threads is not None else min(4, max(1, os.cpu_count() or 1))
338
+ num_threads = threads if threads is not None else min(4, max(1, logical_cores() or 1))
339
339
  script = str(Path(speech_worker_sensevoice.__file__).resolve())
340
340
  return [
341
341
  python_bin,
@@ -366,7 +366,7 @@ def qwen3_asr_argv(
366
366
  max_new_tokens: int = speech_worker_sensevoice.QWEN3_ASR_MAX_NEW_TOKENS,
367
367
  ) -> list[str]:
368
368
  """Build isolated ``speech_worker_sensevoice.py`` child worker argv for Qwen3-ASR."""
369
- num_threads = threads if threads is not None else min(4, max(1, os.cpu_count() or 1))
369
+ num_threads = threads if threads is not None else min(4, max(1, logical_cores() or 1))
370
370
  script = str(Path(speech_worker_sensevoice.__file__).resolve())
371
371
  return [
372
372
  python_bin,
@@ -648,14 +648,21 @@ def _day2(actions: Parsers, only: str | None = None) -> None:
648
648
  [("%(prog)s", "the last accepted plan"), ("%(prog)s --timeout 300", "")],
649
649
  ),
650
650
  "down": (
651
- "stop the stack's services; nothing is removed",
651
+ "stop the stack's services (--all: also library, sidecars, foundations)",
652
652
  "Stop every service a stack apply under this "
653
653
  "state directory deployed, each only through its own unit or process receipt. "
654
654
  "Units stay enabled and nothing is deleted or forgotten, so `stack up` starts the "
655
655
  "same stack again; external services and deployments "
656
- "made outside `stack` are left running. Nothing running is a success. Exit 0 all "
657
- "stopped, 1 any stop failed, 2 refused (another apply is running).",
658
- [("%(prog)s", ""), ("%(prog)s --json", "localmodels.stack-down/v1, for installers")],
656
+ "made outside `stack` are left running unless --all is passed. With --all, also "
657
+ "stop foundations controllers and deployments, unload active library models and "
658
+ "jobs, stop voice sidecars, and refresh runtime-index.json in one call. Nothing "
659
+ "running is a success. Exit 0 all stopped, 1 any stop failed, 2 refused (bad flags "
660
+ "or another apply is running).",
661
+ [
662
+ ("%(prog)s", ""),
663
+ ("%(prog)s --json", "localmodels.stack-down/v1, for installers"),
664
+ ("%(prog)s --all --json", "stop stack, library models, sidecars, and foundations"),
665
+ ],
659
666
  ),
660
667
  "remove": (
661
668
  "uninstall the stack; only downloaded files stay (--purge: those too)",