forgo.cloud
Sign in
Repo workspace

forkjoin-ai/gnosis

distributed-inference-host src

distributed-inference-host/src/README.md
forkjoin-ai/gnosis

distributed-inference-host src

Parent: distributed-inference-host

This directory contains the runtime-neutral TypeScript host layer around the open-source/gnosis/distributed-inference WASM/native engine.

Getting Started

  • What: implementation notes for the src source subtree.
  • Why: it helps you find the owner module before editing code or importing a public surface.
  • How: read this file as the local module map, then open the named source file and its matching tests.
  • Next: return to the parent README when you need commands or package-level context.

Contents

  • index.ts: package export surface.
  • host-shim.ts: knot byte-source orchestration, metadata parsing, tensor prefetch, and WASM pipeline setup.
  • pipeline.ts: station-orchestrated prefill and generation over HTTP, UDS, or flow transports, including terminal prosody observe/bias modes and (DEFAULT OFF, MESH_SPEC_DECODE=1) the greedy n-gram speculative-decode loop (generateFromPrefillSpeculative) that drives the fat-station /verify-batch route for lossless multi-token-per-forward decoding.
  • ngram-draft.ts: pure prompt-lookup / n-gram speculative-decode DRAFT (Saxena 2023) — proposes the up-to-K tokens following the longest recurring suffix of the running sequence; no model, no training. Drives the lossless verify loop in pipeline.ts.
  • prefill-window.ts: explicit speculative prefill window management, exact-prefix attach, KV session restore, and Moonshine prefill telemetry headers.
  • terminal-prosody-mode.ts: OpenAI shim environment parsing for default-on terminal prosody with explicit disable switches.
  • tts-audio.ts: local /v1/audio/speech synthesis, WAV/PCM encoding, audio mode resolution, and container playback/file output helpers.
  • phonemizer.ts: rule-based text-to-phoneme IDs used by the local TTS fallback and Pneuma TTS surfaces.
  • agentic-chat.ts: OpenAI-compatible multi-step chat orchestration with superserver MCP preflight, tool execution, and C0-C4 metacognitive gates.
  • unlimited-ocr-qspec.ts: public qspec constants and request/output validation for sahilchachra/Unlimited-OCR-GGUF.
  • unlimited-ocr-runner.ts: Node-side PDF/image OCR runner for qspec smoke tests and local consumers; renders PDFs with pdftoppm, invokes llama-mtmd-cli, and supports injected command runners for tests.
  • thoth-prompt-feedback.ts: typed native /prompt-feedback request/response contract requiring the failure-scribe admissibility theorem and rejection-residue preservation theorem on every admission-rejection report.
  • thoth-npc-halogram.ts: shared-ui Halogram/metacognition summary adapter for Thoth NPC, halogram, and hologram prompt context, including voice and body presentation parameters.
  • thoth-oath-tools.ts: local Thoth oath self-management MCP tools with GnosisTime timers, aperiodic schedules, persistence hooks, source/sourceId provenance, and non-authoritative telemetry events. Oaths carry bindingStrength; mast-bound records model Odysseus-on-the-mast commitments that the tempted runtime can audit but cannot clear.
  • thoth-oath-ledger-file-store.ts: optional JSON-file-backed oath ledger store used by THOTH_OATH_LEDGER_PATH in the OpenAI-compatible server.
  • thoth-oath-client.ts: typed HTTP client for /v1/thoth/oaths list/create/update/delete calls so UI/runtime callers do not hand-roll oath control-plane request shapes.
  • bin/openai-server.ts: OpenAI-compatible HTTP server; when THOTH_OATH_LEDGER_PATH is set it exposes /v1/thoth/oaths for operator-owned oath CRUD outside the model chat loop. The runtime route rejects clearing or deleting mast-bound oaths.
  • openai-agentic-mode.ts: request/header/body/env parsing for the Moonshine OpenAI server's bare-by-default agentic opt-in contract.
  • openai-server-mesh.ts: explicit mesh topology parsing/building for the OpenAI-compatible host, keeping the gateway as route/telemetry while the fat-client coordinator owns station scheduling.
  • carrier-medium.ts: domain-agnostic carrier cells, observer projection, fiber loss, and evolution/resolution readings.
  • spectral-noise-monitor.ts: spectral governance, Bule pressure, attention closure lift decisions, and closure-gated work policy telemetry for distributed-inference mesh assessments, including theorem-lineage anchors for the optimizer-admission gate.
  • mesh-carrier-assessment.ts: stable mesh_carrier_assessment/v1 certificate wire plus the producer-side Noise/Signal projection shared with mesh-verifier's carrier alert contract; hosts inspect pressure locally while mesh-verifier persists warnings.
  • image-carrier-pipeline.ts: image patch adapter over the generic carrier medium for future deblur-oriented stations.
  • deblur-public.ts: curated deblur/audio/video FRF public API re-export surface.
  • style-public.ts: style-transfer public API including classical transfer, AdaIN adapter surface, and style FRF ensemble fold.
  • station.ts, station-uds.ts, station-flow.ts, station-flow-udp.ts, station-ws.ts: station transports. station-ws.ts is the Death #3 persistent-WebSocket substrate (wave-18 measured 75% per-hop save vs HTTPS); see docs/wsstation-dispatcher-wiring.md for the staged-rollout flag.
  • types.ts: shared public host and station contracts.