Capicú Edge ML Inference¶
CEMI is a local-first experiment workspace for Edge AI and TinyML practitioners who need more than a dashboard — they need verifiable deployment evidence.
Benchmarking is not verification¶
Running a model and recording metrics is benchmarking. Asserting that those metrics satisfy deployment criteria is verification. These are distinct operations, and confusing them is how models that "look good in the dashboard" end up failing on-device.
CEMI operationalizes this distinction. Every run produces a run_record — a structured snapshot of what happened. A contract.json specifies machine-checkable gates (accuracy thresholds, latency budgets, memory limits). cemi verify evaluates the run against the contract and exits with a pass or fail that CI can act on.
Without a contract result, a run is evidence. With one, it is a deployment decision.
Four components, one local workflow¶
Your script ──► Writer ──► .cemi/runs/<run_id>.jsonl
│
cemi gateway ──► http://127.0.0.1:3141/workspace
│
cemi verify ──► pass / fail (exit 0 / 1)
- Writer (
cemi.writer) - The Python integration surface. Your training or benchmarking code calls
log_metric,log_parameter,add_local_file_artifact, andemit_run_record. Eachemit_run_record()call appends a complete snapshot to disk. - Local gateway (
cemi gateway) - A lightweight HTTP server that reads
run_recordsnapshots from disk and serves the embedded workspace UI. No cloud account required. No data leaves the machine. - Workspace UI
- A React/TypeScript single-page app embedded in the gateway. Three views: Runs (table of all runs in a project), Compare (side-by-side metric and artifact diff), and Console (live action event log).
- CLI (
cemi) - Command-line entrypoint for starting the gateway, opening the workspace, wrapping training commands, and running contract verification.
Quick start¶
Install from PyPI:
Instrument your script:
from cemi.writer import create_writer
writer = create_writer(project="demo", log_dir=".cemi")
with writer.run(name="mobilenet-baseline", tags={"model": "mobilenetv2"}):
writer.log_parameter(key="quantization", value="ptq-int8")
writer.log_metric(name="latency_p99_ms", value=18.4, unit="ms", role="performance", direction="lower_is_better")
writer.log_metric(name="accuracy_top1", value=0.934, role="quality", direction="higher_is_better")
writer.log_summary_metrics({"final_accuracy": 0.934, "model_size_mb": 4.2})
writer.emit_run_record()
Open the workspace:
Verify against a contract:
What to read next¶
- Getting Started — install paths, environment variables, save directory layout, and the canonical local workflow
- CLI — all commands with flags and examples, including
cemi verify - Writer API — the full Python integration surface: metrics, parameters, context namespaces, artifacts, and benchmark helpers
- Gateway and Contract — gateway endpoints, the
run_recordevent schema, and how to write and evaluate contracts