@simplexai/localmodels-win32-x64 0.1.0-dev.65 → 0.1.0-dev.66

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 (57) hide show
  1. package/bootstrap.identity +1 -1
  2. package/bootstrap.sha256 +56 -55
  3. package/modules/localmodels/__init__.py +1 -1
  4. package/modules/localmodels/auth_proxy.py +34 -2
  5. package/modules/localmodels/catalog.json +500 -16
  6. package/modules/localmodels/custom_hub.py +54 -6
  7. package/modules/localmodels/custom_probe.py +28 -0
  8. package/modules/localmodels/debug_stub_server.py +34 -1
  9. package/modules/localmodels/deploy.py +33 -349
  10. package/modules/localmodels/download-mirrors.json +43 -3
  11. package/modules/localmodels/draft_spec.py +1 -1
  12. package/modules/localmodels/engine_adapters/__init__.py +4 -2
  13. package/modules/localmodels/engine_adapters/auxiliary.py +4 -1
  14. package/modules/localmodels/engine_adapters/llama_cpp.py +539 -0
  15. package/modules/localmodels/engines-b11583.json +9 -5
  16. package/modules/localmodels/engines-b12757-mix-ef2df21.json +85 -1
  17. package/modules/localmodels/engines.json +9 -5
  18. package/modules/localmodels/harness_gateway.py +14 -3
  19. package/modules/localmodels/harness_probe.py +64 -3
  20. package/modules/localmodels/library_custom.py +9 -7
  21. package/modules/localmodels/library_elastic.py +5 -4
  22. package/modules/localmodels/library_jobs.py +138 -25
  23. package/modules/localmodels/library_model.py +22 -2
  24. package/modules/localmodels/library_order.py +1 -1
  25. package/modules/localmodels/library_serve.py +11 -4
  26. package/modules/localmodels/library_state.py +12 -0
  27. package/modules/localmodels/library_status.py +10 -0
  28. package/modules/localmodels/planning/budget.py +8 -3
  29. package/modules/localmodels/remote_ops_mirrors.py +55 -19
  30. package/modules/localmodels/service_deployment.py +3 -3
  31. package/modules/localmodels/setup_inspection.py +28 -1
  32. package/modules/localmodels/setup_inspection_harness.py +4 -1
  33. package/modules/localmodels/setup_text.py +6 -0
  34. package/modules/localmodels/slot_cache.py +1 -3
  35. package/modules/localmodels/speech_admission.py +16 -4
  36. package/modules/localmodels/speech_catalog.py +5 -1
  37. package/modules/localmodels/speech_cli.py +5 -5
  38. package/modules/localmodels/speech_jobs.py +101 -19
  39. package/modules/localmodels/speech_server.py +2 -0
  40. package/modules/localmodels/speech_worker_sensevoice.py +194 -6
  41. package/modules/localmodels/speech_workers.py +74 -6
  42. package/modules/localmodels/stack.py +13 -1
  43. package/modules/localmodels/stack_auto.py +6 -0
  44. package/modules/localmodels/stack_capacity.py +3 -3
  45. package/modules/localmodels/stack_cli.py +3 -0
  46. package/modules/localmodels/stack_compose.py +7 -3
  47. package/modules/localmodels/stack_ports.py +58 -27
  48. package/modules/localmodels/stack_suite.py +7 -1
  49. package/modules/localmodels/suite.py +1 -1
  50. package/modules/{simplex_localmodels-0.1.0.dev65.dist-info → simplex_localmodels-0.1.0.dev66.dist-info}/METADATA +1 -1
  51. package/modules/{simplex_localmodels-0.1.0.dev65.dist-info → simplex_localmodels-0.1.0.dev66.dist-info}/RECORD +53 -52
  52. package/modules/{simplex_localmodels-0.1.0.dev65.dist-info → simplex_localmodels-0.1.0.dev66.dist-info}/licenses/NOTICE +3 -0
  53. package/package.json +1 -1
  54. package/tool.json +1 -1
  55. /package/modules/{simplex_localmodels-0.1.0.dev65.dist-info → simplex_localmodels-0.1.0.dev66.dist-info}/WHEEL +0 -0
  56. /package/modules/{simplex_localmodels-0.1.0.dev65.dist-info → simplex_localmodels-0.1.0.dev66.dist-info}/entry_points.txt +0 -0
  57. /package/modules/{simplex_localmodels-0.1.0.dev65.dist-info → simplex_localmodels-0.1.0.dev66.dist-info}/licenses/localmodels/HERMES-LICENSE +0 -0
