Skip to content

feat(compute): MVP-B CPU inference worker (draft — blocked on the frozen output budget) - #153

Draft
gkalombo21 wants to merge 1 commit into
devfrom
feat/mvp-b-cpu-inference-worker
Draft

gkalombo21 wants to merge 1 commit into
devfrom
feat/mvp-b-cpu-inference-worker

Conversation

@gkalombo21

Copy link
Copy Markdown
Collaborator

MVP-B — Real CPU Inference Worker (DRAFT: blocked on the frozen output budget)

Tracks #152 (child of #148). Baseline 20d46774bdb1890b3f510e0ed8e31552dd41c96a. Not for merge until kaayu-cv-extract v2 resolves the output-budget defect described below and the real corpus reaches 10/10.

What it adds

  • crates/mbongo-compute/src/cpu_inference/: pinned runtime configuration (llama.cpp build b11669 = release v0.7.0 @ 620d2225, Windows and Linux CPU archives and llama-server SHA-256), start-up verification (frozen profile digests; executable SHA-256; --version build and commit; model size and SHA-256; /props build and model), a bounded loopback HTTP/1.1 client, the long-lived llama-server manager (structured args, --n-gpu-layers 0, --parallel 1, --no-slots, --no-webui, --no-cache-prompt, restart of a dead or hung server), the backend trait with a scripted test double, InferenceProfile (MVP-A preflight → frozen two-message prompt → one completion with job-spec parameters and the pinned schema as response_format → MVP-A finish) and ProfileDispatch (no fallback).
  • ExecutionProfile gains three default methods (spec_tags, accepts, execute_task) whose defaults are the reference behaviour; worker.rs changes only its three call sites.
  • scripts/setup-mvp-inference-runtime.sh: acquire and verify both artifacts outside the repository; quarantine and exit non-zero on mismatch.
  • mvp_inference_harness corpus|e2e: real runs (never CI). test-vectors/inference/synthetic-cv-corpus-v1.json: 10 invented CVs + 3 must-refuse inputs.
  • CI group cpu_inference_worker (31 tests) as step Mbongo MVP CPU Inference Worker; INDEX row; docs/product/MVP_CPU_INFERENCE_WORKER.md.

Real evidence (i7-8850H, 6 threads, CPU only): runtime and model verified exactly (model SHA-256 3605803b…e597, 2,497,281,120 B). Corpus 8/10 schema-valid; warm P50 48.6 s / P95 55.4 s; cold start 3.5–3.8 s; peak working set 6.3 GB; 3/3 invalid inputs refused before the model; in-flight kill → INFERENCE_FAILED → restart → success. Live chain end to end PASS (task accepted, killed first attempt, retry, receipt anchored and verified, commitment matched, chain and log scans clean).

The blocker: R08 and R10 hit max_tokens = 400 (finish_reason: "length") and were refused as OUTPUT_NOT_JSON; with room they complete (463 and 1,331 tokens). The frozen schema allows ~2,000 tokens of JSON. Fixing it changes the frozen profile — a decision for change control, options in #152 and the doc §16.4.

Unchanged: 76 protected blobs (RFC 0005, RFC 0002, RECEIPT_SPEC, lock v0.4, rpc_v0.3, consensus, SDK, conformance, J, K, SNP adapter, protocol vectors, MVP_v0.1.md, the MVP-A contract, module, profile files, vectors and test group) identical to the baseline.

Refs #152, #148

🤖 Generated with Claude Code

…d on the frozen output budget)

Adds the real CPU inference worker for the frozen kaayu-cv-extract:v1
profile: a long-lived llama-server (llama.cpp build b11669 = release v0.7.0
@ 620d2225, CPU-only, loopback, GPU layers 0) verified at start-up by the
pinned executable SHA-256, its self-reported build and commit, /props, and
the model file's size and SHA-256 (3605803b...e597); the frozen profile's
prompt, schema and job-spec digests are checked before readiness.

ExecutionProfile gains three default methods (spec_tags, accepts,
execute_task) that reproduce the reference behaviour; the worker calls
them. ProfileDispatch runs [reverse-bytes, mbongo-infer:v1] with no
fallback. Every task goes through the MVP-A preflight and finish; the
request carries only job-spec parameters and the pinned schema as a
response_format grammar. A bounded loopback HTTP client, restart of a dead
or hung server, safe observations (no CV, prompt or result in any log).

scripts/setup-mvp-inference-runtime.sh acquires and verifies both artifacts
outside the repository and quarantines on mismatch. mvp_inference_harness
runs the real corpus and a live-chain end to end. CI group
cpu_inference_worker (31 tests, scripted backend, fake HTTP server).

Real results on an i7-8850H: 8/10 synthetic CVs schema-valid; the other two
stopped at the contract's max_tokens = 400 (finish_reason "length") and
were refused, as specified. The frozen output schema permits ~2,000 tokens
of JSON; resolving that needs kaayu-cv-extract v2 under MVP_v0.1 §20.
Live-chain end to end PASS with an in-flight server kill and recovery.

No ComputeTask, Receipt, RPC, SDK or MVP-A change.

Refs #148

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants