omnius 1.0.881 → 1.0.883

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.
@@ -246907,12 +246907,16 @@ async function hostFacts(d) {
246907
246907
  {},
246908
246908
  false
246909
246909
  ).catch(() => ({ code: -1, stdout: "", stderr: "" }));
246910
- const discovery = discovered.code === 0 && Buffer.byteLength(discovered.stdout) <= 1024 * 1024 ? json(discovered.stdout) : void 0;
246911
- const installedBytes = await d.readHostFile("/usr/local/share/ollama-unify/gpu-negotiator.json").catch(() => Buffer.alloc(0));
246910
+ const discovery = Buffer.byteLength(discovered.stdout) <= 1024 * 1024 ? json(discovered.stdout) : void 0;
246911
+ let installationAbsent = false;
246912
+ const installedBytes = await d.readHostFile("/usr/local/share/ollama-unify/gpu-negotiator.json").catch((error2) => {
246913
+ installationAbsent = error2.code === "ENOENT";
246914
+ return Buffer.alloc(0);
246915
+ });
246912
246916
  const installed = installedBytes.length <= 1024 * 1024 ? json(installedBytes.toString()) : void 0;
246913
- const brokerDetected = discovered.code === 0 || installed?.protocol === BROKER_PROTOCOL;
246914
- const broker = discovery?.protocol === BROKER_PROTOCOL && discovery.available === true && typeof discovery.control_socket === "string" && discovery.control_socket.startsWith("/");
246915
- const ollamaHost = broker ? loopbackOllama(discovery?.public_ollama_api) ?? (installed?.protocol === BROKER_PROTOCOL ? loopbackOllama(installed.public_ollama_api) : void 0) : !brokerDetected && capableTegra ? "http://127.0.0.1:11434" : void 0;
246917
+ const brokerDetected = discovered.code === 0 || discovery?.protocol === BROKER_PROTOCOL || !installationAbsent;
246918
+ const broker = discovered.code === 0 && discovery?.protocol === BROKER_PROTOCOL && discovery.available === true && typeof discovery.control_socket === "string" && discovery.control_socket.startsWith("/");
246919
+ const ollamaHost = broker ? loopbackOllama(discovery?.public_ollama_api) ?? (installed?.protocol === BROKER_PROTOCOL ? loopbackOllama(installed.public_ollama_api) : void 0) : !brokerDetected ? "http://127.0.0.1:11434" : void 0;
246916
246920
  const warnings = Array.isArray(discovery?.warnings) ? discovery.warnings.slice(0, 12).map((warning) => safeSummary(warning)) : [];
246917
246921
  const activeLeases = Array.isArray(discovery?.active_leases) ? discovery.active_leases : [];