@@ -0,0 +1,539 @@
1
+ """llama.cpp single-model plans (``deploy.build_plan``): the engine build, the server's files,
2
+ argv, environment and plan keys. Where they differ by device the plan asks the placement's
3
+ backend (``backend_for``): an NVIDIA card (CUDA), Apple Metal or the CPU."""
4
+
5
+ from __future__ import annotations
6
+
7
+ from dataclasses import dataclass
8
+
9
+ from localmodels import catalog as cat
10
+ from localmodels import draft_spec, metal, plan_envelope, vision
11
+ from localmodels.context_policy import (
12
+ DEFAULT_UBATCH,
13
+ AgentPosture,
14
+ LaunchPlan,
15
+ WindowDecision,
16
+ agent_launch_args,
17
+ agent_unified_bytes,
18
+ cache_floor_bytes,
19
+ launch_args,
20
+ )
21
+ from localmodels.engines import (
22
+ EngineUnavailableError,
23
+ commit_matches,
24
+ engine_lock_commit,
25
+ engine_lock_path,
26
+ host_engine,
27
+ release_engine,
28
+ select_engine_build,
29
+ )
30
+ from localmodels.estimator import as_loaded, eager
31
+ from localmodels.plan_envelope import PlanError, catalog_pins, hub_url
32
+ from localmodels.planning.budget import Backend, Placement
33
+ from localmodels.probe import GPU, HostFacts, OptionalEngine
34
+ from localmodels.records import ModelSpec, PinnedFile, ReleaseEngine, ReusableFile, SelectedBuild
35
+
36
+ # Apple Metal's llama.cpp: one pinned build for standard GGUFs and looped Inkling 2 Mini alike.
37
+ METAL_DEFAULT_ENGINE = "b12757-mix-ef2df21"
38
+ # llama.cpp's device flags: a Metal placement takes the GPU, ``NO_DEVICE`` hides every device.
39
+ # CPU_ARGS also keep layers, KV and ops off it (an off-card auxiliary component hides it only).
40
+ METAL_DEVICE = ("--device", "MTL0")
41
+ NO_DEVICE = ("--device", "none")
42
+ CPU_ARGS = (
43
+ *NO_DEVICE,
44
+ "--gpu-layers",
45
+ "0",
46
+ "--no-kv-offload",
47
+ "--no-op-offload",
48
+ "--fit",
49
+ "off",
50
+ )
51
+ # Older builds (< b12588) need CUDA graphs disabled on Linux SM 12.0; b12588+ and PrismML
52
+ # prism-b12178+ builds run cleanly with graphs enabled.
53
+ CUDA_GRAPHS_BUILD = 12588
54
+ CUDA_GRAPHS_PRISM_BUILD = 12178
55
+
56
+ Gpus = dict[int, GPU]
57
+
58
+
59
+ class LlamaBackend:
60
+ """Where a llama.cpp plan differs by device. The defaults are an NVIDIA card's."""
61
+
62
+ device_args: tuple[str, ...] = ()
63
+
64
+ def lock_tag(self, tag: str | None) -> str | None:
65
+ """The engine lock a plan pins, given the entry's own (None: the default build)."""
66
+ return tag
67
+
68
+ def check_reused(
69
+ self,
70
+ facts: HostFacts,
71
+ known: OptionalEngine | None,
72
+ argv: list[str],
73
+ required: str,
74
+ lock_commit: str | None,
75
+ ) -> None:
76
+ """Refuse an ``--engine-path`` engine this device cannot confirm."""
77
+
78
+ def check_engine(self, entry: cat.CatalogEntry, engine: ReleaseEngine) -> None:
79
+ """Refuse the planned engine for what the entry loads on this device."""
80
+
81
+ def visible_devices(self, placement: Placement, gpus: Gpus) -> dict[str, str]:
82
+ """The cards the service may see: the placement's, unless it is unified memory."""
83
+ if placement.gpu_indices and not placement.budget.uma:
84
+ return {
85
+ "CUDA_VISIBLE_DEVICES": ",".join(gpus[i]["uuid"] for i in placement.gpu_indices)
86
+ }
87
+ return {}
88
+
89
+ def engine_env(
90
+ self, facts: HostFacts, placement: Placement, gpus: Gpus, engine: ReleaseEngine
91
+ ) -> dict[str, str]:
92
+ """Environment the engine build needs on this device."""
93
+ return {}
94
+
95
+ def placement_gpus(self, facts: HostFacts) -> list[GPU]:
96
+ """Devices the plan lists beside the placement's cards."""
97
+ return []
98
+
99
+ def agent_launch_keys(
100
+ self,
101
+ entry: cat.CatalogEntry,
102
+ variant: cat.QuantVariant,
103
+ decision: WindowDecision,
104
+ agent: AgentPosture,
105
+ ) -> dict[str, object]:
106
+ """Plan ``launch`` keys the agent posture adds on this device."""
107
+ return {}
108
+
109
+
110
+ class CudaBackend(LlamaBackend):
111
+ def engine_env(
112
+ self, facts: HostFacts, placement: Placement, gpus: Gpus, engine: ReleaseEngine
113
+ ) -> dict[str, str]:
114
+ build_num = cat.build_number(engine.get("build"))
115
+ prism_num = cat.prism_build_number(engine.get("build"))
116
+ if (
117
+ facts["platform"] == "linux"
118
+ and (build_num is None or build_num < CUDA_GRAPHS_BUILD)
119
+ and (prism_num is None or prism_num < CUDA_GRAPHS_PRISM_BUILD)
120
+ and any(
121
+ gpus[i]["vendor"] == "nvidia" and gpus[i].get("compute_capability") == "12.0"
122
+ for i in placement.gpu_indices
123
+ )
124
+ ):
125
+ return {"GGML_CUDA_DISABLE_GRAPHS": "1"}
126
+ return {}
127
+
128
+
129
+ class MetalBackend(LlamaBackend):
130
+ device_args = METAL_DEVICE
131
+
132
+ def lock_tag(self, tag: str | None) -> str | None:
133
+ """Release builds older than the Metal default (and no pin) take the Metal default;
134
+ a fork's own lock (not ``b*``) is kept."""
135
+ floor = cat.build_number(METAL_DEFAULT_ENGINE) or 0
136
+ if tag is None or (tag.startswith("b") and (cat.build_number(tag) or 0) < floor):
137
+ return METAL_DEFAULT_ENGINE
138
+ return tag
139
+
140
+ def placement_gpus(self, facts: HostFacts) -> list[GPU]:
141
+ return [g for g in [metal.device(facts)] if g is not None]
142
+
143
+ def agent_launch_keys(
144
+ self,
145
+ entry: cat.CatalogEntry,
146
+ variant: cat.QuantVariant,
147
+ decision: WindowDecision,
148
+ agent: AgentPosture,
149
+ ) -> dict[str, object]:
150
+ """The prompt cache's floor shares unified memory with the model."""
151
+ profile = eager(entry.profile(variant))
152
+ return {
153
+ "unified_bytes": agent_unified_bytes(profile, decision, agent),
154
+ "cache_floor_bytes": cache_floor_bytes(agent, profile),
155
+ }
156
+
157
+
158
+ class CpuBackend(LlamaBackend):
159
+ device_args = CPU_ARGS
160
+
161
+ def check_reused(
162
+ self,
163
+ facts: HostFacts,
164
+ known: OptionalEngine | None,
165
+ argv: list[str],
166
+ required: str,
167
+ lock_commit: str | None,
168
+ ) -> None:
169
+ host_engine(
170
+ {**facts, "engines": [known] if known else []},
171
+ argv,
172
+ required or None,
173
+ False,
174
+ EngineUnavailableError(
175
+ "CPU deployment must confirm every reused-engine launch option; "
176
+ "probe again or use the pinned CPU engine"
177
+ ),
178
+ [],
179
+ commit=lock_commit,
180
+ )
181
+
182
+ def check_engine(self, entry: cat.CatalogEntry, engine: ReleaseEngine) -> None:
183
+ if engine["source"] == "existing" and (entry.mmproj is not None or entry.mtp_capable):
184
+ raise PlanError("CPU: reused engine vision/draft placement unknown; use pinned engine")
185
+
186
+ def visible_devices(self, placement: Placement, gpus: Gpus) -> dict[str, str]:
187
+ return {"CUDA_VISIBLE_DEVICES": ""}
188
+
189
+
190
+ BACKENDS: dict[Backend, LlamaBackend] = {
191
+ "cuda": CudaBackend(),
192
+ "metal": MetalBackend(),
193
+ "cpu": CpuBackend(),
194
+ }
195
+
196
+
197
+ def backend_for(name: Backend) -> LlamaBackend:
198
+ """The hooks of a placement's backend (``Placement.backend``: cuda, metal or cpu)."""
199
+ return BACKENDS[name]
200
+
201
+
202
+ @dataclass(frozen=True)
203
+ class Companions:
204
+ """What a plan loads beside the weights: the picture reader's projector, the agent
205
+ posture's external drafter, or the generic ladder's MTP head."""
206
+
207
+ reader: str
208
+ mmproj: cat.AssetFile | None
209
+ draft: cat.AssetFile | None
210
+ mtp_head: cat.AssetFile | None
211
+
212
+ @property
213
+ def files(self) -> list[cat.AssetFile]:
214
+ return [a for a in (self.mmproj, self.draft, self.mtp_head) if a is not None]
215
+
216
+
217
+ def companions(entry: cat.CatalogEntry, decision: WindowDecision, *, agent: bool) -> Companions:
218
+ """The agent posture reads pictures where the decision put the reader and loads the drafter
219
+ the decision admitted; the generic ladder reads them on the GPU and loads the MTP head."""
220
+ if agent:
221
+ reader = decision.vision_reader
222
+ draft = entry.draft if decision.draft_n_max > 0 else None
223
+ mtp_head = None
224
+ else:
225
+ reader = "gpu" if entry.mmproj else "off"
226
+ draft, mtp_head = None, entry.mtp_head
227
+ return Companions(reader, entry.mmproj if reader != "off" else None, draft, mtp_head)
228
+
229
+
230
+ def assets(
231
+ entry: cat.CatalogEntry, variant: cat.QuantVariant, extra: Companions
232
+ ) -> list[tuple[str, cat.AssetFile]]:
233
+ """The weights and companions to pin, each with the repository it comes from."""
234
+ return [(entry.repo, f) for f in variant.files] + [
235
+ (a.repo or entry.repo, a) for a in extra.files
236
+ ]
237
+
238
+
239
+ def asset_dest(base_dir: str, local_name: str) -> str:
240
+ """Where a plan keeps a companion file (projector, drafter, MTP head) under ``base_dir``."""
241
+ return f"{base_dir.rstrip('/')}/models/assets/{local_name}"
242
+
243
+
244
+ def plan_files(
245
+ pinned: list[PinnedFile], variant: cat.QuantVariant, base: str, download_endpoint: str
246
+ ) -> list[ReusableFile]:
247
+ """The pinned files with their URL and destination: weights (and custom GGUFs) under
248
+ ``models/``, companions under ``models/assets/``."""
249
+ model_names = {f.path for f in variant.files}
250
+
251
+ def dest(f: PinnedFile) -> str:
252
+ if f["path"] in model_names or f["local_name"].startswith("custom/"):
253
+ return f"{base}/models/{f['local_name']}"
254
+ return asset_dest(base, f["local_name"])
255
+
256
+ return [
257
+ {
258
+ "repo": f["repo"],
259
+ "path": f["path"],
260
+ "revision": f["revision"],
261
+ "size_bytes": f["size_bytes"],
262
+ "sha256": f["sha256"],
263
+ "local_name": f["local_name"],
264
+ "dest": dest(f),
265
+ "url": hub_url(download_endpoint, f["repo"], f["revision"], f["path"]),
266
+ }
267
+ for f in pinned
268
+ ]
269
+
270
+
271
+ def drafter_in_place(entry: cat.CatalogEntry, base_dir: str) -> bool:
272
+ """Whether ``entry``'s optional external drafter is under ``base_dir`` with the catalog's
273
+ pinned bytes (its SHA256 receipt). A library load plans the drafter only then: it is an
274
+ accelerator, so a model downloaded before its drafter shipped (Inkling 2 Mini before dev64),
275
+ or one whose drafter fails verification, loads without speculation instead of failing."""
276
+ asset = entry.draft
277
+ if asset is None or asset.sha256 is None:
278
+ return False
279
+ pinned = catalog_pins([(asset.repo or entry.repo, asset)], "")[0]
280
+ planned: ReusableFile = {
281
+ "repo": pinned["repo"],
282
+ "path": pinned["path"],
283
+ "revision": pinned["revision"],
284
+ "size_bytes": pinned["size_bytes"],
285
+ "sha256": pinned["sha256"],
286
+ "local_name": pinned["local_name"],
287
+ "url": "",
288
+ "dest": asset_dest(base_dir, pinned["local_name"]),
289
+ }
290
+ return plan_envelope.verified_in_place(planned)
291
+
292
+
293
+ def server_args(
294
+ entry: cat.CatalogEntry,
295
+ variant: cat.QuantVariant,
296
+ placement: Placement,
297
+ launch: LaunchPlan,
298
+ agent: AgentPosture | None,
299
+ ) -> list[str]:
300
+ """Window, slots, KV and batch flags: the agent posture's, else the generic ladder's."""
301
+ decision = launch.decision
302
+ assert isinstance(decision, WindowDecision)
303
+ if agent is not None:
304
+ return agent_launch_args(decision, agent)
305
+ return launch_args(
306
+ as_loaded(entry.profile(variant), placement.budget),
307
+ decision,
308
+ mtp_capable=entry.mtp_capable,
309
+ mtp_draft_depth=entry.mtp_draft_depth,
310
+ uma=placement.budget.uma,
311
+ mtp_prefill=launch.mtp_prefill,
312
+ ubatch=entry.ubatch,
313
+ )
314
+
315
+
316
+ def trailing_args(
317
+ entry: cat.CatalogEntry,
318
+ variant: cat.QuantVariant,
319
+ files: list[ReusableFile],
320
+ extra: Companions,
321
+ decision: WindowDecision,
322
+ backend: LlamaBackend,
323
+ *,
324
+ agent: bool,
325
+ ) -> list[str]:
326
+ """The argv after the server's own flags: lazy loading (generic ladder only), the
327
+ companions, the catalog's sampling and the device."""
328
+ argv = ["--lazy-mode", "on"] if variant.lazy_bytes and not agent else []
329
+ by_name = {f["path"]: f for f in files}
330
+ if extra.mmproj is not None:
331
+ argv += vision.llama_args(by_name[extra.mmproj.path]["dest"], extra.reader)
332
+ if extra.draft is not None:
333
+ argv += draft_spec.llama_args(
334
+ by_name[extra.draft.path]["dest"], decision.draft_type, decision.draft_n_max
335
+ )
336
+ if extra.mtp_head is not None:
337
+ argv += ["--model-draft", by_name[extra.mtp_head.path]["dest"]]
338
+ for key, value in entry.sampling.items():
339
+ argv += [f"--{key}", value]
340
+ return argv + list(backend.device_args)
341
+
342
+
343
+ def drafter_engine_ok(
344
+ spec: draft_spec.DraftSpec, build: str | None, commit: str | None = None
345
+ ) -> bool:
346
+ """Whether llama.cpp ``build`` accepts the drafter's ``--spec-type``: at least its
347
+ ``min_engine`` release, from the same fork (``b12757-mix-…`` needs a ``mix`` build), or a
348
+ reused engine that is ``min_engine`` itself: probe reads only ``b12757`` and a commit from
349
+ ``--version``, and that commit is the lock's pinned one."""
350
+ if not spec.min_engine:
351
+ return True
352
+ have, need = cat.build_number(build), cat.build_number(spec.min_engine)
353
+ if have is None or need is None or have < need:
354
+ return False
355
+ if commit_matches(engine_lock_commit(spec.min_engine), commit):
356
+ return True
357
+ fork = spec.min_engine.split("-")[1:2]
358
+ return not fork or str(build).split("-")[1:2] == fork
359
+
360
+
361
+ def drafter_refused(
362
+ entry: cat.CatalogEntry, extra: Companions, engine: ReleaseEngine, facts: HostFacts
363
+ ) -> bool:
364
+ """Whether the planned engine cannot run the drafter the plan priced (it was priced
365
+ before the engine was known)."""
366
+ if extra.draft is None or entry.draft_spec is None:
367
+ return False
368
+ commit = next(
369
+ (e.get("commit") for e in facts["engines"] if e["path"] == engine["binary"]), None
370
+ )
371
+ return not drafter_engine_ok(entry.draft_spec, engine.get("build"), commit)
372
+
373
+
374
+ def drafter_warning(entry: cat.CatalogEntry, engine: ReleaseEngine) -> str:
375
+ assert entry.draft_spec is not None
376
+ return (
377
+ f"speculation: the {entry.draft_spec.spec_type} drafter needs llama.cpp "
378
+ f"{entry.draft_spec.min_engine} or newer; engine {engine.get('build') or 'unknown'} "
379
+ "runs without it"
380
+ )
381
+
382
+
383
+ def _reused_engine(
384
+ facts: HostFacts,
385
+ entry: cat.CatalogEntry,
386
+ backend: LlamaBackend,
387
+ path: str,
388
+ pin: tuple[str, str | None],
389
+ warnings: list[str],
390
+ argv: list[str],
391
+ ) -> ReleaseEngine:
392
+ """``--engine-path``: the probed build, or the entry's pin when the commit is the lock's."""
393
+ required, lock_commit = pin
394
+ known = next((e for e in facts["engines"] if e["path"] == path), None)
395
+ tag = known["build"] if known else None
396
+ commit_ok = bool(known and commit_matches(lock_commit, known.get("commit")))
397
+ if not commit_ok and cat.engine_too_old(entry, tag):
398
+ raise PlanError(f"{entry.display_name} needs llama.cpp {required} or newer")
399
+ if commit_ok and (
400
+ not tag
401
+ or (cat.prism_build_number(required) is not None and cat.prism_build_number(tag) is None)
402
+ ):
403
+ tag = required
404
+ if not tag:
405
+ warnings.append("reused engine has no comparable release; model support unconfirmed")
406
+ backend.check_reused(facts, known, argv, required, lock_commit)
407
+ return {"source": "existing", "binary": path, "build": tag}
408
+
409
+
410
+ def _pinned_build(
411
+ facts: HostFacts, entry: cat.CatalogEntry, name: str, backend: LlamaBackend
412
+ ) -> SelectedBuild:
413
+ """The entry's locked build, else the default build when it is new enough, else the
414
+ ``min_engine`` lock; the backend may pin its own lock instead."""
415
+ lock_tag = entry.engine or None
416
+ default: SelectedBuild | None = None
417
+ if lock_tag is None:
418
+ default = select_engine_build(facts, name)
419
+ lock_tag = entry.min_engine if cat.engine_too_old(entry, default["tag"]) else None
420
+ lock_tag = backend.lock_tag(lock_tag)
421
+ if lock_tag is None:
422
+ assert default is not None
423
+ return default
424
+ lock = engine_lock_path(lock_tag)
425
+ if not lock.is_file():
426
+ raise PlanError(
427
+ f"{entry.display_name} needs llama.cpp {lock_tag}; no pinned engine lock is available"
428
+ )
429
+ return select_engine_build(facts, name, lock)
430
+
431
+
432
+ def engine_plan(
433
+ facts: HostFacts,
434
+ entry: cat.CatalogEntry,
435
+ backend: Backend,
436
+ warnings: list[str],
437
+ argv: list[str],
438
+ *,
439
+ base_dir: str,
440
+ engine_path: str | None = None,
441
+ ) -> ReleaseEngine:
442
+ """The llama.cpp engine for ``entry`` on ``backend``: the ``engine_path`` engine when one
443
+ is named, else the pinned release, else a capable engine already on the host."""
444
+ hooks = backend_for(backend)
445
+ required = entry.min_engine or entry.engine
446
+ lock_commit = engine_lock_commit(entry.engine or entry.min_engine) if required else None
447
+ if engine_path:
448
+ pin = (required, lock_commit)
449
+ engine = _reused_engine(facts, entry, hooks, engine_path, pin, warnings, argv)
450
+ else:
451
+ try:
452
+ engine = release_engine(_pinned_build(facts, entry, backend, hooks), base_dir)
453
+ except EngineUnavailableError as exc:
454
+ engine = host_engine(
455
+ facts, argv, required or None, False, exc, warnings, commit=lock_commit
456
+ )
457
+ hooks.check_engine(entry, engine)
458
+ return engine
459
+
460
+
461
+ def service_env(
462
+ facts: HostFacts,
463
+ placement: Placement,
464
+ engine: ReleaseEngine,
465
+ backend: LlamaBackend,
466
+ *,
467
+ reused: bool,
468
+ ) -> dict[str, str]:
469
+ """The service's environment: visible cards, the engine's libraries and the device's
470
+ workarounds; a Mac runs with Metal's service environment instead."""
471
+ gpus = {g["index"]: g for g in facts.get("gpus") or []}
472
+ env = backend.visible_devices(placement, gpus)
473
+ # Windows loads a program's DLLs from its own directory; LD_LIBRARY_PATH means nothing there.
474
+ if facts["platform"] != "win32" and (engine["source"] == "release" or not reused):
475
+ env["LD_LIBRARY_PATH"] = engine.get("dir") or engine["binary"].rsplit("/", 1)[0]
476
+ env |= backend.engine_env(facts, placement, gpus, engine)
477
+ return dict(metal.SERVICE_ENV) if facts["platform"] == "darwin" else env
478
+
479
+
480
+ def model_doc(entry: cat.CatalogEntry, variant: cat.QuantVariant) -> ModelSpec:
481
+ return {
482
+ "id": entry.id,
483
+ "display_name": entry.display_name,
484
+ "repo": entry.repo,
485
+ "quant": variant.quant,
486
+ "model_id": variant.model_id,
487
+ "validated": variant.validated,
488
+ }
489
+
490
+
491
+ def placement_doc(
492
+ facts: HostFacts, placement: Placement, backend: LlamaBackend
493
+ ) -> dict[str, object]:
494
+ gpus = {g["index"]: g for g in facts.get("gpus") or []}
495
+ return {
496
+ "id": placement.id,
497
+ "label": placement.label,
498
+ "pooled": placement.pooled,
499
+ "gpus": [
500
+ {"index": g["index"], "uuid": g["uuid"], "name": g["name"]}
501
+ for g in [gpus[i] for i in placement.gpu_indices if i in gpus]
502
+ + backend.placement_gpus(facts)
503
+ ],
504
+ }
505
+
506
+
507
+ def launch_doc(
508
+ entry: cat.CatalogEntry,
509
+ variant: cat.QuantVariant,
510
+ launch: LaunchPlan,
511
+ extra: Companions,
512
+ backend: LlamaBackend,
513
+ agent: AgentPosture | None,
514
+ ) -> dict[str, object]:
515
+ """The plan's ``launch``. Agent-posture keys appear only in that posture, and vision only
516
+ when on: an older plan rebuilds without them, digest unchanged."""
517
+ decision = launch.decision
518
+ assert isinstance(decision, WindowDecision)
519
+ doc: dict[str, object] = {
520
+ "window": decision.window,
521
+ "spilled": decision.spilled,
522
+ "spill_bytes": decision.spill_bytes,
523
+ "reasons": decision.reasons,
524
+ "mtp_prefill": launch.mtp_prefill,
525
+ }
526
+ if agent is None:
527
+ return doc
528
+ doc |= {
529
+ "slots": decision.slots,
530
+ "kv_types": list(decision.kv_types),
531
+ "mtp_draft_depth": decision.mtp_draft_depth,
532
+ "posture": "agent",
533
+ "vram_bytes": decision.vram_bytes,
534
+ **({"ubatch": decision.ubatch} if decision.ubatch != DEFAULT_UBATCH else {}),
535
+ }
536
+ if extra.mmproj is not None:
537
+ doc |= vision.launch_keys(extra.mmproj, extra.reader)
538
+ doc |= draft_spec.launch_keys(decision)
539
+ return doc | backend.agent_launch_keys(entry, variant, decision, agent)
@@ -3,7 +3,7 @@
3
3
  "tag": "b11583",
