Logo Lanfrica

lankylo/local-first-inference-arbiter

Domaine:

digital infrastructure

Type de record:

software
Créateur:
lan
Hôte:
Original public release of Local-First Inference Arbiter by Lorenzo le Ray, Johannesburg, South Africa. Provenance date: 29 July 2026. Project UUID: c2c09b18-964c-4cbc-af36-10fe664afb33. The attached source archive was generated and cryptographically attested through GitHub Actions. Its SHA-256 fingerprint is recorded in SHA256SUMS.txt. # Local-First Inference Arbiter Local-First Inference Arbiter is a code-level reference package for deciding whether a device request needs AI at all. It treats a language model as one execution resource—not as the default operating system. A request is offered to the least expensive sufficient route first: ```text deterministic capability → conventional on-device classifier → small on-device language model → cloud language model ``` The package has no user interface, runtime dependencies, telemetry, network client, or bundled model. Platform adapters supply real device capabilities and optional model-backed strategies. ## Core guarantee The arbiter can enforce: > Zero cloud-LLM inference and zero off-device disclosure for locally > satisfiable requests. “Zero tokens” is intentionally not claimed. Local speech recognition or a local model may tokenize internally. The measurable boundary is cloud inference and off-device disclosure. ## What the reference implements - A strict route order from deterministic code to cloud LLM. - Per-route confidence thresholds. - Local-only requests and network policy. - A cloud-token ceiling. - Data classes that may not leave the device. - Confirmation gates for external, financial, and physical-world effects. - Auditable decision traces. - Hash-chained decision receipts that omit raw requests and raw arguments. - Repository provenance and a GitHub artifact-attestation workflow. ## Run it Node.js 20.11 or newer is required. There are no dependencies to install. ```bash npm test npm run example npm run provenance:verify ``` Or run every check: ```bash npm run verify ``` ## Minimal use ```js import { createInferenceArbiter, createRegexStrategy } from "local-first-inference-arbiter"; const timerGrammar = createRegexStrategy({ id: "local.timer.grammar", rules: [{ capabilityId: "device.timer.set", pattern: /^set a timer for (? \d+) minutes?$/i, extract: (match) => ({ durationSeconds: Number(match.groups.minutes) * 60 }) } …