@simplexai/localmodels-darwin-x64 0.1.0-dev.58 → 0.1.0-dev.60
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 +105 -98
- package/modules/localmodels/__init__.py +1 -1
- package/modules/localmodels/__main__.py +104 -43
- package/modules/localmodels/app.py +1 -1
- package/modules/localmodels/apple_sensors.py +431 -0
- package/modules/localmodels/bifrost_admin.py +83 -8
- package/modules/localmodels/bifrost_checks.py +2 -2
- package/modules/localmodels/bifrost_config.py +235 -13
- package/modules/localmodels/bifrost_log.py +166 -0
- package/modules/localmodels/bifrost_models.py +1 -1
- package/modules/localmodels/budget.py +1 -1
- package/modules/localmodels/catalog.json +192 -77
- package/modules/localmodels/catalog.py +20 -3
- package/modules/localmodels/catalog_add.py +42 -11
- package/modules/localmodels/custom_hub.py +983 -0
- package/modules/localmodels/custom_hub_http.py +579 -0
- package/modules/localmodels/custom_probe.py +451 -0
- package/modules/localmodels/deploy.py +27 -5
- package/modules/localmodels/deploy_steps.py +5 -0
- package/modules/localmodels/download-mirrors.json +8 -0
- package/modules/localmodels/engines-prism-b12178-03ec600.json +131 -0
- package/modules/localmodels/engines-strata-poly-0.2.20-poly.6.json +94 -0
- package/modules/localmodels/engines.py +38 -8
- package/modules/localmodels/estimator.py +60 -7
- package/modules/localmodels/frontend.py +26 -21
- package/modules/localmodels/gateway.py +48 -3
- package/modules/localmodels/gateway_app_bifrost.py +4 -4
- package/modules/localmodels/gateway_bifrost.py +128 -21
- package/modules/localmodels/gguf.py +6 -0
- package/modules/localmodels/host_sensors.py +704 -0
- package/modules/localmodels/hosts.py +99 -12
- package/modules/localmodels/library_cli.py +181 -3
- package/modules/localmodels/library_convert.py +34 -0
- package/modules/localmodels/library_custom.py +831 -0
- package/modules/localmodels/library_elastic.py +182 -127
- package/modules/localmodels/library_gateway.py +193 -40
- package/modules/localmodels/library_jobs.py +92 -18
- package/modules/localmodels/library_kept.py +50 -6
- package/modules/localmodels/library_model.py +254 -2
- package/modules/localmodels/library_pricing.py +97 -8
- package/modules/localmodels/library_serve.py +196 -66
- package/modules/localmodels/library_smoke.py +315 -0
- package/modules/localmodels/library_state.py +81 -2
- package/modules/localmodels/library_status.py +144 -8
- package/modules/localmodels/metal.py +1 -1
- package/modules/localmodels/metal_probe.py +4 -4
- package/modules/localmodels/nvml_ctypes.py +431 -0
- package/modules/localmodels/plan_envelope.py +18 -7
- package/modules/localmodels/process_identity_linux.py +39 -0
- package/modules/localmodels/records.py +1 -0
- package/modules/localmodels/remote_ops.py +57 -8
- package/modules/localmodels/remote_ops_download.py +205 -53
- package/modules/localmodels/remote_ops_mirrors.py +43 -2
- package/modules/localmodels/remote_ops_ranges.py +2 -5
- package/modules/localmodels/remote_ops_service.py +95 -37
- package/modules/localmodels/remote_ops_verify.py +22 -5
- package/modules/localmodels/runtime-lock.json +19 -19
- package/modules/localmodels/runtime_auth.py +4 -1
- package/modules/localmodels/service_control.py +32 -1
- package/modules/localmodels/service_wiring.py +237 -12
- package/modules/localmodels/service_worker.py +6 -2
- package/modules/localmodels/services_cli.py +35 -27
- 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 +9 -7
- 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 +18 -2
- package/modules/localmodels/stack_lifecycle.py +26 -3
- package/modules/localmodels/stack_memory.py +1 -0
- 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/stack_view.py +77 -53
- package/modules/localmodels/stack_view_demo.py +36 -5
- package/modules/localmodels/stack_view_events.py +147 -12
- package/modules/localmodels/stack_view_gpu.py +97 -17
- package/modules/localmodels/stack_view_llm.py +15 -0
- package/modules/localmodels/stack_view_measure.py +4 -1
- package/modules/localmodels/stack_view_schema.py +54 -8
- package/modules/localmodels/stack_view_serve.py +40 -3
- package/modules/localmodels/stack_view_slots.py +89 -10
- package/modules/localmodels/stack_view_telemetry.py +163 -0
- package/modules/localmodels/stack_view_text.py +5 -2
- package/modules/localmodels/stack_view_tick.py +658 -0
- package/modules/localmodels/stack_view_words.py +4 -0
- package/modules/localmodels/{strata-poly-serve-0.2.19-poly.1.txt → strata-poly-serve-0.2.20-poly.6.txt} +1 -1
- package/modules/localmodels/suite.py +45 -27
- package/modules/localmodels/telemetry_math.py +538 -0
- package/modules/localmodels/transport.py +13 -2
- package/modules/localmodels/web/view/view.js +1 -1
- package/modules/{simplex_localmodels-0.1.0.dev58.dist-info → simplex_localmodels-0.1.0.dev60.dist-info}/METADATA +1 -1
- package/modules/{simplex_localmodels-0.1.0.dev58.dist-info → simplex_localmodels-0.1.0.dev60.dist-info}/RECORD +102 -95
- package/package.json +1 -1
- package/tool.json +1 -1
- package/modules/localmodels/bifrost_datasheet.py +0 -53
- package/modules/localmodels/bifrost_provider.py +0 -88
- package/modules/localmodels/bifrost_unit.py +0 -99
- package/modules/localmodels/engines-strata-poly-0.2.19-poly.1.json +0 -79
- package/modules/localmodels/gateway_switch.py +0 -51
- package/modules/localmodels/library_floor.py +0 -78
- package/modules/localmodels/service_stop.py +0 -52
- /package/modules/{simplex_localmodels-0.1.0.dev58.dist-info → simplex_localmodels-0.1.0.dev60.dist-info}/WHEEL +0 -0
- /package/modules/{simplex_localmodels-0.1.0.dev58.dist-info → simplex_localmodels-0.1.0.dev60.dist-info}/entry_points.txt +0 -0
- /package/modules/{simplex_localmodels-0.1.0.dev58.dist-info → simplex_localmodels-0.1.0.dev60.dist-info}/licenses/NOTICE +0 -0
- /package/modules/{simplex_localmodels-0.1.0.dev58.dist-info → simplex_localmodels-0.1.0.dev60.dist-info}/licenses/localmodels/HERMES-LICENSE +0 -0
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
"""The model datasheets of the stack's Bifrost, written beside its config at each wiring.
|
|
2
|
-
|
|
3
|
-
Bifrost states a listed model's window (``/v1/models`` ``context_length``) only from a row of its
|
|
4
|
-
pricing datasheet. On an empty config store, which every config change leaves, it loads that
|
|
5
|
-
sheet and the model-parameters sheet before it answers, and exits when either cannot be read.
|
|
6
|
-
Its defaults live on getbifrost.ai, describe cloud models only and need the network, so the
|
|
7
|
-
stack's Bifrost reads both from these files instead: the LLM's names with the window this
|
|
8
|
-
deployment launches it with, and no per-model parameters (nothing is dropped from a request).
|
|
9
|
-
Nor does it fetch its MCP server library, which only the admin UI's catalog shows.
|
|
10
|
-
"""
|
|
11
|
-
|
|
12
|
-
from __future__ import annotations
|
|
13
|
-
|
|
14
|
-
import os
|
|
15
|
-
from collections.abc import Iterable
|
|
16
|
-
from pathlib import Path
|
|
17
|
-
from typing import Any
|
|
18
|
-
|
|
19
|
-
DATASHEET = "datasheet.json"
|
|
20
|
-
PARAMETERS = "model-parameters.json"
|
|
21
|
-
FILES = (DATASHEET, PARAMETERS)
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
def file_url(app: Path, name: str, windows: bool = os.name == "nt") -> str:
|
|
25
|
-
"""A file URL for a sheet in ``app`` that Bifrost can open. Bifrost reads a file URL's path
|
|
26
|
-
as it stands, so ``file:///C:/x/datasheet.json`` is ``/C:/x/...`` on Windows, which does
|
|
27
|
-
not open, and Bifrost exits at start (dev38 Windows library load). On Windows the URL is
|
|
28
|
-
relative to its working directory, ``app`` (gateway_bifrost._start, the only way Bifrost
|
|
29
|
-
runs there); elsewhere absolute, as a systemd unit's working directory is not ``app``."""
|
|
30
|
-
return f"file:./{name}" if windows else (app / name).as_uri()
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
def framework(app: Path) -> dict[str, Any]:
|
|
34
|
-
"""config.json's ``framework``: the datasheets from ``app``, and no MCP library sync (0 is
|
|
35
|
-
Bifrost's off switch; any other interval fetches it)."""
|
|
36
|
-
return {
|
|
37
|
-
"pricing": {
|
|
38
|
-
"pricing_url": file_url(app, DATASHEET),
|
|
39
|
-
"model_parameters_url": file_url(app, PARAMETERS),
|
|
40
|
-
"mcp_library_sync_interval": 0,
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
def sheets(provider: str, names: Iterable[str], context: int | None) -> dict[str, Any]:
|
|
46
|
-
"""The files ``framework`` names. One pricing row per name the LLM's key lists, keyed as
|
|
47
|
-
Bifrost looks rows up (provider, the name after the first slash, a mode), with the window the
|
|
48
|
-
LLM launches with (``-c``; one request may fill it); a plan without a window has none."""
|
|
49
|
-
row = {"provider": provider, "mode": "chat", "context_length": context}
|
|
50
|
-
return {
|
|
51
|
-
DATASHEET: {f"{provider}/{name}": row for name in names} if context else {},
|
|
52
|
-
PARAMETERS: {},
|
|
53
|
-
}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
"""Bifrost provider configuration shared by stack and standalone app gateways."""
|
|
2
|
-
|
|
3
|
-
from __future__ import annotations
|
|
4
|
-
|
|
5
|
-
import ipaddress
|
|
6
|
-
import urllib.parse
|
|
7
|
-
from typing import Any
|
|
8
|
-
|
|
9
|
-
from localmodels import harness
|
|
10
|
-
|
|
11
|
-
# Loopback upstreams (llama-server uses cpp-httplib's 5 s keep-alive timeout; auth_proxy fronts
|
|
12
|
-
# local services) sit on 127.0.0.1 where a fresh dial costs microseconds, while Bifrost's
|
|
13
|
-
# fasthttp pool defaults to a 30 s idle timeout and its StaleConnectionRetryIfErr only matches
|
|
14
|
-
# POSIX "broken pipe" / "connection reset by peer", not Windows Winsock WSAECONNABORTED (10053)
|
|
15
|
-
# or WSAECONNRESET (10054). Closing loopback connections after each response, capping idle
|
|
16
|
-
# keep-alive below 5 s, and allowing 2 fast retries on pre-response transport failures prevents
|
|
17
|
-
# Windows 502 wsasend aborts (evidence/2026-11-19-linger-agentic-batch1/REPORT.md, Issue #3).
|
|
18
|
-
LOOPBACK_KEEP_ALIVE_S = 2
|
|
19
|
-
LOOPBACK_MAX_RETRIES = 2
|
|
20
|
-
LOOPBACK_RETRY_INITIAL_MS = 100
|
|
21
|
-
LOOPBACK_RETRY_MAX_MS = 500
|
|
22
|
-
|
|
23
|
-
# What each provider may be asked: everything else Bifrost refuses before it reaches the
|
|
24
|
-
# service. The LLM speaks chat only, so Bifrost turns Responses (Codex) and Anthropic Messages
|
|
25
|
-
# (Claude Code) requests into chat completions instead of calling /v1/responses upstream.
|
|
26
|
-
_ALLOWED = {
|
|
27
|
-
"llm": {"list_models": True, "chat_completion": True, "chat_completion_stream": True},
|
|
28
|
-
"decision": {"list_models": True, "decisions": True},
|
|
29
|
-
"embedding": {"list_models": True, "embedding": True},
|
|
30
|
-
# Bifrost's openai-type rerank sends documents as {"text": ...} objects, which llama-server
|
|
31
|
-
# refuses; its cohere type sends the plain strings llama-server reads.
|
|
32
|
-
"rerank": {"rerank": True},
|
|
33
|
-
"stt": {"list_models": True, "transcription": True, "transcription_stream": True},
|
|
34
|
-
}
|
|
35
|
-
_BASE_TYPE = {"decision": "typesafe", "rerank": "cohere"}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
def _is_loopback(url: str) -> bool:
|
|
39
|
-
host = (urllib.parse.urlsplit(url).hostname or "").strip().lower()
|
|
40
|
-
if host == "localhost":
|
|
41
|
-
return True
|
|
42
|
-
try:
|
|
43
|
-
return ipaddress.ip_address(host).is_loopback
|
|
44
|
-
except ValueError:
|
|
45
|
-
return False
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
def render(role: str, url: str, model: str, key: str, pid: str) -> dict[str, Any]:
|
|
49
|
-
custom: dict[str, Any] = {
|
|
50
|
-
"base_provider_type": _BASE_TYPE.get(role, "openai"),
|
|
51
|
-
"allowed_requests": _ALLOWED[role],
|
|
52
|
-
}
|
|
53
|
-
if role == "rerank":
|
|
54
|
-
custom["request_path_overrides"] = {"rerank": "/v1/rerank"}
|
|
55
|
-
entry: dict[str, Any] = {"id": pid, "name": pid, "value": key, "models": [model], "weight": 1}
|
|
56
|
-
if role == "llm":
|
|
57
|
-
# Bifrost v2.3.0 lists (/v1/models as <pid>/<name>, /anthropic/v1/models bare) and routes
|
|
58
|
-
# a name only when the key has it in both ``models`` and ``aliases``; either alone does not.
|
|
59
|
-
entry["models"] = [model, harness.GROUP]
|
|
60
|
-
entry["aliases"] = {harness.GROUP: model}
|
|
61
|
-
network_config: dict[str, Any] = {
|
|
62
|
-
"base_url": origin(url),
|
|
63
|
-
"allow_private_network": True,
|
|
64
|
-
"max_retries": 0,
|
|
65
|
-
"default_request_timeout_in_seconds": 600,
|
|
66
|
-
"stream_idle_timeout_in_seconds": 600,
|
|
67
|
-
}
|
|
68
|
-
if _is_loopback(url):
|
|
69
|
-
network_config.update(
|
|
70
|
-
{
|
|
71
|
-
"max_retries": LOOPBACK_MAX_RETRIES,
|
|
72
|
-
"retry_backoff_initial": LOOPBACK_RETRY_INITIAL_MS,
|
|
73
|
-
"retry_backoff_max": LOOPBACK_RETRY_MAX_MS,
|
|
74
|
-
"keep_alive_timeout_in_seconds": LOOPBACK_KEEP_ALIVE_S,
|
|
75
|
-
"extra_headers": {"Connection": "close"},
|
|
76
|
-
}
|
|
77
|
-
)
|
|
78
|
-
return {
|
|
79
|
-
"keys": [entry],
|
|
80
|
-
"network_config": network_config,
|
|
81
|
-
"custom_provider_config": custom,
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
def origin(url: str) -> str:
|
|
86
|
-
"""Bifrost appends the API path (/v1/...) to a provider's base URL itself."""
|
|
87
|
-
url = url.rstrip("/")
|
|
88
|
-
return url[: -len("/v1")] if url.endswith("/v1") else url
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
"""The systemd --user unit of the stack's Bifrost instance: its name, text and the retirement of
|
|
2
|
-
the untagged unit every install shared before 2026-11-10."""
|
|
3
|
-
|
|
4
|
-
from __future__ import annotations
|
|
5
|
-
|
|
6
|
-
import os
|
|
7
|
-
import subprocess
|
|
8
|
-
from collections.abc import Callable
|
|
9
|
-
from pathlib import Path
|
|
10
|
-
|
|
11
|
-
from localmodels import harness, hosts, plan_envelope
|
|
12
|
-
from localmodels.harness import HarnessError
|
|
13
|
-
|
|
14
|
-
LEGACY_UNIT = "localmodels-gateway" # the one name every install shared before 2026-11-10
|
|
15
|
-
UNIT_DIR = harness.UNIT_DIR
|
|
16
|
-
|
|
17
|
-
Systemctl = Callable[..., "subprocess.CompletedProcess[str]"]
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
def unit_for(app: Path) -> str:
|
|
21
|
-
"""``localmodels-<tag>-gateway``, the tag naming the directory the instance runs from."""
|
|
22
|
-
return f"localmodels-{plan_envelope.root_tag(str(app))}-gateway"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
def unit(record: hosts.OwnedBifrost) -> str:
|
|
26
|
-
"""The unit a record's instance runs under; records from before the tag name the old one."""
|
|
27
|
-
return record.get("unit") or LEGACY_UNIT
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
def unit_file(name: str) -> Path:
|
|
31
|
-
return Path(os.path.expanduser(UNIT_DIR)) / f"{name}.service"
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
def text(binary: str, app: Path, addr: str) -> str:
|
|
35
|
-
host, _, port = addr.rpartition(":")
|
|
36
|
-
return (
|
|
37
|
-
"# localmodels: Bifrost gateway of the local stack; stack remove deletes this unit\n"
|
|
38
|
-
"[Unit]\n"
|
|
39
|
-
"Description=localmodels Bifrost gateway\n"
|
|
40
|
-
"After=network.target\n\n"
|
|
41
|
-
"[Service]\n"
|
|
42
|
-
f"WorkingDirectory={app}\n"
|
|
43
|
-
"Environment=NO_PROXY=127.0.0.1,localhost no_proxy=127.0.0.1,localhost\n"
|
|
44
|
-
f"ExecStart={binary} -app-dir {app} -host {host} -port {port} -log-style json "
|
|
45
|
-
"-log-level warn\n"
|
|
46
|
-
"Restart=on-failure\n"
|
|
47
|
-
"RestartSec=5\n"
|
|
48
|
-
"UMask=0077\n\n"
|
|
49
|
-
"[Install]\n"
|
|
50
|
-
"WantedBy=default.target\n"
|
|
51
|
-
)
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
def retire_legacy(name: str, app: Path, systemctl: Systemctl) -> None:
|
|
55
|
-
"""Stop, disable and delete the untagged unit when it runs this instance's directory; a unit
|
|
56
|
-
of that name running any other directory belongs to another install and is kept."""
|
|
57
|
-
old = unit_file(LEGACY_UNIT)
|
|
58
|
-
if name == LEGACY_UNIT or old.is_symlink() or not old.is_file():
|
|
59
|
-
return
|
|
60
|
-
try:
|
|
61
|
-
body = old.read_text(encoding="utf-8")
|
|
62
|
-
except (OSError, UnicodeDecodeError):
|
|
63
|
-
return
|
|
64
|
-
if old.stat().st_uid != os.getuid() or f" -app-dir {app} -host " not in body:
|
|
65
|
-
return
|
|
66
|
-
if systemctl("disable", "--now", f"{LEGACY_UNIT}.service").returncode != 0:
|
|
67
|
-
raise HarnessError(f"systemctl --user disable --now {LEGACY_UNIT} failed")
|
|
68
|
-
old.unlink()
|
|
69
|
-
systemctl("daemon-reload")
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
def require_owned(record: hosts.OwnedBifrost, path: Path, systemctl: Systemctl) -> None:
|
|
73
|
-
"""Require both the private unit's exact content and systemd's loaded fragment."""
|
|
74
|
-
try:
|
|
75
|
-
info = path.lstat()
|
|
76
|
-
expected = text(record["binary"], Path(record["app_dir"]), record["addr"])
|
|
77
|
-
fragment = systemctl("show", "-p", "FragmentPath", "--value", unit(record) + ".service")
|
|
78
|
-
if (
|
|
79
|
-
path.is_symlink()
|
|
80
|
-
or info.st_uid != os.getuid()
|
|
81
|
-
or info.st_mode & 0o022
|
|
82
|
-
or path.read_text() != expected
|
|
83
|
-
or fragment.returncode
|
|
84
|
-
or os.path.realpath(fragment.stdout.strip()) != os.path.realpath(path)
|
|
85
|
-
):
|
|
86
|
-
raise HarnessError("cannot verify ownership of the Bifrost unit; left untouched")
|
|
87
|
-
except OSError:
|
|
88
|
-
raise HarnessError("cannot verify ownership of the Bifrost unit; left untouched") from None
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
def pause(record: hosts.OwnedBifrost, path: Path, systemctl: Systemctl) -> None:
|
|
92
|
-
"""Stop the verified unit and confirm that systemd no longer has its process."""
|
|
93
|
-
require_owned(record, path, systemctl)
|
|
94
|
-
name = unit(record) + ".service"
|
|
95
|
-
if systemctl("stop", name).returncode:
|
|
96
|
-
raise HarnessError("Bifrost unit could not stop")
|
|
97
|
-
pid = systemctl("show", "-p", "MainPID", "--value", name)
|
|
98
|
-
if pid.returncode or pid.stdout.strip() != "0":
|
|
99
|
-
raise HarnessError("Bifrost unit did not stop")
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"schema": "localmodels.engine-lock/v1",
|
|
3
|
-
"tag": "strata-poly-0.2.19-poly.1",
|
|
4
|
-
"commit": "v0.2.19-poly.1",
|
|
5
|
-
"source": "https://github.com/simplexai-labs/PolyStrata/releases/tag/v0.2.19-poly.1",
|
|
6
|
-
"note": "PolyStrata 0.2.19-poly.1 (MIT, tag v0.2.19-poly.1), built by this project on 2026-11-23 because upstream publishes only a Windows engine. The engine archive holds the strata-poly and strata-vision binaries, PolyStrata's Python server (serve/, strata_control/, strata_cli/, setup.py) and tokenizer tools (tools/strata_tokenizer.py, tools/gguf_reader.py) as released, LICENSE.PolyStrata and BUILD.json; the companion CUDA 13.0.3 runtime archive (reused from 0.1.45-poly.9, built from the same nvidia/cuda:13.0.3-devel-ubuntu22.04 digest) holds libcublas, libcublasLt and libcudart under NVIDIA's license. Both unpack into one directory, which the service puts on LD_LIBRARY_PATH. Built in nvidia/cuda:13.0.3-devel-ubuntu22.04 without a GPU, with upstream's Windows release flags: -DSTRATA_PORTABLE=ON (AVX2 CPU baseline) and CUDA architectures 75, 80, 86, 89 and 120 (RTX 20, 30, 40 and 50 series), plus -DSTRATA_VISION_CUDA=ON for strata-vision. Needs an NVIDIA driver for CUDA 13.0 (580 or newer), glibc 2.34 and libstdc++ 12 (Ubuntu 22.04, Debian 12 or newer); neither binary links libgomp. Source: PolyStrata v0.2.19-poly.1 tag archive sha256 994e20bd... (full digests in BUILD.json). The Windows build is upstream's own release zip (strata-poly.exe and strata-vision.exe, CUDA 13.0, same CUDA architectures, importing only cublas64_13.dll and KERNEL32.dll), paired with the tag archive's terminal/ server packages and NVIDIA's cuBLAS 13.0.2.14 wheel (nvidia/cu13/bin/x86_64 on lib_dirs).",
|
|
7
|
-
"builds": [
|
|
8
|
-
{
|
|
9
|
-
"platform": "linux",
|
|
10
|
-
"arch": "x64",
|
|
11
|
-
"backend": "cuda",
|
|
12
|
-
"min_cuda": "13.0",
|
|
13
|
-
"min_glibc": "2.34",
|
|
14
|
-
"binary": "strata-poly",
|
|
15
|
-
"assets": [
|
|
16
|
-
{
|
|
17
|
-
"name": "strata-poly-0.2.19-poly.1-linux-x64-cuda13.tar.gz",
|
|
18
|
-
"url": "https://d2ikbbcl3j6jz9.cloudfront.net/cli/localmodels/engines/strata-poly/0.2.19-poly.1/strata-poly-0.2.19-poly.1-linux-x64-cuda13.tar.gz",
|
|
19
|
-
"sha256": "2247984d9c99acebf2a8f7a917365da326e93ab066e15885961477596bc77a7a",
|
|
20
|
-
"size_bytes": 74988874,
|
|
21
|
-
"npm_copy": {
|
|
22
|
-
"package": "@simplexai/engine-strata-poly-0.2.19-poly.1-linux-x64-cuda13",
|
|
23
|
-
"version": "0.0.0-sha256-2247984d9c99aceb"
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
"name": "cudart-strata-poly-linux-x64-cuda13.0.3.tar.gz",
|
|
28
|
-
"url": "https://d2ikbbcl3j6jz9.cloudfront.net/cli/localmodels/engines/strata-poly/0.1.45-poly.9/cudart-strata-poly-linux-x64-cuda13.0.3.tar.gz",
|
|
29
|
-
"sha256": "189c3a9fb5fd5f87331ffcedf03d5469c2a9c91f46379299ee6ea277364f05d2",
|
|
30
|
-
"size_bytes": 422462968
|
|
31
|
-
}
|
|
32
|
-
]
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
"platform": "win32",
|
|
36
|
-
"arch": "x64",
|
|
37
|
-
"backend": "cuda",
|
|
38
|
-
"min_cuda": "13.0",
|
|
39
|
-
"binary": "strata-poly.exe",
|
|
40
|
-
"assets": [
|
|
41
|
-
{
|
|
42
|
-
"name": "strata-poly-windows-x64-605522f294c7a21a.zip",
|
|
43
|
-
"url": "https://github.com/simplexai-labs/PolyStrata/releases/download/v0.2.19-poly.1/strata-poly-windows-x64-605522f294c7a21a.zip",
|
|
44
|
-
"sha256": "c9b2e256514db91fda67a06243e8ef89c434c4b8327effd5a126dc3c093bcb75",
|
|
45
|
-
"size_bytes": 72788413,
|
|
46
|
-
"npm_copy": {
|
|
47
|
-
"package": "@simplexai/engine-strata-poly-windows-x64-605522f294c7a21a",
|
|
48
|
-
"version": "0.0.0-sha256-c9b2e256514db91f"
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
"name": "polystrata-0.2.19-poly.1-source.tar.gz",
|
|
53
|
-
"url": "https://github.com/simplexai-labs/PolyStrata/archive/refs/tags/v0.2.19-poly.1.tar.gz",
|
|
54
|
-
"sha256": "994e20bdc7a4de32c7c53a5802a4fb5eba2277da3932f0f091ead47f1ca69342",
|
|
55
|
-
"size_bytes": 46661873,
|
|
56
|
-
"members": [
|
|
57
|
-
"terminal/serve/",
|
|
58
|
-
"terminal/strata_control/",
|
|
59
|
-
"terminal/strata_cli/",
|
|
60
|
-
"terminal/tools/strata_tokenizer.py",
|
|
61
|
-
"terminal/tools/gguf_reader.py",
|
|
62
|
-
"terminal/setup.py",
|
|
63
|
-
"LICENSE"
|
|
64
|
-
],
|
|
65
|
-
"npm_copy": {
|
|
66
|
-
"package": "@simplexai/engine-polystrata-0.2.19-poly.1-source",
|
|
67
|
-
"version": "0.0.0-sha256-994e20bdc7a4de32"
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
"name": "nvidia_cublas-13.0.2.14-py3-none-win_amd64.whl",
|
|
72
|
-
"url": "https://files.pythonhosted.org/packages/f3/91/bda39230b7a4c102bb724c21b50823efc63544490a885fea0b604911c0ab/nvidia_cublas-13.0.2.14-py3-none-win_amd64.whl",
|
|
73
|
-
"sha256": "5f7a90456b1392db60e28719547ba6e00696bfa81304b6887cf287f9edf2c1d7",
|
|
74
|
-
"size_bytes": 401887280
|
|
75
|
-
}
|
|
76
|
-
]
|
|
77
|
-
}
|
|
78
|
-
]
|
|
79
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"""Moving a stack between its two gateways: before wiring one, undo what this tool wired into
|
|
2
|
-
the other (``gateway.wire`` calls these). Split from ``gateway_bifrost``, which owns the instance.
|
|
3
|
-
"""
|
|
4
|
-
|
|
5
|
-
from __future__ import annotations
|
|
6
|
-
|
|
7
|
-
from localmodels import gateway_bifrost, hosts
|
|
8
|
-
from localmodels.harness import HarnessError
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
def leave_magpie(tools_dir: str) -> list[str]:
|
|
12
|
-
"""Before a Bifrost wiring: undo what this tool wired into Magpie (the stack moved). The
|
|
13
|
-
plan being wired is already the latest run record, so both the unwiring and the shutdown are
|
|
14
|
-
checked against the earlier approved plan that ran Magpie (``magpie_target``); without one
|
|
15
|
-
they fail closed and leave Magpie and its records as they are."""
|
|
16
|
-
from localmodels import bifrost_clients, gateway, harness_gateway
|
|
17
|
-
|
|
18
|
-
doc = hosts.load_owned(tools_dir)
|
|
19
|
-
started = doc["gateway"]["started"]
|
|
20
|
-
if not bifrost_clients.magpie_wired(doc) and not started:
|
|
21
|
-
return []
|
|
22
|
-
if started: # a restored handoff receipt can precede a failed Magpie shutdown
|
|
23
|
-
bifrost_clients.refuse_changed_handoff(doc, tools_dir)
|
|
24
|
-
magpie = gateway.magpie_binary(doc)
|
|
25
|
-
previous = harness_gateway.magpie_target(tools_dir)
|
|
26
|
-
results = gateway._unwire_magpie(magpie, tools_dir, plan=previous)
|
|
27
|
-
if all(r["ok"] for r in results) and started:
|
|
28
|
-
results.append(
|
|
29
|
-
gateway.stop_gateway(magpie, started, tools_dir, plan=previous)
|
|
30
|
-
if magpie is not None
|
|
31
|
-
else {"check": "magpie", "ok": False, "detail": "no Magpie started by this tool"}
|
|
32
|
-
)
|
|
33
|
-
if any(not r["ok"] for r in results):
|
|
34
|
-
raise HarnessError(
|
|
35
|
-
"undoing this tool's wiring in Magpie failed, not switched to Bifrost: "
|
|
36
|
-
+ "; ".join(r["check"] for r in results if not r["ok"])
|
|
37
|
-
)
|
|
38
|
-
return [f"Magpie wiring undone ({len(results)} items)"]
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
def leave(tools_dir: str) -> list[str]:
|
|
42
|
-
"""Before a Magpie wiring: stop this tool's Bifrost and give pi and the clients back."""
|
|
43
|
-
if not hosts.load_owned(tools_dir)["gateway"].get("bifrost"):
|
|
44
|
-
return []
|
|
45
|
-
results = gateway_bifrost.unwire(tools_dir)
|
|
46
|
-
if any(not r["ok"] for r in results):
|
|
47
|
-
raise HarnessError(
|
|
48
|
-
"undoing this tool's Bifrost gateway failed, not switched to Magpie: "
|
|
49
|
-
+ "; ".join(r["check"] for r in results if not r["ok"])
|
|
50
|
-
)
|
|
51
|
-
return ["Bifrost gateway stopped, pi and the clients restored"]
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
"""Floor metadata for library models that do not fit this computer's pools."""
|
|
2
|
-
|
|
3
|
-
from __future__ import annotations
|
|
4
|
-
|
|
5
|
-
from localmodels import budget, context_policy, library_kept, library_pricing, metal, suite, vision
|
|
6
|
-
from localmodels.estimator import agent_footprint_bytes, eager
|
|
7
|
-
from localmodels.library_pricing import Model
|
|
8
|
-
from localmodels.probe import HostFacts
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
def floor_metadata(
|
|
12
|
-
facts: HostFacts,
|
|
13
|
-
model: Model,
|
|
14
|
-
shortfall_bytes: int = 0,
|
|
15
|
-
*,
|
|
16
|
-
memory_kind: str = "",
|
|
17
|
-
) -> tuple[int, int, bool, int]:
|
|
18
|
-
"""Estimated floor memory, context window, vision flag and download bytes when a model does
|
|
19
|
-
not fit this computer's pools (``plan is None``), using the same agent posture.
|
|
20
|
-
|
|
21
|
-
Honors per-entry posture overrides (such as ``ubatch``), accounts for Metal and CUDA UMA
|
|
22
|
-
unified memory, and avoids mixing host RAM shortfalls (``memory_kind == "ram"``) into VRAM
|
|
23
|
-
floor bytes.
|
|
24
|
-
"""
|
|
25
|
-
if library_kept.retired(model.entry): # no recipe left to price; only what was on disk
|
|
26
|
-
return shortfall_bytes, 0, False, sum(f.size_bytes for f in model.variant.files)
|
|
27
|
-
if model.entry.runtime == "strata-poly":
|
|
28
|
-
recipe = suite.recipe(model.entry.id)
|
|
29
|
-
window = int(recipe.get("context") or model.entry.n_ctx_train)
|
|
30
|
-
active = model.entry.agent_posture(
|
|
31
|
-
context_policy.posture_for(library_pricing.posture(), "cuda")
|
|
32
|
-
)
|
|
33
|
-
vision_on = bool(recipe.get("vision")) and active.vision != "off"
|
|
34
|
-
download = sum(
|
|
35
|
-
int(f["size_bytes"]) for f in recipe["files"] if vision_on or not f.get("vision")
|
|
36
|
-
)
|
|
37
|
-
floor_bytes = int(recipe.get("min_vram_free_bytes") or recipe.get("vram_bytes") or 0)
|
|
38
|
-
effective_shortfall = 0 if memory_kind == "ram" else shortfall_bytes
|
|
39
|
-
return max(effective_shortfall, floor_bytes), window, vision_on, download
|
|
40
|
-
metal_unified = metal.supported(facts)
|
|
41
|
-
cuda_uma = not metal_unified and budget.unified_pool_bytes(facts) is not None
|
|
42
|
-
active = model.entry.agent_posture(
|
|
43
|
-
context_policy.posture_for(library_pricing.posture(), "metal" if metal_unified else "cuda")
|
|
44
|
-
)
|
|
45
|
-
profile = eager(model.entry.profile(model.variant))
|
|
46
|
-
window = profile.n_ctx_train if 0 < profile.n_ctx_train < active.floor else active.floor
|
|
47
|
-
vision_on = vision.llama_reader_enabled(model.entry.mmproj, active.vision)
|
|
48
|
-
mtp = bool(model.entry.mtp_capable and model.entry.agent_mtp and active.mtp_draft_depth > 0)
|
|
49
|
-
core = agent_footprint_bytes(
|
|
50
|
-
profile,
|
|
51
|
-
window,
|
|
52
|
-
slots=active.slots,
|
|
53
|
-
kv_types=active.kv_types[-1],
|
|
54
|
-
ubatch=active.ubatch,
|
|
55
|
-
mtp=mtp,
|
|
56
|
-
)
|
|
57
|
-
if metal_unified or cuda_uma:
|
|
58
|
-
vision_extra = (
|
|
59
|
-
vision.llama_device_bytes(model.entry.mmproj, "gpu")
|
|
60
|
-
if vision_on and model.entry.mmproj is not None
|
|
61
|
-
else 0
|
|
62
|
-
)
|
|
63
|
-
host_side = (
|
|
64
|
-
context_policy.cache_floor_bytes(active, profile)
|
|
65
|
-
+ context_policy.metal_host_bytes(profile, active)
|
|
66
|
-
if metal_unified
|
|
67
|
-
else 0
|
|
68
|
-
)
|
|
69
|
-
floor_bytes = core + vision_extra + host_side
|
|
70
|
-
else:
|
|
71
|
-
floor_bytes = core
|
|
72
|
-
download = sum(f.size_bytes for f in model.variant.files)
|
|
73
|
-
if vision_on and model.entry.mmproj is not None:
|
|
74
|
-
download += model.entry.mmproj.size_bytes
|
|
75
|
-
if model.entry.mtp_head is not None:
|
|
76
|
-
download += model.entry.mtp_head.size_bytes
|
|
77
|
-
effective_shortfall = 0 if memory_kind == "ram" else shortfall_bytes
|
|
78
|
-
return max(effective_shortfall, floor_bytes), window, vision_on, download
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"""``foundations stop``: end this root's controller and its autostart, for an uninstaller.
|
|
2
|
-
|
|
3
|
-
A controller started by 0.1.0.dev34 or later exits cleanly when asked over its loopback API.
|
|
4
|
-
An earlier one has no such request: ``service_upgrade`` signals it only after its lock and exact
|
|
5
|
-
command prove it is this root's controller, on Linux, macOS and Windows. Model services the
|
|
6
|
-
controller started keep running; it never owned their processes.
|
|
7
|
-
"""
|
|
8
|
-
|
|
9
|
-
from __future__ import annotations
|
|
10
|
-
|
|
11
|
-
import subprocess
|
|
12
|
-
from pathlib import Path
|
|
13
|
-
from typing import Any
|
|
14
|
-
|
|
15
|
-
from localmodels import runtime_io, service_autostart, service_upgrade
|
|
16
|
-
|
|
17
|
-
SCHEMA = "localmodels.service-controller-stop/v1"
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
def stop(root: Path) -> dict[str, Any]:
|
|
21
|
-
"""Idempotent: nothing under ``root``, or nothing running, is a successful stop."""
|
|
22
|
-
result: dict[str, Any] = {
|
|
23
|
-
"schema": SCHEMA,
|
|
24
|
-
"root": str(root),
|
|
25
|
-
"stopped": False,
|
|
26
|
-
"method": None,
|
|
27
|
-
"autostart": "none",
|
|
28
|
-
}
|
|
29
|
-
if not (root / "control.json").is_file():
|
|
30
|
-
return result
|
|
31
|
-
try:
|
|
32
|
-
_stop(root, result)
|
|
33
|
-
except (OSError, ValueError, subprocess.SubprocessError) as error:
|
|
34
|
-
result.update(ok=False, stopped=False, error=str(error))
|
|
35
|
-
if isinstance(error, service_upgrade.ControllerError):
|
|
36
|
-
result["code"] = error.code
|
|
37
|
-
return result
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
def _stop(root: Path, result: dict[str, Any]) -> None:
|
|
41
|
-
from localmodels.services_cli import read_configuration
|
|
42
|
-
|
|
43
|
-
with runtime_io.private_lock(root / "ensure.lock"):
|
|
44
|
-
config = read_configuration(root)
|
|
45
|
-
config["stopped"] = True
|
|
46
|
-
runtime_io.write_private_json(root / "control.json", config)
|
|
47
|
-
running = not service_upgrade.idle(root)
|
|
48
|
-
result["autostart"] = service_autostart.unregister(root)
|
|
49
|
-
if not running and service_upgrade.idle(root):
|
|
50
|
-
return
|
|
51
|
-
result["stopped"] = True
|
|
52
|
-
result["method"] = service_upgrade.end_controller(root) or "systemd"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|