246918
246922
  const summaries = activeLeases.slice(0, 12).map(
@@ -246947,7 +246951,7 @@ async function hostFacts(d) {
246947
246951
  );
246948
246952
  const capable = Number.isFinite(Number(memory)) && Number(memory) >= OMNI_RUNTIME_RESERVATIONS_MIB.ornith15 && Number.isFinite(Number(compute)) && Number(compute) >= 7;
246949
246953
  const eligible = Boolean(
246950
- policyReady && selected && capable && !held && !quarantined && !missing && !transitioning && ollamaHost
246954
+ capable && !held && (!brokerDetected && !tegra || policyReady && selected && !quarantined && !missing && !transitioning) && ollamaHost
246951
246955
  );
246952
246956
  devices.push({
246953
246957
  uuid,
@@ -246955,7 +246959,7 @@ async function hostFacts(d) {
246955
246959
  eligible,
246956
246960
  ...Number.isFinite(Number(memory)) ? { memoryMiB: Number(memory) } : {},
246957
246961
  ...!eligible ? {
246958
- reason: held ? "Operator inference hold is active." : !broker ? "GPU broker discovery is unavailable or invalid." : !policyReady ? "GPU broker health or admission metadata does not permit new work." : !selected || missing ? "GPU is outside the healthy broker-selected scope." : quarantined ? "GPU has quarantined unregistered work." : transitioning ? "GPU has a pending or revoking lease." : !capable ? "Requires compute capability 7.0+ and at least 24,000 MiB VRAM; Qwen requires 45,000 MiB." : "A verified loopback Ollama service endpoint is required."
246962
+ reason: !brokerDetected && tegra ? "Integrated Tegra deployments require the supported SoC admission path." : held ? "Operator inference hold is active." : brokerDetected && !broker ? "GPU broker discovery is unavailable or invalid." : brokerDetected && !policyReady ? "GPU broker health or admission metadata does not permit new work." : brokerDetected && (!selected || missing) ? "GPU is outside the healthy broker-selected scope." : brokerDetected && quarantined ? "GPU has quarantined unregistered work." : brokerDetected && transitioning ? "GPU has a pending or revoking lease." : !capable ? "Requires compute capability 7.0+ and at least 24,000 MiB VRAM; Qwen requires 45,000 MiB." : "A verified loopback Ollama service endpoint is required."
246959
246963
  } : {}
246960
246964
  });
246961
246965
  }
@@ -246991,6 +246995,7 @@ async function inspectOmniHost(input, options = {}) {
246991
246995
  `Derived speech GGUF cache: ${join13(p.runtime, "components")} (additional local disk usage, retained on cancellation).`,
246992
246996
  "GPU reservation: Ornith 24,000 MiB; Qwen 45,000 MiB. Download size is not a VRAM promise; Tegra uses upstream UMA admission.",
246993
246997
  `Verified local Ollama endpoint: ${facts.ollamaHost ?? "unavailable"}`,
246998
+ facts.brokerDetected ? "GPU admission uses the installed broker; invalid discovery, holds and lease transitions block setup." : "No GPU broker installation was found. The upstream direct supervisor requires the chosen accelerator, current capacity and actual owned-runner residency proof; it does not coordinate external GPU workloads.",
246994
246999
  `Private operation diagnostics: ${join13(p.root, "setup-<operationId>.log")} (bounded, owner-only).`,
246995
247000
  ...facts.warnings.map((warning) => `Broker warning: ${warning}`),
246996
247001
  ...facts.summaries
@@ -247008,7 +247013,8 @@ async function inspectOmniHost(input, options = {}) {
247008
247013
  "ffmpeg",
247009
247014
  "ollama",
247010
247015
  "systemctl",
247011
- ...facts.broker ? ["docker", "jq", "curl", "openssl", "setsid", "ss", "nvidia-smi"] : []
247016
+ ...!facts.tegra || facts.broker ? ["nvidia-smi"] : [],
247017
+ ...facts.broker ? ["docker", "jq", "curl", "openssl", "setsid", "ss"] : []
247012
247018
  ]) {
247013
247019
  const found = await command(
247014
247020
  d,
@@ -247032,10 +247038,6 @@ async function inspectOmniHost(input, options = {}) {
247032
247038
  ).catch(() => ({ code: -1, stdout: "", stderr: "" }));
247033
247039
  if (!["running", "degraded"].includes(userBus.stdout.trim()))
247034
247040
  blockedReasons.push("A working systemd user manager is required.");
247035
- if (!facts.brokerDetected && !facts.tegra)
247036
- blockedReasons.push(
247037
- "Discrete CUDA deployment requires the ollama-unify GPU broker; direct or CPU fallback is disabled."
247038
- );
247039
247041
  if (facts.brokerDetected && !facts.broker)
247040
247042
  blockedReasons.push(
247041
247043
  "Installed GPU broker discovery is unavailable or invalid; direct fallback is disabled."
@@ -247243,7 +247245,7 @@ async function proof(d, p, model, gpuUuid, direct, startedAt, signal) {
247243
247245
  const state = json(
247244
247246
  (await optionalFile(join13(p.runtime, "state", "daemon-status.json")))?.toString() ?? ""
247245
247247
  );
247246
- if (state?.schema !== "robit.qwen-omni-daemon.status.v1" || state.state !== "ready" || state.model !== model || state.pid !== status.pid || state.updated_at * 1e3 < startedAt || state.startup_smoke !== false)
247248
+ if (state?.schema !== "robit.qwen-omni-daemon.status.v1" || state.state !== "ready" || state.model !== model || state.pid !== status.pid || !Number.isFinite(state.updated_at) || state.updated_at * 1e3 < startedAt || state.startup_smoke !== false)
247247
247249
  return false;
247248
247250
  const child = Array.isArray(state.children) ? state.children.find((item) => item.name === "comprehension") : void 0;
247249
247251
  if (!child || !Number.isSafeInteger(child.pid) || !pids.includes(child.pid))
@@ -247253,14 +247255,17 @@ async function proof(d, p, model, gpuUuid, direct, startedAt, signal) {
247253
247255
  p.python,
247254
247256
  [
247255
247257
  "-c",
247256
- "import json,sys; from qwen_omni_adapters.accelerator import process_is_gpu_resident,residency_backend; print(json.dumps({'resident':process_is_gpu_resident(int(sys.argv[1])),'backend':residency_backend()}))",
247257
- String(child.pid)
247258
+ "import json,sys; from qwen_omni_adapters.accelerator import process_is_gpu_resident,residency_backend; print(json.dumps({'resident':process_is_gpu_resident(int(sys.argv[1]),sys.argv[2]),'backend':residency_backend()}))",
247259
+ String(child.pid),
247260
+ gpuUuid === "tegra-integrated" ? "" : gpuUuid
247258
247261
  ],
247259
247262
  { signal, timeoutMs: 5e3 },
247260
247263
  false
247261
247264
  );
247262
247265
  const resident = json(result.stdout);
247263
- return resident?.resident === true && resident.backend === "tegra-device-handles";
247266
+ if (result.code !== 0 || resident?.resident !== true) return false;
247267
+ if (gpuUuid === "tegra-integrated") return resident.backend === "tegra-device-handles";
247268
+ return resident.backend === "nvidia-smi-compute-apps" && await discreteResidency(d, p, pids, gpuUuid, signal, child.pid);
247264
247269
  }
247265
247270
  const ready = await command(
247266
247271
  d,
@@ -247297,6 +247302,9 @@ async function proof(d, p, model, gpuUuid, direct, startedAt, signal) {
247297
247302
  (lease) => lease.owner === p.ownerName && lease.state === "active" && Array.isArray(lease.gpu_uuids) && lease.gpu_uuids.length === 1 && lease.gpu_uuids[0] === gpuUuid
247298
247303
  ))
247299
247304
  return false;
247305
+ return discreteResidency(d, p, pids, gpuUuid, signal);
247306
+ }
247307
+ async function discreteResidency(d, p, pids, gpuUuid, signal, requiredPid) {
247300
247308
  const processes = await command(
247301
247309
  d,
247302
247310
  "nvidia-smi",
@@ -247318,7 +247326,7 @@ async function proof(d, p, model, gpuUuid, direct, startedAt, signal) {
247318
247326
  "Owned CUDA work was observed outside the designated accelerator."
247319
247327
  );
247320
247328
  const cmd = (await d.readHostFile(`/proc/${pid}/cmdline`)).toString().split("\0"), env = (await d.readHostFile(`/proc/${pid}/environ`)).toString().split("\0");
247321
- if (cmd[0] === join13(
247329
+ if ((requiredPid === void 0 || requiredPid === pid) && cmd[0] === join13(
247322
247330
  p.checkout,
247323
247331
  "vendor",
247324
247332
  "llama.cpp",
@@ -247330,6 +247338,13 @@ async function proof(d, p, model, gpuUuid, direct, startedAt, signal) {
247330
247338
  }
247331
247339
  return seen;
247332
247340
  }
247341
+ async function admitDirectDiscrete(d, gpuUuid, requiredMiB, signal) {
247342
+ const result = await command(d, "nvidia-smi", ["--query-gpu=uuid,memory.free", "--format=csv,noheader,nounits"], { signal, timeoutMs: 5e3 }, false);
247343
+ const rows = result.stdout.split("\n").map((line) => line.split(",").map((value) => value.trim())).filter((row) => row[0] === gpuUuid);
247344
+ const freeMiB = rows.length === 1 && rows[0].length === 2 ? Number(rows[0][1]) : NaN;
247345
+ if (result.code !== 0 || !Number.isFinite(freeMiB) || freeMiB < requiredMiB)
247346
+ fail("accelerator_not_admitted", "The chosen GPU does not currently report sufficient free VRAM for the selected profile. No service was started; no external workload was stopped.");
247347
+ }
247333
247348
  async function verifySource(d, p, signal) {
247334
247349
  const revision = await command(
247335
247350
  d,
@@ -247571,7 +247586,8 @@ ${diagnostic.stderr.slice(-65536)}` : ""}`,
247571
247586
  "An existing healthy Omni stack must be attached explicitly; it will not be replaced."
247572
247587
  );
247573
247588
  const facts = await hostFacts(d);
247574
- direct = facts.tegra && !facts.brokerDetected;
247589
+ direct = !facts.brokerDetected;
247590
+ const directTegra = direct && facts.tegra;
247575
247591
  if (facts.held)
247576
247592
  return {
247577
247593
  state: "held-paused",
@@ -247586,7 +247602,7 @@ ${diagnostic.stderr.slice(-65536)}` : ""}`,
247586
247602
  "accelerator_required",
247587
247603
  "Choose an exact eligible accelerator from the current plan."
247588
247604
  );
247589
- if (direct && input.gpuUuid !== "tegra-integrated" || !direct && !GPU_UUID.test(input.gpuUuid))
247605
+ if (directTegra && input.gpuUuid !== "tegra-integrated" || !directTegra && !GPU_UUID.test(input.gpuUuid))
247590
247606
  fail(
247591
247607
  "accelerator_required",
247592
247608
  "The selected accelerator does not match this host's deployment mode."
@@ -247594,7 +247610,7 @@ ${diagnostic.stderr.slice(-65536)}` : ""}`,
247594
247610
  const selectedDevice = facts.devices.find(
247595
247611
  (device) => device.uuid === input.gpuUuid
247596
247612
  );
247597
- if (!direct && (selectedDevice.memoryMiB ?? 0) < OMNI_RUNTIME_RESERVATIONS_MIB[input.profile])
247613
+ if (!directTegra && (selectedDevice.memoryMiB ?? 0) < OMNI_RUNTIME_RESERVATIONS_MIB[input.profile])
247598
247614
  fail(
247599
247615
  "insufficient_vram",
247600
247616
  `The selected profile requires at least ${OMNI_RUNTIME_RESERVATIONS_MIB[input.profile].toLocaleString("en-US")} MiB total GPU memory before any build or model download.`
@@ -247747,7 +247763,7 @@ ${diagnostic.stderr.slice(-65536)}` : ""}`,
247747
247763
  OMNI_LANGUAGE_MODEL: profile.model,
247748
247764
  OMNI_PORTAL_RUNTIME_ROOT: p.runtime,
247749
247765
  OMNI_COMPREHENSION_GPU_UUID: input.gpuUuid,
247750
- CUDA_VISIBLE_DEVICES: direct ? "0" : input.gpuUuid,
247766
+ CUDA_VISIBLE_DEVICES: directTegra ? "0" : input.gpuUuid,
247751
247767
  HIP_VISIBLE_DEVICES: "-1",
247752
247768
  ROCR_VISIBLE_DEVICES: "-1",
247753
247769
  OMNI_ENABLE_POINTING: "0",
@@ -247756,7 +247772,7 @@ ${diagnostic.stderr.slice(-65536)}` : ""}`,
247756
247772
  OMNI_STARTUP_SMOKE: "0",
247757
247773
  OMNI_PRINT_ACCESS_URL: "0",
247758
247774
  OMNI_KEEP_CACHE: "1",
247759
- OMNI_COMPREHENSION_CONTEXT_TOKENS: direct && input.profile === "qwen38" ? "16384" : "65536",
247775
+ OMNI_COMPREHENSION_CONTEXT_TOKENS: directTegra && input.profile === "qwen38" ? "16384" : "65536",
247760
247776
  OMNI_COMPREHENSION_VRAM_MIB: String(
247761
247777
  OMNI_RUNTIME_RESERVATIONS_MIB[input.profile]
247762
247778
  ),
@@ -247797,13 +247813,13 @@ ${diagnostic.stderr.slice(-65536)}` : ""}`,
247797
247813
  message: "Runtime source and private configuration are installed; operator pause is preserved and no readiness is claimed."
247798
247814
  };
247799
247815
  if (fresh.broker !== facts.broker || fresh.brokerDetected !== facts.brokerDetected || fresh.ollamaHost !== facts.ollamaHost || !fresh.devices.some(
247800
- (device) => device.uuid === input.gpuUuid && device.eligible && (direct || (device.memoryMiB ?? 0) >= OMNI_RUNTIME_RESERVATIONS_MIB[input.profile])
247816
+ (device) => device.uuid === input.gpuUuid && device.eligible && (directTegra || (device.memoryMiB ?? 0) >= OMNI_RUNTIME_RESERVATIONS_MIB[input.profile])
247801
247817
  ))
247802
247818
  fail(
247803
247819
  "accelerator_policy_changed",
247804
247820
  "Accelerator admission changed before service activation."
247805
247821
  );
247806
- if (direct) {
247822
+ if (directTegra) {
247807
247823
  const admission = await command(
247808
247824
  d,
247809
247825
  p.python,
@@ -247821,7 +247837,7 @@ ${diagnostic.stderr.slice(-65536)}` : ""}`,
247821
247837
  "accelerator_not_admitted",
247822
247838
  "Tegra memory and utilization admission did not pass."
247823
247839
  );
247824
- }
247840
+ } else if (direct) await admitDirectDiscrete(d, input.gpuUuid, OMNI_RUNTIME_RESERVATIONS_MIB[input.profile], options.signal);
247825
247841
  linked = true;
247826
247842
  await command(d, "systemctl", ["--user", "link", p.unitPath], {
247827
247843
  signal: options.signal
@@ -247859,6 +247875,7 @@ ${diagnostic.stderr.slice(-65536)}` : ""}`,
247859
247875
  adapterUrl: "http://127.0.0.1:8910",
247860
247876
  profile: input.profile,
247861
247877
  sourceRevision: OMNI_SETUP_SOURCE.revision,
247878
+ accelerator: { mode: direct ? directTegra ? "direct-tegra" : "direct-discrete" : "broker", gpuUuid: input.gpuUuid },
247862
247879
  verified: {
247863
247880
  adapterContract: true,
247864
247881
  runtime: true,
@@ -300707,8 +300724,14 @@ function stored(root, id2) {
300707
300724
  if (!value) throw error("setup_job_missing", "Omni setup job was not found.", 404);
300708
300725
  if (value.version !== 1 || value.job?.id !== id2 || value.job.schema !== "omnius.omni-setup-job.v1" || !states.has(value.job.state) || !phases.has(value.job.phase) || !ID2.test(value.owner?.token ?? "") || !/^\d+$/.test(value.owner.start) || !Number.isInteger(value.owner.pid) || value.owner.pid <= 0 || !/^[0-9a-f]{64}$/.test(value.configurationRevision) || typeof value.gpuUuid !== "string" || !Number.isFinite(Date.parse(value.job.createdAt)) || !Number.isFinite(Date.parse(value.job.updatedAt)) || value.job.sourceRevision !== OMNI_SETUP_SOURCE.revision || !OMNI_SETUP_PROFILES.some((p) => p.id === value.job.profile && p.model === value.job.model)) throw error("invalid_setup_state", "Omni setup state has an invalid identity.");
300709
300726
  if (value.job.state === "ready" && (!value.job.receipt || value.job.receipt.model !== value.job.model || value.job.receipt.sourceRevision !== OMNI_SETUP_SOURCE.revision || value.job.receipt.action !== "deployed" || !value.job.receipt.verified?.adapterContract || !value.job.receipt.verified.runtime || !value.job.receipt.verified.accelerator)) throw error("invalid_setup_state", "Omni setup state is missing its readiness proof.");
300727
+ if (value.job.receipt?.accelerator && !publicAccelerator(value.job.receipt.accelerator, value.gpuUuid)) throw error("invalid_setup_state", "Omni setup accelerator proof does not match the selected device.");
300710
300728
  return value;
300711
300729
  }
300730
+ function publicAccelerator(value, selected) {
300731
+ if (!value || value.gpuUuid !== selected || !["broker", "direct-discrete", "direct-tegra"].includes(value.mode)) return;
300732
+ if (value.mode === "direct-tegra" ? selected !== "tegra-integrated" : !/^GPU-[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}$/i.test(selected)) return;
300733
+ return { mode: value.mode, gpuUuid: selected };
300734
+ }
300712
300735
  async function runOmniSetupJob(rootPath, id2) {
300713
300736
  const root = resolve11(rootPath), path3 = join14(root, "jobs", id2 + ".json");
300714
300737
  directory(root);
@@ -300787,6 +300810,7 @@ async function runOmniSetupJob(rootPath, id2) {
300787
300810
  throw new DOMException("Setup cancelled before commit", "AbortError");
300788
300811
  }
300789
300812
  if (receipt.model !== value.job.model || receipt.sourceRevision !== OMNI_SETUP_SOURCE.revision || receipt.action !== "deployed" || !receipt.verified.adapterContract || !receipt.verified.runtime || !receipt.verified.accelerator) throw error("setup_readiness_unverified", "Setup did not return complete runtime and accelerator proof.");
300813
+ if (receipt.accelerator && !publicAccelerator(receipt.accelerator, value.gpuUuid)) throw error("setup_readiness_unverified", "Setup accelerator proof does not match the selected device.");
300790
300814
  const previous = readSavedOmniConfiguration(config.path);
300791
300815
  const revision = saveOmniConfiguration({ version: 1, model: receipt.model, adapterUrl: receipt.adapterUrl }, value.configurationRevision, config.path);
300792
300816
  try {
@@ -1093,6 +1093,14 @@ function repairBrokenWrappers() {
1093
1093
  function main() {
1094
1094
  if (!ensureCoreCommandAvailable()) return fatalExit(1);
1095
1095
 
1096
+ // The coordinated worker already owns service handoff and verifies the
1097
+ // replacement package/runtime. Ancillary model/native/companion setup must
1098
+ // not hold this package transaction open or mutate unrelated runtime state.
1099
+ if (process.env.OMNIUS_UPDATE_COORDINATED === "1") {
1100
+ log("Coordinated update owns daemon restart and exact-version verification.");
1101
+ return safeExit(0);
1102
+ }
1103
+
1096
1104
  // Always do the nexus cleanup first, regardless of opt-out.
1097
1105
  progress(1, INSTALL_STEPS, "Cleaning stale Nexus runtime state");
1098
1106
  cleanNexus();
@@ -1113,11 +1121,6 @@ function main() {
1113
1121
  progress(5, INSTALL_STEPS, "Ensuring local REST key");
1114
1122
  ensureBootstrapApiKeyForUser(effectiveUser());
1115
1123
 
1116
- if (process.env.OMNIUS_UPDATE_COORDINATED === "1") {
1117
- log("Coordinated update owns daemon restart and exact-version verification.");
1118
- return safeExit(0);
1119
- }
1120
-
1121
1124
  if (process.env.OMNIUS_SKIP_DAEMON_INSTALL === "1") {
1122
1125
  log("OMNIUS_SKIP_DAEMON_INSTALL=1 — skipping daemon service install.");
1123
1126
  return safeExit(0);