4
4
  "commit": "98801578818b26d833a1fe244870d64b0c34bb46",
5
5
  "source": "https://github.com/ggml-org/llama.cpp/releases/tag/b11583",
6
- "note": "Release asset digests from the GitHub release API, read 2026-10-20. b11583 is the first build used here with vllm-d3 support and POST /v1/systemone; decision components run its CPU builds. min_glibc is the highest GLIBC symbol version the build's binaries import (objdump -T, 2026-10-20); builds without it were not checked. The CUDA 12.8 build (read 2026-10-21) runs a decision model on the LLM's card; its cudart archive unpacks beside llama-server (RUNPATH $ORIGIN), and the 12.x runtime needs no driver newer than CUDA 13.0's. The ubuntu22.04 variant (2026-10-23) is this repository's rebuild of the same commit for hosts whose glibc is older than upstream's 2.38: scripts/build_cuda_engine.py runs the release workflow's CMake flags in nvidia/cuda:12.8.2-devel-ubuntu22.04 pinned by digest; its provenance JSON records the image, flags and toolchain, and its archives live in the public generic package registry of simplexai/infra/llm-engine-builds. Every upstream Linux build links GCC's OpenMP runtime (libgomp.so.1, Debian package libgomp1; readelf NEEDED, 2026-10-23), which minimal images lack, so a plan on such a host stops instead of installing it. The ubuntu22.04-r2 rebuild (2026-10-23) carries its own libgomp.so.1 and replaces r1, which needed the system copy. The ubuntu22.04-r3 rebuild (2026-10-26) also compiles the q8_0-q4_0 FlashAttention K-V kernels (GGML_CUDA_FA_QUANTS), which the agent stack's K q8_0 / V q4_0 cache needs to decode at full speed (evidence/2026-10-25-vram-stack-probe-r3-lab12021); it replaces r2. The macOS arm64 build (digest from the release API, read 2026-10-29) is upstream's only macOS arm64 archive and has Metal: the decision model runs it on the Mac's GPU, and the CPU embedding and reranker recipes run the same build with --device none.",
6
+ "note": "Release asset digests from the GitHub release API, read 2026-10-20. b11583 is the first build used here with vllm-d3 support and POST /v1/systemone; decision components run its CPU builds. min_glibc is the highest GLIBC symbol version the build's binaries import (objdump -T, 2026-10-20); builds without it were not checked. The CUDA 12.8 build (read 2026-10-21) runs a decision model on the LLM's card; its cudart archive unpacks beside llama-server (RUNPATH $ORIGIN), and the 12.x runtime needs no driver newer than CUDA 13.0's. The ubuntu22.04 variant (2026-10-23) is this repository's rebuild of the same commit for hosts whose glibc is older than upstream's 2.38: scripts/build_cuda_engine.py runs the release workflow's CMake flags in nvidia/cuda:12.8.2-devel-ubuntu22.04 pinned by digest; its provenance JSON records the image, flags and toolchain, and its archives and provenance live on the project CloudFront CDN under cli/localmodels/engines/llama.cpp/b11583-cu12.8-ubuntu22.04-r3/. Every upstream Linux build links GCC's OpenMP runtime (libgomp.so.1, Debian package libgomp1; readelf NEEDED, 2026-10-23), which minimal images lack, so a plan on such a host stops instead of installing it. The ubuntu22.04-r2 rebuild (2026-10-23) carries its own libgomp.so.1 and replaces r1, which needed the system copy. The ubuntu22.04-r3 rebuild (2026-10-26) also compiles the q8_0-q4_0 FlashAttention K-V kernels (GGML_CUDA_FA_QUANTS), which the agent stack's K q8_0 / V q4_0 cache needs to decode at full speed (evidence/2026-10-25-vram-stack-probe-r3-lab12021); it replaces r2. The macOS arm64 build (digest from the release API, read 2026-10-29) is upstream's only macOS arm64 archive and has Metal: the decision model runs it on the Mac's GPU, and the CPU embedding and reranker recipes run the same build with --device none.",
7
7
  "builds": [
8
8
  {
9
9
  "platform": "linux",
@@ -81,17 +81,21 @@
81
81
  "min_cuda": "12.8",
82
82
  "min_glibc": "2.34",
83
83
  "variant": "ubuntu22.04-r3",
84
- "provenance": "http://192.168.10.117:6001/api/v4/projects/simplexai%2Finfra%2Fllm-engine-builds/packages/generic/llama.cpp-cuda/b11583-cu12.8-ubuntu22.04-r3/llama-b11583-bin-ubuntu22.04-r3-cuda-12.8-x64.provenance.json",
84
+ "provenance": "https://d2ikbbcl3j6jz9.cloudfront.net/cli/localmodels/engines/llama.cpp/b11583-cu12.8-ubuntu22.04-r3/llama-b11583-bin-ubuntu22.04-r3-cuda-12.8-x64.provenance.json",
85
85
  "assets": [
86
86
  {
87
87
  "name": "llama-b11583-bin-ubuntu22.04-r3-cuda-12.8-x64.tar.gz",
88
- "url": "http://192.168.10.117:6001/api/v4/projects/simplexai%2Finfra%2Fllm-engine-builds/packages/generic/llama.cpp-cuda/b11583-cu12.8-ubuntu22.04-r3/llama-b11583-bin-ubuntu22.04-r3-cuda-12.8-x64.tar.gz",
88
+ "url": "https://d2ikbbcl3j6jz9.cloudfront.net/cli/localmodels/engines/llama.cpp/b11583-cu12.8-ubuntu22.04-r3/llama-b11583-bin-ubuntu22.04-r3-cuda-12.8-x64.tar.gz",
89
89
  "sha256": "4769908025bb3d1dfc64fbcde373931542e5baed696a282ddec3b84980e789d3",
90
- "size_bytes": 173682824
90
+ "size_bytes": 173682824,
91
+ "npm_copy": {
92
+ "package": "@simplexai/engine-llama-b11583-bin-ubuntu22.04-r3-cuda-12.8-x64",
93
+ "version": "0.0.0-sha256-4769908025bb3d1d"
94
+ }
91
95
  },
92
96
  {
93
97
  "name": "cudart-llama-b11583-bin-ubuntu22.04-r3-cuda-12.8-x64.tar.gz",
94
- "url": "http://192.168.10.117:6001/api/v4/projects/simplexai%2Finfra%2Fllm-engine-builds/packages/generic/llama.cpp-cuda/b11583-cu12.8-ubuntu22.04-r3/cudart-llama-b11583-bin-ubuntu22.04-r3-cuda-12.8-x64.tar.gz",
98
+ "url": "https://d2ikbbcl3j6jz9.cloudfront.net/cli/localmodels/engines/llama.cpp/b11583-cu12.8-ubuntu22.04-r3/cudart-llama-b11583-bin-ubuntu22.04-r3-cuda-12.8-x64.tar.gz",
95
99
  "sha256": "474f6d382f7e707f94f83f542d6bfcd24c3c04ea1ab12461f34bb7e7305936cd",
96
100
  "size_bytes": 593656098
97
101
  }
@@ -3,8 +3,53 @@
3
3
  "tag": "b12757-mix-ef2df21",
4
4
  "commit": "9b3ec1144de6b33c2f1589e81ae49f51b310a9ba",
5
5
  "source": "https://github.com/unslothai/llama.cpp/releases/tag/b12757-mix-ef2df21",
6
- "note": "Apple Silicon Metal build from unslothai/llama.cpp b12757-mix-ef2df21 (upstream llama.cpp b12757 + Unsloth looped Inkling 2 & DSpark patches, published 2026-11-26, verified byte-for-byte against GitHub release API and llama-prebuilt-sha256.json). Includes late-Nov Metal kernel speedups (+27.3% decode, +22-32% prefill, -711 MiB RSS on Inkling 2 Mini vs b12588-mix-c0c3de8; +61% 1K prefill and +5-7% decode on Spark-X2.6-4B vs b11370) while supporting both standard llama.cpp GGUFs and looped Inkling 2 Mini architectures in one Metal binary. Unpacks with a single top directory llama-b12757-mix-ef2df21/ stripped by remote_ops.unpack.",
6
+ "note": "Release asset digests from the GitHub release API, llama-prebuilt-sha256.json, and llama-prebuilt-manifest.json (unslothai/llama.cpp b12757-mix-ef2df21, upstream llama.cpp b12757 + Unsloth looped Inkling 2 / inkling2_loop & DSpark patches, published 2026-11-26). Supports both standard llama.cpp GGUFs and mainline inkling2_loop / earlier inkling2 architectures (including ISTA-DASLab Inkling-2-Mini-GSQ-RCO-GGUF, which needs llama.cpp >= b12611). Linux x64 CUDA 12 portable (CUDA 12.8, SM 70-120, Ubuntu 22.04) and Linux x64 CPU archives unpack flat with ./llama-server and import up to GLIBC_2.34 plus libgomp.so.1; Linux and Windows CUDA 12 builds pair with the pinned CUDA 12 cudart companion archives from ggml-org/llama.cpp b11370 (matching engines-b12588-mix-c0c3de8.json). Apple Silicon Metal tarball includes late-Nov Metal kernel speedups (+27.3% decode, +22-32% prefill, -711 MiB RSS on Inkling 2 Mini vs b12588-mix-c0c3de8) and unpacks with a single top directory llama-b12757-mix-ef2df21/ stripped by remote_ops.unpack.",
7
7
  "builds": [
8
+ {
9
+ "platform": "linux",
10
+ "arch": "x64",
11
+ "backend": "cuda",
12
+ "min_cuda": "12.8",
13
+ "min_glibc": "2.34",
14
+ "host_libraries": {
15
+ "libgomp.so.1": "libgomp1"
16
+ },
17
+ "assets": [
18
+ {
19
+ "name": "app-b12757-mix-ef2df21-linux-x64-cuda12-portable.tar.gz",
20
+ "url": "https://github.com/unslothai/llama.cpp/releases/download/b12757-mix-ef2df21/app-b12757-mix-ef2df21-linux-x64-cuda12-portable.tar.gz",
21
+ "sha256": "2ab10b2cf84db075c8e68b7aa53241c089752dbb8b20ff58caf7c7d5e27bbb47",
22
+ "size_bytes": 516171497
23
+ },
24
+ {
25
+ "name": "cudart-llama-b11370-bin-ubuntu-cuda-12.8-x64.tar.gz",
26
+ "url": "https://github.com/ggml-org/llama.cpp/releases/download/b11370/cudart-llama-b11370-bin-ubuntu-cuda-12.8-x64.tar.gz",
27
+ "sha256": "7807b4fc01958fc11db9894b2ab791e664b4da999017e70f7b5a7147f6c770e3",
28
+ "size_bytes": 594375807
29
+ }
30
+ ]
31
+ },
32
+ {
33
+ "platform": "linux",
34
+ "arch": "x64",
35
+ "backend": "cpu",
36
+ "min_glibc": "2.34",
37
+ "host_libraries": {
38
+ "libgomp.so.1": "libgomp1"
39
+ },
40
+ "assets": [
41
+ {
42
+ "name": "app-b12757-mix-ef2df21-linux-x64-cpu.tar.gz",
43
+ "url": "https://github.com/unslothai/llama.cpp/releases/download/b12757-mix-ef2df21/app-b12757-mix-ef2df21-linux-x64-cpu.tar.gz",
44
+ "sha256": "eac03cddfa2c9b4736410afdb3ff338c38401009df2cdccccaac949199c873a7",
45
+ "size_bytes": 19437388,
46
+ "npm_copy": {
47
+ "package": "@simplexai/engine-app-b12757-mix-ef2df21-linux-x64-cpu",
48
+ "version": "0.0.0-sha256-eac03cddfa2c9b47"
49
+ }
50
+ }
51
+ ]
52
+ },
8
53
  {
9
54
  "platform": "darwin",
10
55
  "arch": "arm64",
@@ -21,6 +66,45 @@
21
66
  }
22
67
  }
23
68
  ]
69
+ },
70
+ {
71
+ "platform": "win32",
72
+ "arch": "x64",
73
+ "backend": "cuda",
74
+ "min_cuda": "12.8",
75
+ "binary": "llama-server.exe",
76
+ "assets": [
77
+ {
78
+ "name": "app-b12757-mix-ef2df21-windows-x64-cuda12-portable.zip",
79
+ "url": "https://github.com/unslothai/llama.cpp/releases/download/b12757-mix-ef2df21/app-b12757-mix-ef2df21-windows-x64-cuda12-portable.zip",
80
+ "sha256": "87e0b17b806f4779aba800fbed4555ad392afc2d8c88efeff4478aa1267799be",
81
+ "size_bytes": 511491314
82
+ },
83
+ {
84
+ "name": "cudart-llama-bin-win-cuda-12.4-x64.zip",
85
+ "url": "https://github.com/ggml-org/llama.cpp/releases/download/b11370/cudart-llama-bin-win-cuda-12.4-x64.zip",
86
+ "sha256": "8c79a9b226de4b3cacfd1f83d24f962d0773be79f1e7b75c6af4ded7e32ae1d6",
87
+ "size_bytes": 391443627
88
+ }
89
+ ]
90
+ },
91
+ {
92
+ "platform": "win32",
93
+ "arch": "x64",
94
+ "backend": "cpu",
95
+ "binary": "llama-server.exe",
96
+ "assets": [
97
+ {
98
+ "name": "app-b12757-mix-ef2df21-windows-x64-cpu.zip",
99
+ "url": "https://github.com/unslothai/llama.cpp/releases/download/b12757-mix-ef2df21/app-b12757-mix-ef2df21-windows-x64-cpu.zip",
100
+ "sha256": "7a99d62feafadb6d262c2b8f5d09c4c50e06a178e6cca5f85d5e9d45818e666a",
101
+ "size_bytes": 21670230,
102
+ "npm_copy": {
103
+ "package": "@simplexai/engine-app-b12757-mix-ef2df21-windows-x64-cpu",
104
+ "version": "0.0.0-sha256-7a99d62feafadb6d"
105
+ }
106
+ }
107
+ ]
24
108
  }
25
109
  ]
26
110
  }