how this works
how it works
licence is required; createRegistry refuses a record without one.
ladderFor(record, env) drops rungs the device cannot run: a webgpu rung without an adapter, an f16 dtype (also inside per sub graph dtypes) without shader-f16, a prompt api rung without LanguageModel.
ortLadder() is the onnxruntime-web walk from the transcription build: webgpu plus wasm at optimization basic, all, disabled, then wasm alone. pair it with store.once(ref) from @hackbuild/weights so every attempt reads one download.
packages
@hackbuild/modelsinstall
sh
npm install @hackbuild/modelscode
ts
import { createHub, createRegistry, CATALOG } from "@hackbuild/models";
const hub = createHub({ registry: createRegistry(CATALOG), env: await probe(), budgetMB: 4000 });
hub.provide("tjs", async ({ record, rung }) => pipeline(task, record.source.modelId, { device: rung.device, dtype: rung.dtype }));
const depth = await hub.use("depth"); // routed, ladder walked, cached
const map = await hub.run(depth, (pipe) => pipe(image)); // webgpu models take the gpu lock
hub.release(depth);