@simplexai/localmodels-darwin-x64 0.1.0-dev.57 → 0.1.0-dev.59
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.
- package/bootstrap.identity +1 -1
- package/bootstrap.sha256 +66 -64
- package/modules/localmodels/__init__.py +1 -1
- package/modules/localmodels/app.py +1 -1
- package/modules/localmodels/bifrost_admin.py +53 -8
- package/modules/localmodels/bifrost_config.py +103 -4
- package/modules/localmodels/bifrost_log.py +166 -0
- package/modules/localmodels/budget.py +161 -1
- package/modules/localmodels/catalog.json +55 -32
- package/modules/localmodels/catalog.py +5 -2
- package/modules/localmodels/engines-strata-poly-0.2.20-poly.5.json +94 -0
- package/modules/localmodels/frontend.py +26 -21
- package/modules/localmodels/gateway_bifrost.py +30 -6
- package/modules/localmodels/gpu_specs.py +38 -13
- package/modules/localmodels/hosts.py +99 -12
- package/modules/localmodels/library_cli.py +8 -1
- package/modules/localmodels/library_convert.py +34 -0
- package/modules/localmodels/library_elastic.py +747 -0
- package/modules/localmodels/library_gateway.py +101 -10
- package/modules/localmodels/library_jobs.py +16 -7
- package/modules/localmodels/library_model.py +101 -4
- package/modules/localmodels/library_pricing.py +41 -39
- package/modules/localmodels/library_serve.py +322 -58
- package/modules/localmodels/library_state.py +35 -1
- package/modules/localmodels/library_status.py +113 -6
- package/modules/localmodels/llm_rank.py +16 -5
- package/modules/localmodels/metal.py +141 -0
- package/modules/localmodels/metal_probe.py +167 -0
- package/modules/localmodels/plan_envelope.py +4 -1
- package/modules/localmodels/probe.py +2 -2
- package/modules/localmodels/process_identity_linux.py +39 -0
- package/modules/localmodels/recommend.py +6 -1
- package/modules/localmodels/remote_ops.py +4 -3
- package/modules/localmodels/remote_ops_download.py +37 -24
- package/modules/localmodels/remote_ops_mirrors.py +43 -2
- package/modules/localmodels/remote_ops_service.py +93 -36
- package/modules/localmodels/runtime_auth.py +4 -1
- package/modules/localmodels/service_wiring.py +238 -12
- package/modules/localmodels/setup_inspection.py +47 -70
- package/modules/localmodels/setup_inspection_harness.py +159 -15
- package/modules/localmodels/setup_text.py +14 -0
- package/modules/localmodels/setup_upgrade.py +1 -1
- package/modules/localmodels/source_byok.py +6 -2
- package/modules/localmodels/source_byok_probe.py +6 -1
- package/modules/localmodels/stack.py +9 -1
- package/modules/localmodels/stack_binding.py +3 -35
- package/modules/localmodels/stack_cleanup.py +4 -0
- package/modules/localmodels/stack_compose.py +24 -3
- package/modules/localmodels/stack_hardware.py +3 -1
- package/modules/localmodels/stack_lifecycle.py +24 -1
- package/modules/localmodels/stack_picks.py +16 -2
- package/modules/localmodels/stack_plan.py +6 -2
- package/modules/localmodels/stack_ports.py +2 -0
- package/modules/localmodels/stack_remove.py +10 -1
- package/modules/localmodels/stack_up.py +33 -7
- package/modules/localmodels/stack_update.py +3 -1
- package/modules/localmodels/{strata-poly-serve-0.2.19-poly.1.txt → strata-poly-serve-0.2.20-poly.5.txt} +1 -1
- package/modules/localmodels/suite.py +43 -27
- package/modules/localmodels/transport.py +13 -2
- package/modules/{simplex_localmodels-0.1.0.dev57.dist-info → simplex_localmodels-0.1.0.dev59.dist-info}/METADATA +1 -1
- package/modules/{simplex_localmodels-0.1.0.dev57.dist-info → simplex_localmodels-0.1.0.dev59.dist-info}/RECORD +63 -61
- package/package.json +1 -1
- package/tool.json +1 -1
- package/modules/localmodels/engines-strata-poly-0.2.19-poly.1.json +0 -79
- /package/modules/{simplex_localmodels-0.1.0.dev57.dist-info → simplex_localmodels-0.1.0.dev59.dist-info}/WHEEL +0 -0
- /package/modules/{simplex_localmodels-0.1.0.dev57.dist-info → simplex_localmodels-0.1.0.dev59.dist-info}/entry_points.txt +0 -0
- /package/modules/{simplex_localmodels-0.1.0.dev57.dist-info → simplex_localmodels-0.1.0.dev59.dist-info}/licenses/NOTICE +0 -0
- /package/modules/{simplex_localmodels-0.1.0.dev57.dist-info → simplex_localmodels-0.1.0.dev59.dist-info}/licenses/localmodels/HERMES-LICENSE +0 -0
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
"""Bounded, redacted reading of Bifrost's startup log for early-exit diagnostics."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import base64
|
|
6
|
+
import contextlib
|
|
7
|
+
import json
|
|
8
|
+
import re
|
|
9
|
+
import urllib.parse
|
|
10
|
+
from pathlib import Path
|
|
11
|
+
|
|
12
|
+
from localmodels import bifrost_config, gateway_keys
|
|
13
|
+
|
|
14
|
+
APP_DIR = "~/.local/share/localmodels/bifrost"
|
|
15
|
+
LOG_TAIL_BYTES = 16 * 1024
|
|
16
|
+
SUMMARY_MAX_CHARS = 240
|
|
17
|
+
|
|
18
|
+
_SECRET_KEY = r"[A-Za-z0-9_-]*(?:api[_-]?key|token|password|secret|authorization)[A-Za-z0-9_-]*"
|
|
19
|
+
_QUOTED_SECRET_RE = re.compile(
|
|
20
|
+
rf'(?i)(["\'])({_SECRET_KEY})\1(\s*[:=]\s*)(["\'])(?:\\.|(?!\4).)*(?:\4|$)'
|
|
21
|
+
)
|
|
22
|
+
_QUOTED_KEY_UNQUOTED_VAL_RE = re.compile(rf'(?i)(["\'])({_SECRET_KEY})\1(\s*[:=]\s*)[^\s"\',}}]+')
|
|
23
|
+
_UNQUOTED_KEY_QUOTED_VAL_RE = re.compile(
|
|
24
|
+
rf'(?i)(?<![A-Za-z0-9_"\'-])({_SECRET_KEY})\s*([:=])\s*(["\'])(?:\\.|(?!\3).)*(?:\3|$)'
|
|
25
|
+
)
|
|
26
|
+
_UNQUOTED_SECRET_RE = re.compile(
|
|
27
|
+
rf'(?i)(?<![A-Za-z0-9_"\'-])({_SECRET_KEY})\s*([:=])\s*(?!\[redacted\])[^\s"\',}}]+'
|
|
28
|
+
)
|
|
29
|
+
_PROVIDER_KEY_RE = re.compile(r"\b(?:sk-|gsk_|hf_|AIza)[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)*")
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def log_size(app: Path) -> int:
|
|
33
|
+
"""Current byte size of ``bifrost.log`` inside ``app``, or 0 when absent."""
|
|
34
|
+
try:
|
|
35
|
+
return (app / "bifrost.log").stat().st_size
|
|
36
|
+
except OSError:
|
|
37
|
+
return 0
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def known_secrets(app: Path) -> list[str]:
|
|
41
|
+
"""Literal secrets from admin-password and config.json (longest first); never creates files."""
|
|
42
|
+
found: set[str] = set()
|
|
43
|
+
admin_user = bifrost_config.ADMIN_USER
|
|
44
|
+
caller_key = gateway_keys.CALLER_KEY
|
|
45
|
+
|
|
46
|
+
def add_password(raw: object) -> None:
|
|
47
|
+
if not isinstance(raw, str):
|
|
48
|
+
return
|
|
49
|
+
pw = raw.strip()
|
|
50
|
+
if not pw or pw in (caller_key, admin_user):
|
|
51
|
+
return
|
|
52
|
+
found.add(pw)
|
|
53
|
+
found.add(base64.b64encode(f"{admin_user}:{pw}".encode()).decode("ascii"))
|
|
54
|
+
|
|
55
|
+
pw_path = app / "admin-password"
|
|
56
|
+
with contextlib.suppress(OSError):
|
|
57
|
+
if pw_path.is_file():
|
|
58
|
+
add_password(pw_path.read_text(encoding="utf-8"))
|
|
59
|
+
config = bifrost_config.read_config(app)
|
|
60
|
+
gov = config.get("governance")
|
|
61
|
+
if isinstance(gov, dict) and isinstance(gov.get("auth_config"), dict):
|
|
62
|
+
add_password(gov["auth_config"].get("admin_password"))
|
|
63
|
+
providers = config.get("providers")
|
|
64
|
+
if isinstance(providers, dict):
|
|
65
|
+
for entry in providers.values():
|
|
66
|
+
if not isinstance(entry, dict):
|
|
67
|
+
continue
|
|
68
|
+
for key in entry.get("keys") or []:
|
|
69
|
+
val = key.get("value") if isinstance(key, dict) else None
|
|
70
|
+
if (
|
|
71
|
+
isinstance(val, str)
|
|
72
|
+
and len(val) >= 6
|
|
73
|
+
and val not in (caller_key, admin_user)
|
|
74
|
+
and not val.startswith("env.")
|
|
75
|
+
):
|
|
76
|
+
found.add(val)
|
|
77
|
+
return sorted(found, key=len, reverse=True)
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
def _scrub_url(match: re.Match[str]) -> str:
|
|
81
|
+
try:
|
|
82
|
+
parsed = urllib.parse.urlsplit(match.group())
|
|
83
|
+
host = parsed.netloc.rsplit("@", 1)[-1]
|
|
84
|
+
return urllib.parse.urlunsplit((parsed.scheme, host, parsed.path, "", ""))
|
|
85
|
+
except ValueError:
|
|
86
|
+
return "[URL]"
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
def scrub_summary(text: str, app: Path, *, app_label: str = APP_DIR) -> str:
|
|
90
|
+
"""Scrub credentials, URL query/userinfo, local paths and control characters from a log line."""
|
|
91
|
+
for secret in known_secrets(app):
|
|
92
|
+
text = text.replace(secret, "[redacted]")
|
|
93
|
+
text = re.sub(r"https?://[^\s\"'<>)]+", _scrub_url, text)
|
|
94
|
+
text = re.sub(r"(?<=[A-Za-z0-9/_~-])\?[^\s\"'<>#)]+", "", text)
|
|
95
|
+
text = re.sub(r"(?i)\b(Bearer|Basic)\s+[A-Za-z0-9+/=._-]+", r"\1 [redacted]", text)
|
|
96
|
+
text = _PROVIDER_KEY_RE.sub("[redacted]", text)
|
|
97
|
+
text = _QUOTED_SECRET_RE.sub(r"\1\2\1\3\4[redacted]\4", text)
|
|
98
|
+
text = _QUOTED_KEY_UNQUOTED_VAL_RE.sub(r"\1\2\1\3[redacted]", text)
|
|
99
|
+
text = _UNQUOTED_KEY_QUOTED_VAL_RE.sub(r"\1\2\3[redacted]\3", text)
|
|
100
|
+
text = _UNQUOTED_SECRET_RE.sub(r"\1\2[redacted]", text)
|
|
101
|
+
replacements: list[tuple[str, str]] = [(str(app), app_label)]
|
|
102
|
+
with contextlib.suppress(OSError):
|
|
103
|
+
replacements.append((str(app.resolve()), app_label))
|
|
104
|
+
home = Path.home()
|
|
105
|
+
replacements.append((str(home), "~"))
|
|
106
|
+
with contextlib.suppress(OSError):
|
|
107
|
+
replacements.append((str(home.resolve()), "~"))
|
|
108
|
+
for needle, repl in replacements:
|
|
109
|
+
if needle and needle not in ("/", "\\"):
|
|
110
|
+
text = text.replace(needle, repl)
|
|
111
|
+
text = "".join(
|
|
112
|
+
ch if ord(ch) >= 32 and ord(ch) != 127 else (" " if ch in "\t\n\r" else "") for ch in text
|
|
113
|
+
)
|
|
114
|
+
cleaned = " ".join(text.split())
|
|
115
|
+
if len(cleaned) > SUMMARY_MAX_CHARS:
|
|
116
|
+
cleaned = cleaned[: SUMMARY_MAX_CHARS - 3].rstrip() + "..."
|
|
117
|
+
return cleaned
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
def startup_failure_summary(app: Path, offset: int = 0, *, app_label: str = APP_DIR) -> str:
|
|
121
|
+
"""Bounded, redacted summary of the last fatal/error line written to bifrost.log since offset."""
|
|
122
|
+
log_path = app / "bifrost.log"
|
|
123
|
+
try:
|
|
124
|
+
size = log_path.stat().st_size
|
|
125
|
+
start = 0 if offset < 0 or offset > size else offset
|
|
126
|
+
if size - start > LOG_TAIL_BYTES:
|
|
127
|
+
start = size - LOG_TAIL_BYTES
|
|
128
|
+
if size <= start:
|
|
129
|
+
return ""
|
|
130
|
+
with log_path.open("rb") as f:
|
|
131
|
+
f.seek(start)
|
|
132
|
+
chunk = f.read(LOG_TAIL_BYTES)
|
|
133
|
+
except OSError:
|
|
134
|
+
return ""
|
|
135
|
+
raw = ""
|
|
136
|
+
for line in reversed(chunk.decode("utf-8", errors="replace").splitlines()):
|
|
137
|
+
stripped = line.strip()
|
|
138
|
+
if not stripped:
|
|
139
|
+
continue
|
|
140
|
+
if stripped.startswith("{"):
|
|
141
|
+
try:
|
|
142
|
+
obj = json.loads(stripped)
|
|
143
|
+
except ValueError:
|
|
144
|
+
obj = None
|
|
145
|
+
if isinstance(obj, dict):
|
|
146
|
+
level = str(obj.get("level") or "").strip().lower()
|
|
147
|
+
if level in ("fatal", "error"):
|
|
148
|
+
msg = str(obj.get("message") or obj.get("msg") or "").strip()
|
|
149
|
+
err = str(obj.get("error") or "").strip()
|
|
150
|
+
if msg and err:
|
|
151
|
+
if err in msg:
|
|
152
|
+
raw = msg
|
|
153
|
+
elif msg in err:
|
|
154
|
+
raw = err
|
|
155
|
+
else:
|
|
156
|
+
raw = f"{msg}: {err}"
|
|
157
|
+
else:
|
|
158
|
+
raw = msg or err
|
|
159
|
+
if raw:
|
|
160
|
+
break
|
|
161
|
+
continue
|
|
162
|
+
lowered = stripped.lower()
|
|
163
|
+
if "fatal" in lowered or "error" in lowered:
|
|
164
|
+
raw = stripped
|
|
165
|
+
break
|
|
166
|
+
return scrub_summary(raw, app, app_label=app_label) if raw else ""
|
|
@@ -107,6 +107,7 @@ def _uma(
|
|
|
107
107
|
*,
|
|
108
108
|
gpu_name: str = "",
|
|
109
109
|
gpu_pci_id: int | None = None,
|
|
110
|
+
gpu_bandwidth_gb_s: float | None = None,
|
|
110
111
|
lazy_reads: bool = True,
|
|
111
112
|
) -> HardwareBudget:
|
|
112
113
|
return HardwareBudget(
|
|
@@ -117,6 +118,7 @@ def _uma(
|
|
|
117
118
|
gpu_name=gpu_name,
|
|
118
119
|
platform=facts.get("platform", ""),
|
|
119
120
|
gpu_pci_id=gpu_pci_id,
|
|
121
|
+
gpu_bandwidth_gb_s=gpu_bandwidth_gb_s,
|
|
120
122
|
lazy_reads=lazy_reads,
|
|
121
123
|
)
|
|
122
124
|
|
|
@@ -358,13 +360,19 @@ def placements(facts: HostFacts, *, planning: bool = True) -> list[Placement]:
|
|
|
358
360
|
# Metal, integrated or unknown GPUs, CPU: RAM as unified memory. AMD/Intel discrete cards
|
|
359
361
|
# need the engine's device probe, which runs only after an engine is installed.
|
|
360
362
|
cls = facts.get("gpu_vendor_class", "unknown")
|
|
363
|
+
backend = "metal" if facts.get("platform") == "darwin" else "cpu"
|
|
364
|
+
metal_info = metal.reading(facts) if backend == "metal" else None
|
|
365
|
+
metal_name = str(metal_info.get("name") or "") if metal_info else ""
|
|
361
366
|
budget = _uma(
|
|
362
367
|
ram_total if planning else ram_avail,
|
|
363
368
|
ram_total,
|
|
364
369
|
facts,
|
|
370
|
+
gpu_name=metal_name,
|
|
371
|
+
gpu_bandwidth_gb_s=gpu_specs.bandwidth_gb_s(metal_name, total_bytes=ram_total)
|
|
372
|
+
if metal_name
|
|
373
|
+
else None,
|
|
365
374
|
lazy_reads=cls not in ("amd", "intel"),
|
|
366
375
|
)
|
|
367
|
-
backend = "metal" if facts.get("platform") == "darwin" else "cpu"
|
|
368
376
|
return [
|
|
369
377
|
Placement(
|
|
370
378
|
"host",
|
|
@@ -511,5 +519,157 @@ def agent_budget(
|
|
|
511
519
|
)
|
|
512
520
|
|
|
513
521
|
|
|
522
|
+
@dataclass(frozen=True)
|
|
523
|
+
class AdmissionBudget:
|
|
524
|
+
"""Dual-tier memory admission boundary for loading one model on a pool.
|
|
525
|
+
|
|
526
|
+
- ``hard_ceiling_bytes`` is the only gate that hard-refuses with ``LOAD_NO_ROOM``
|
|
527
|
+
(Metal wired headroom on Apple Silicon, 0 under Critical pressure; live free VRAM on
|
|
528
|
+
discrete NVIDIA cards).
|
|
529
|
+
- ``soft_budget_bytes`` drives elastic posture selection and pressure warnings; on Apple
|
|
530
|
+
Silicon unified memory it never hard-rejects on its own while under ``hard_ceiling_bytes``.
|
|
531
|
+
"""
|
|
532
|
+
|
|
533
|
+
pool: str
|
|
534
|
+
backend: str # metal | cuda | cpu
|
|
535
|
+
soft_budget_bytes: int
|
|
536
|
+
hard_ceiling_bytes: int
|
|
537
|
+
reserve_bytes: int
|
|
538
|
+
wired_headroom_bytes: int | None = None
|
|
539
|
+
wired_ceiling_bytes: int | None = None
|
|
540
|
+
gpu_in_use_bytes: int | None = None
|
|
541
|
+
inactive_anon_bytes: int = 0
|
|
542
|
+
reclaimable_inactive_anon_bytes: int = 0
|
|
543
|
+
pressure_level: int | None = None
|
|
544
|
+
critical_pressure: bool = False
|
|
545
|
+
allows_soft_overcommit: bool = False
|
|
546
|
+
physical_limit_bytes: int = 0
|
|
547
|
+
|
|
548
|
+
|
|
549
|
+
def admission_budget(
|
|
550
|
+
facts: HostFacts, pool: str, *, delta_bytes: int = 0
|
|
551
|
+
) -> AdmissionBudget | None:
|
|
552
|
+
"""Compute the dual-tier (soft budget + hard ceiling) admission boundary for ``pool``.
|
|
553
|
+
|
|
554
|
+
``delta_bytes`` is net bytes already reserved by concurrent loads minus bytes freed by
|
|
555
|
+
planned unloads on ``pool`` (positive reduces headroom, negative increases it).
|
|
556
|
+
Returns None when ``pool`` does not exist on ``facts``.
|
|
557
|
+
"""
|
|
558
|
+
if pool == "unified":
|
|
559
|
+
if metal.supported(facts):
|
|
560
|
+
level = facts["ram"].get("pressure_level")
|
|
561
|
+
critical = metal.is_critical_pressure(facts)
|
|
562
|
+
base_reserve = metal.soft_host_keep_bytes(facts) + METAL_VRAM_RESERVE_BYTES
|
|
563
|
+
pressured_facts, _ = metal.pressured(facts)
|
|
564
|
+
kept = int(pressured_facts["ram"].get("pressure_kept_bytes") or 0)
|
|
565
|
+
reserve = base_reserve + kept
|
|
566
|
+
wired_ceiling = metal.wired_ceiling_bytes(facts)
|
|
567
|
+
gpu_in_use = metal.gpu_in_use_bytes(facts)
|
|
568
|
+
inactive_anon = metal.inactive_anon_bytes(facts)
|
|
569
|
+
reclaimable = metal.reclaimable_inactive_anon_bytes(facts)
|
|
570
|
+
total = int(facts["ram"]["total_bytes"])
|
|
571
|
+
wired_ram = facts["ram"].get("wired_bytes")
|
|
572
|
+
if critical:
|
|
573
|
+
phys_limit = 0
|
|
574
|
+
soft_budget = 0
|
|
575
|
+
wired_headroom = 0
|
|
576
|
+
else:
|
|
577
|
+
if wired_ram is not None and wired_ram >= 0:
|
|
578
|
+
phys_limit = max(0, total - int(wired_ram) - metal.HARD_OS_FLOOR_BYTES)
|
|
579
|
+
else:
|
|
580
|
+
phys_limit = max(0, total - metal.HOST_KEEP_BYTES)
|
|
581
|
+
soft_avail = max(0, min(total, metal.soft_available_bytes(facts) - delta_bytes))
|
|
582
|
+
soft_budget = max(0, soft_avail - base_reserve)
|
|
583
|
+
max_wired = int(wired_ceiling * metal.WIRED_HEADROOM_SAFETY_FRACTION)
|
|
584
|
+
wired_headroom = max(
|
|
585
|
+
0, min(max_wired, phys_limit, metal.wired_headroom_bytes(facts) - delta_bytes)
|
|
586
|
+
)
|
|
587
|
+
return AdmissionBudget(
|
|
588
|
+
pool="unified",
|
|
589
|
+
backend="metal",
|
|
590
|
+
soft_budget_bytes=soft_budget,
|
|
591
|
+
hard_ceiling_bytes=wired_headroom,
|
|
592
|
+
reserve_bytes=reserve,
|
|
593
|
+
wired_headroom_bytes=wired_headroom,
|
|
594
|
+
wired_ceiling_bytes=wired_ceiling,
|
|
595
|
+
gpu_in_use_bytes=gpu_in_use,
|
|
596
|
+
inactive_anon_bytes=inactive_anon,
|
|
597
|
+
reclaimable_inactive_anon_bytes=reclaimable,
|
|
598
|
+
pressure_level=level,
|
|
599
|
+
critical_pressure=critical,
|
|
600
|
+
allows_soft_overcommit=(not critical and level != metal.PRESSURE_WARN),
|
|
601
|
+
physical_limit_bytes=phys_limit,
|
|
602
|
+
)
|
|
603
|
+
unified = unified_pool_bytes(facts)
|
|
604
|
+
if unified is None:
|
|
605
|
+
return None
|
|
606
|
+
nvidia = [
|
|
607
|
+
g
|
|
608
|
+
for g in facts.get("gpus") or []
|
|
609
|
+
if g.get("vendor") == "nvidia" and g.get("mig_mode") != "enabled"
|
|
610
|
+
]
|
|
611
|
+
first_free = nvidia[0]["free_bytes"] if nvidia else 0
|
|
612
|
+
_, ram_avail = host_ram(facts)
|
|
613
|
+
usable_total = max(
|
|
614
|
+
0, int(unified * (1 - _UMA_HEADROOM_FRACTION)) - AGENT_VRAM_RESERVE_BYTES
|
|
615
|
+
)
|
|
616
|
+
raw_live = max(
|
|
617
|
+
0,
|
|
618
|
+
int(min(unified, first_free + ram_avail) * (1 - _UMA_HEADROOM_FRACTION))
|
|
619
|
+
- AGENT_VRAM_RESERVE_BYTES,
|
|
620
|
+
)
|
|
621
|
+
live_budget = max(0, min(usable_total, raw_live - delta_bytes))
|
|
622
|
+
return AdmissionBudget(
|
|
623
|
+
pool="unified",
|
|
624
|
+
backend="cuda",
|
|
625
|
+
soft_budget_bytes=live_budget,
|
|
626
|
+
hard_ceiling_bytes=live_budget,
|
|
627
|
+
reserve_bytes=max(0, unified - usable_total),
|
|
628
|
+
allows_soft_overcommit=False,
|
|
629
|
+
physical_limit_bytes=max(0, min(unified, first_free + ram_avail) - delta_bytes),
|
|
630
|
+
)
|
|
631
|
+
if pool.startswith("gpu:"):
|
|
632
|
+
try:
|
|
633
|
+
index = int(pool.split(":", 1)[1])
|
|
634
|
+
except ValueError:
|
|
635
|
+
return None
|
|
636
|
+
gpu = next(
|
|
637
|
+
(
|
|
638
|
+
g
|
|
639
|
+
for g in facts.get("gpus") or []
|
|
640
|
+
if g["index"] == index and g.get("vendor") == "nvidia"
|
|
641
|
+
),
|
|
642
|
+
None,
|
|
643
|
+
)
|
|
644
|
+
if gpu is None:
|
|
645
|
+
return None
|
|
646
|
+
live_free = max(0, min(gpu["total_bytes"], gpu["free_bytes"] - delta_bytes))
|
|
647
|
+
usable = max(0, live_free - AGENT_VRAM_RESERVE_BYTES)
|
|
648
|
+
return AdmissionBudget(
|
|
649
|
+
pool=pool,
|
|
650
|
+
backend="cuda",
|
|
651
|
+
soft_budget_bytes=usable,
|
|
652
|
+
hard_ceiling_bytes=usable,
|
|
653
|
+
reserve_bytes=AGENT_VRAM_RESERVE_BYTES,
|
|
654
|
+
allows_soft_overcommit=False,
|
|
655
|
+
physical_limit_bytes=live_free,
|
|
656
|
+
)
|
|
657
|
+
if pool == "system":
|
|
658
|
+
total, avail = host_ram(facts)
|
|
659
|
+
pool_cap = int(total * (1 - _UMA_HEADROOM_FRACTION))
|
|
660
|
+
used = total - avail
|
|
661
|
+
usable = max(0, min(pool_cap, pool_cap - used - delta_bytes))
|
|
662
|
+
return AdmissionBudget(
|
|
663
|
+
pool="system",
|
|
664
|
+
backend="cpu",
|
|
665
|
+
soft_budget_bytes=usable,
|
|
666
|
+
hard_ceiling_bytes=usable,
|
|
667
|
+
reserve_bytes=max(0, total - pool_cap),
|
|
668
|
+
allows_soft_overcommit=False,
|
|
669
|
+
physical_limit_bytes=max(0, avail - delta_bytes),
|
|
670
|
+
)
|
|
671
|
+
return None
|
|
672
|
+
|
|
673
|
+
|
|
514
674
|
def gib(n: int | float) -> str:
|
|
515
675
|
return f"{n / _GIB:.1f} GB"
|
|
@@ -3467,7 +3467,8 @@
|
|
|
3467
3467
|
],
|
|
3468
3468
|
"host": "127.0.0.1",
|
|
3469
3469
|
"parallel": 1,
|
|
3470
|
-
"open_browser": false
|
|
3470
|
+
"open_browser": false,
|
|
3471
|
+
"warm_start": true
|
|
3471
3472
|
},
|
|
3472
3473
|
"argv": [
|
|
3473
3474
|
"{python}",
|
|
@@ -3578,7 +3579,8 @@
|
|
|
3578
3579
|
],
|
|
3579
3580
|
"host": "127.0.0.1",
|
|
3580
3581
|
"parallel": 1,
|
|
3581
|
-
"open_browser": false
|
|
3582
|
+
"open_browser": false,
|
|
3583
|
+
"warm_start": true
|
|
3582
3584
|
},
|
|
3583
3585
|
"argv": [
|
|
3584
3586
|
"{python}",
|
|
@@ -3651,8 +3653,8 @@
|
|
|
3651
3653
|
"vision": true
|
|
3652
3654
|
}
|
|
3653
3655
|
],
|
|
3654
|
-
"engine": "strata-poly-0.2.
|
|
3655
|
-
"venv": "strata-poly-serve-0.2.
|
|
3656
|
+
"engine": "strata-poly-0.2.20-poly.5",
|
|
3657
|
+
"venv": "strata-poly-serve-0.2.20-poly.5.txt",
|
|
3656
3658
|
"venv_bytes": 41943040,
|
|
3657
3659
|
"alias": "inkling-2-mini-ud-q4_k_xl",
|
|
3658
3660
|
"contract": "chat",
|
|
@@ -3715,7 +3717,8 @@
|
|
|
3715
3717
|
],
|
|
3716
3718
|
"host": "127.0.0.1",
|
|
3717
3719
|
"parallel": 1,
|
|
3718
|
-
"open_browser": false
|
|
3720
|
+
"open_browser": false,
|
|
3721
|
+
"warm_start": true
|
|
3719
3722
|
},
|
|
3720
3723
|
"argv": [
|
|
3721
3724
|
"{python}",
|
|
@@ -3731,7 +3734,7 @@
|
|
|
3731
3734
|
],
|
|
3732
3735
|
"health_path": "/health",
|
|
3733
3736
|
"verify_timeout_s": 1800,
|
|
3734
|
-
"note": "Thinking Machines Inkling 2 Mini UD-Q4_K_XL (Mainline_Support inkling2_loop, 5.41 BPW) on PolyStrata v0.2.
|
|
3737
|
+
"note": "Thinking Machines Inkling 2 Mini UD-Q4_K_XL (Mainline_Support inkling2_loop, 5.41 BPW) on PolyStrata v0.2.20-poly.5 for 24 GB+ NVIDIA CUDA 13 cards (driver >= 580) with 128K FP8 KV cache and native vision (strata-vision GPU on >= 23.5 GiB cards, CPU below). Single-request concurrency (parallel: 1); --prefer concurrent falls back to llama.cpp Inkling 2 Mini.\nMeasured on local-118 GPU0 24 GB share (2026-11-23-polystrata-inkling2-mini-local118): all 3072/3072 routed experts fit in VRAM (14.7 GiB, 0.0 GiB offloaded), strata-vision GPU 791 MiB, whole-card peak 21,601 MiB across 58.4K and 105.6K prompts (2,463 MiB below the 24 GB gate), anonymous host RAM peak 1.7 GiB, 176.4 tok/s short decode, 6,869 tok/s prefill and 138.8 tok/s decode after 58.4K prompt (needle hit, vision and tool calling passed). Promoted above same-score llama.cpp Inkling on supported CUDA 13 NVIDIA hosts by roadmap decision 66.",
|
|
3735
3738
|
"quality": {
|
|
3736
3739
|
"score": 54,
|
|
3737
3740
|
"sources": [
|
|
@@ -3789,8 +3792,8 @@
|
|
|
3789
3792
|
"vision": true
|
|
3790
3793
|
}
|
|
3791
3794
|
],
|
|
3792
|
-
"engine": "strata-poly-0.2.
|
|
3793
|
-
"venv": "strata-poly-serve-0.2.
|
|
3795
|
+
"engine": "strata-poly-0.2.20-poly.5",
|
|
3796
|
+
"venv": "strata-poly-serve-0.2.20-poly.5.txt",
|
|
3794
3797
|
"venv_bytes": 41943040,
|
|
3795
3798
|
"alias": "inkling-2-mini-ud-q3_k_xl",
|
|
3796
3799
|
"contract": "chat",
|
|
@@ -3853,7 +3856,8 @@
|
|
|
3853
3856
|
],
|
|
3854
3857
|
"host": "127.0.0.1",
|
|
3855
3858
|
"parallel": 1,
|
|
3856
|
-
"open_browser": false
|
|
3859
|
+
"open_browser": false,
|
|
3860
|
+
"warm_start": true
|
|
3857
3861
|
},
|
|
3858
3862
|
"argv": [
|
|
3859
3863
|
"{python}",
|
|
@@ -3869,7 +3873,7 @@
|
|
|
3869
3873
|
],
|
|
3870
3874
|
"health_path": "/health",
|
|
3871
3875
|
"verify_timeout_s": 1800,
|
|
3872
|
-
"note": "Thinking Machines Inkling 2 Mini UD-Q3_K_XL (Mainline_Support inkling2_loop, 4.18 BPW) on PolyStrata v0.2.
|
|
3876
|
+
"note": "Thinking Machines Inkling 2 Mini UD-Q3_K_XL (Mainline_Support inkling2_loop, 4.18 BPW) on PolyStrata v0.2.20-poly.5 for 8, 12 and 16 GB NVIDIA CUDA 13 cards (driver >= 580) with >= 24 GB RAM. Uses 64K FP8 KV cache, --vram-pool (caps prefill staging and KV growth strictly inside the card budget), --ram-experts-mib 6144, --tail-skip 0, and CPU strata-vision on < 23.5 GiB cards. Single-request concurrency (parallel: 1).\nMeasured on local-118 GPU0 stand-in shares (2026-11-23-polystrata-inkling2-mini-local118, 58.4K prompt needle + vision + tool calls all passed): 16 GB share 3058/3072 experts in VRAM, peak 14,498 MiB (1,374 MiB below gate), 178.3 tok/s short / 61.1 tok/s at 58.4K; 12 GB share 1977/3072 experts, peak 10,388 MiB, 138.7 / 47.0 tok/s; 8 GB share 896/3072 experts, peak 6,292 MiB (1,388 MiB below gate), cgroup peak 8.7 GiB / anon 8.4 GiB, 65.6 / 30.3 tok/s (server-class CPU stand-in upper bound; upstream RTX 4070 Laptop 8 GB measured 56 / 42 tok/s). Promoted by roadmap decision 66.\nWindows runs without --vram-pool (card_args keeps it on Linux). PSIW (2026-11-23, RTX 4070 Laptop 8 GB, Windows 11): with it the engine claims a 13,204 MiB pool from the process budget Windows reports, larger than the card, and every request longer than about 30 tokens gets \"no VRAM for a prompt's buffers\"; stack apply failed 3 times out of 3 on the 0.2.19-poly.1 and 0.2.20-poly.1 engines. Without it, on 0.2.19-poly.1: plain text of 54 to 31,022 tokens, Chinese, the CPU picture reader, a tool call and a needle in a 54K-token prompt all pass, card peak 6,966-7,001 MiB of 8,188. PolyStrata's main fixes the engine side (5b080f37b) for its next release.",
|
|
3873
3877
|
"quality": {
|
|
3874
3878
|
"score": 54,
|
|
3875
3879
|
"sources": [
|
|
@@ -3937,8 +3941,8 @@
|
|
|
3937
3941
|
"vision": true
|
|
3938
3942
|
}
|
|
3939
3943
|
],
|
|
3940
|
-
"engine": "strata-poly-0.2.
|
|
3941
|
-
"venv": "strata-poly-serve-0.2.
|
|
3944
|
+
"engine": "strata-poly-0.2.20-poly.5",
|
|
3945
|
+
"venv": "strata-poly-serve-0.2.20-poly.5.txt",
|
|
3942
3946
|
"venv_bytes": 41943040,
|
|
3943
3947
|
"alias": "inkling-2-mini-ud-q2_k_xl",
|
|
3944
3948
|
"contract": "chat",
|
|
@@ -4001,7 +4005,8 @@
|
|
|
4001
4005
|
],
|
|
4002
4006
|
"host": "127.0.0.1",
|
|
4003
4007
|
"parallel": 1,
|
|
4004
|
-
"open_browser": false
|
|
4008
|
+
"open_browser": false,
|
|
4009
|
+
"warm_start": true
|
|
4005
4010
|
},
|
|
4006
4011
|
"argv": [
|
|
4007
4012
|
"{python}",
|
|
@@ -4017,7 +4022,7 @@
|
|
|
4017
4022
|
],
|
|
4018
4023
|
"health_path": "/health",
|
|
4019
4024
|
"verify_timeout_s": 1800,
|
|
4020
|
-
"note": "Thinking Machines Inkling 2 Mini UD-Q2_K_XL (Mainline_Support inkling2_loop, 2.80 BPW) on PolyStrata v0.2.
|
|
4025
|
+
"note": "Thinking Machines Inkling 2 Mini UD-Q2_K_XL (Mainline_Support inkling2_loop, 2.80 BPW) on PolyStrata v0.2.20-poly.5: low-RAM fallback for 8-12 GB NVIDIA CUDA 13 cards when host RAM is too tight for UD-Q3_K_XL (20-24 GB RAM or busy 32 GB hosts). Uses 64K FP8 KV cache, --vram-pool, --ram-experts-mib 4096, --tail-skip 0, and CPU strata-vision. Does not override resident llama.cpp Inkling UD-IQ3_XXS on 16 GB cards.\nMeasured on local-118 GPU0 8 GB share inside a 14 GiB cgroup (2026-11-23-polystrata-inkling2-mini-local118): 1428/3072 experts in VRAM, whole-card peak 6,294 MiB (1,386 MiB below gate), cgroup peak 6.8 GiB / anon 6.5 GiB, 112.8 tok/s short / 3,836 tok/s prefill / 45.5 tok/s decode after 58.4K prompt (needle hit, vision and tool calls passed). Added by roadmap decision 66.\nWindows runs without --vram-pool (card_args keeps it on Linux). PSIW (2026-11-23, RTX 4070 Laptop 8 GB, Windows 11, engine 0.2.19-poly.1): with it the engine claims a 9,092 MiB pool from the process budget Windows reports, larger than the card, stack apply fails and every request longer than about 30 tokens gets \"no VRAM for a prompt's buffers\". Without it, plain text of 54 to 31,022 tokens, Chinese, the CPU picture reader, a tool call and a needle in a 54K-token prompt all pass, card peak 6,992-7,033 MiB of 8,188. PolyStrata's main fixes the engine side (5b080f37b) for its next release.",
|
|
4021
4026
|
"quality": {
|
|
4022
4027
|
"score": 53,
|
|
4023
4028
|
"sources": [
|
|
@@ -4123,7 +4128,8 @@
|
|
|
4123
4128
|
],
|
|
4124
4129
|
"host": "127.0.0.1",
|
|
4125
4130
|
"parallel": 1,
|
|
4126
|
-
"open_browser": false
|
|
4131
|
+
"open_browser": false,
|
|
4132
|
+
"warm_start": true
|
|
4127
4133
|
},
|
|
4128
4134
|
"argv": [
|
|
4129
4135
|
"{python}",
|
|
@@ -4229,7 +4235,8 @@
|
|
|
4229
4235
|
],
|
|
4230
4236
|
"host": "127.0.0.1",
|
|
4231
4237
|
"parallel": 1,
|
|
4232
|
-
"open_browser": false
|
|
4238
|
+
"open_browser": false,
|
|
4239
|
+
"warm_start": true
|
|
4233
4240
|
},
|
|
4234
4241
|
"argv": [
|
|
4235
4242
|
"{python}",
|
|
@@ -4335,7 +4342,8 @@
|
|
|
4335
4342
|
],
|
|
4336
4343
|
"host": "127.0.0.1",
|
|
4337
4344
|
"parallel": 1,
|
|
4338
|
-
"open_browser": false
|
|
4345
|
+
"open_browser": false,
|
|
4346
|
+
"warm_start": true
|
|
4339
4347
|
},
|
|
4340
4348
|
"argv": [
|
|
4341
4349
|
"{python}",
|
|
@@ -4441,7 +4449,8 @@
|
|
|
4441
4449
|
],
|
|
4442
4450
|
"host": "127.0.0.1",
|
|
4443
4451
|
"parallel": 1,
|
|
4444
|
-
"open_browser": false
|
|
4452
|
+
"open_browser": false,
|
|
4453
|
+
"warm_start": true
|
|
4445
4454
|
},
|
|
4446
4455
|
"argv": [
|
|
4447
4456
|
"{python}",
|
|
@@ -4549,7 +4558,8 @@
|
|
|
4549
4558
|
"host": "127.0.0.1",
|
|
4550
4559
|
"parallel": 1,
|
|
4551
4560
|
"open_browser": false,
|
|
4552
|
-
"tool_call_recovery": true
|
|
4561
|
+
"tool_call_recovery": true,
|
|
4562
|
+
"warm_start": true
|
|
4553
4563
|
},
|
|
4554
4564
|
"argv": [
|
|
4555
4565
|
"{python}",
|
|
@@ -4656,7 +4666,8 @@
|
|
|
4656
4666
|
],
|
|
4657
4667
|
"host": "127.0.0.1",
|
|
4658
4668
|
"parallel": 1,
|
|
4659
|
-
"open_browser": false
|
|
4669
|
+
"open_browser": false,
|
|
4670
|
+
"warm_start": true
|
|
4660
4671
|
},
|
|
4661
4672
|
"argv": [
|
|
4662
4673
|
"{python}",
|
|
@@ -4770,7 +4781,8 @@
|
|
|
4770
4781
|
],
|
|
4771
4782
|
"host": "127.0.0.1",
|
|
4772
4783
|
"parallel": 1,
|
|
4773
|
-
"open_browser": false
|
|
4784
|
+
"open_browser": false,
|
|
4785
|
+
"warm_start": true
|
|
4774
4786
|
},
|
|
4775
4787
|
"argv": [
|
|
4776
4788
|
"{python}",
|
|
@@ -4877,7 +4889,8 @@
|
|
|
4877
4889
|
],
|
|
4878
4890
|
"host": "127.0.0.1",
|
|
4879
4891
|
"parallel": 1,
|
|
4880
|
-
"open_browser": false
|
|
4892
|
+
"open_browser": false,
|
|
4893
|
+
"warm_start": true
|
|
4881
4894
|
},
|
|
4882
4895
|
"argv": [
|
|
4883
4896
|
"{python}",
|
|
@@ -4983,7 +4996,8 @@
|
|
|
4983
4996
|
],
|
|
4984
4997
|
"host": "127.0.0.1",
|
|
4985
4998
|
"parallel": 1,
|
|
4986
|
-
"open_browser": false
|
|
4999
|
+
"open_browser": false,
|
|
5000
|
+
"warm_start": true
|
|
4987
5001
|
},
|
|
4988
5002
|
"argv": [
|
|
4989
5003
|
"{python}",
|
|
@@ -5098,7 +5112,8 @@
|
|
|
5098
5112
|
],
|
|
5099
5113
|
"host": "127.0.0.1",
|
|
5100
5114
|
"parallel": 1,
|
|
5101
|
-
"open_browser": false
|
|
5115
|
+
"open_browser": false,
|
|
5116
|
+
"warm_start": true
|
|
5102
5117
|
},
|
|
5103
5118
|
"argv": [
|
|
5104
5119
|
"{python}",
|
|
@@ -5212,7 +5227,8 @@
|
|
|
5212
5227
|
],
|
|
5213
5228
|
"host": "127.0.0.1",
|
|
5214
5229
|
"parallel": 1,
|
|
5215
|
-
"open_browser": false
|
|
5230
|
+
"open_browser": false,
|
|
5231
|
+
"warm_start": true
|
|
5216
5232
|
},
|
|
5217
5233
|
"argv": [
|
|
5218
5234
|
"{python}",
|
|
@@ -5319,7 +5335,8 @@
|
|
|
5319
5335
|
],
|
|
5320
5336
|
"host": "127.0.0.1",
|
|
5321
5337
|
"parallel": 1,
|
|
5322
|
-
"open_browser": false
|
|
5338
|
+
"open_browser": false,
|
|
5339
|
+
"warm_start": true
|
|
5323
5340
|
},
|
|
5324
5341
|
"argv": [
|
|
5325
5342
|
"{python}",
|
|
@@ -5425,7 +5442,8 @@
|
|
|
5425
5442
|
],
|
|
5426
5443
|
"host": "127.0.0.1",
|
|
5427
5444
|
"parallel": 1,
|
|
5428
|
-
"open_browser": false
|
|
5445
|
+
"open_browser": false,
|
|
5446
|
+
"warm_start": true
|
|
5429
5447
|
},
|
|
5430
5448
|
"argv": [
|
|
5431
5449
|
"{python}",
|
|
@@ -5532,7 +5550,8 @@
|
|
|
5532
5550
|
],
|
|
5533
5551
|
"host": "127.0.0.1",
|
|
5534
5552
|
"parallel": 1,
|
|
5535
|
-
"open_browser": false
|
|
5553
|
+
"open_browser": false,
|
|
5554
|
+
"warm_start": true
|
|
5536
5555
|
},
|
|
5537
5556
|
"argv": [
|
|
5538
5557
|
"{python}",
|
|
@@ -5638,7 +5657,8 @@
|
|
|
5638
5657
|
],
|
|
5639
5658
|
"host": "127.0.0.1",
|
|
5640
5659
|
"parallel": 1,
|
|
5641
|
-
"open_browser": false
|
|
5660
|
+
"open_browser": false,
|
|
5661
|
+
"warm_start": true
|
|
5642
5662
|
},
|
|
5643
5663
|
"argv": [
|
|
5644
5664
|
"{python}",
|
|
@@ -5753,7 +5773,8 @@
|
|
|
5753
5773
|
"host": "127.0.0.1",
|
|
5754
5774
|
"parallel": 1,
|
|
5755
5775
|
"open_browser": false,
|
|
5756
|
-
"shipped_expert_profile": "data/expert-profile-glm.txt"
|
|
5776
|
+
"shipped_expert_profile": "data/expert-profile-glm.txt",
|
|
5777
|
+
"warm_start": true
|
|
5757
5778
|
},
|
|
5758
5779
|
"argv": [
|
|
5759
5780
|
"{python}",
|
|
@@ -5863,7 +5884,8 @@
|
|
|
5863
5884
|
],
|
|
5864
5885
|
"host": "127.0.0.1",
|
|
5865
5886
|
"parallel": 1,
|
|
5866
|
-
"open_browser": false
|
|
5887
|
+
"open_browser": false,
|
|
5888
|
+
"warm_start": true
|
|
5867
5889
|
},
|
|
5868
5890
|
"argv": [
|
|
5869
5891
|
"{python}",
|
|
@@ -5973,7 +5995,8 @@
|
|
|
5973
5995
|
],
|
|
5974
5996
|
"host": "127.0.0.1",
|
|
5975
5997
|
"parallel": 1,
|
|
5976
|
-
"open_browser": false
|
|
5998
|
+
"open_browser": false,
|
|
5999
|
+
"warm_start": true
|
|
5977
6000
|
},
|
|
5978
6001
|
"argv": [
|
|
5979
6002
|
"{python}",
|
|
@@ -284,6 +284,9 @@ _DISCRETE_BANDWIDTH_GB_S = 1000.0
|
|
|
284
284
|
_UMA_BANDWIDTH_GB_S = 210.0
|
|
285
285
|
_HOST_BANDWIDTH_GB_S = 80.0
|
|
286
286
|
PLEASANT_FLOOR_TOK_S = 20.0
|
|
287
|
+
# Below this decode rate a model is practically unusable for interactive agent loops, so automatic
|
|
288
|
+
# selection prefers any fitting candidate at or above this floor over a higher-scored model below it.
|
|
289
|
+
USABLE_FLOOR_TOK_S = 5.0
|
|
287
290
|
# What each speed estimate rests on; every one but measured-decode is an estimate.
|
|
288
291
|
DECODE_BASES = {
|
|
289
292
|
"discrete-class": f"a discrete-GPU class constant, {_DISCRETE_BANDWIDTH_GB_S:g} GB/s",
|
|
@@ -344,10 +347,10 @@ def decode_estimate(
|
|
|
344
347
|
basis, bandwidth = "host-measured", budget.host_bandwidth_gb_s
|
|
345
348
|
elif spilled:
|
|
346
349
|
basis, bandwidth = "host-class", _HOST_BANDWIDTH_GB_S
|
|
347
|
-
elif budget.uma:
|
|
348
|
-
basis, bandwidth = "uma-class", _UMA_BANDWIDTH_GB_S
|
|
349
350
|
elif budget.gpu_bandwidth_gb_s:
|
|
350
351
|
basis, bandwidth = "gpu-spec", budget.gpu_bandwidth_gb_s
|
|
352
|
+
elif budget.uma:
|
|
353
|
+
basis, bandwidth = "uma-class", _UMA_BANDWIDTH_GB_S
|
|
351
354
|
else:
|
|
352
355
|
basis, bandwidth = "discrete-class", _DISCRETE_BANDWIDTH_GB_S
|
|
353
356
|
effective_backend = hardware_key(budget, backend)[1]
|