HOW IT WORKS / PLAN, MEASURE, SEAL, GATE
How a deployment gets planned, measured, sealed and gated.
This is the long version of the three acts on the home page: the arithmetic the planner does before a download, the protocol the runner follows, the fields a Passport carries and what the verifier recomputes from them, and the vocabulary a policy uses to turn one record into a verdict the pipeline obeys. Every number below carries its class in the same sentence, and every command is written as it runs.
Open core from LockedIn Labs. The toolchain is pre-release: the commands run from a source checkout of the toolchain with repository access, and the moemodels package is not yet published to npm.
The argument nobody can settle.
Most published self-hosted figures ship without a pinned revision, a repetition count or a file to recompute.
On 24 October 2026 a user opened an issue against FreeToken (arXiv 2608.16157, 2026), a runtime that keeps a mixture-of-experts model’s expert weights in system RAM and feeds them across the bus to a consumer GPU: “Performance regression from v0.1.3 to v0.2.0 on RTX4060 8GB” (issue #822, retrieved 2 November 2026). By the reporter’s account the same startup parameters and the same model were much slower on the new release, and in a follow-up comment the reporter put long generation at 10 to 12 tokens a second. FreeToken’s own paper puts a different model, Qwen3.6-35B-A3B at NVFP4, at 39.3 tokens a second on an 8 GB RTX 4060 Laptop (section 5.3, “Cross-hardware serving”, retrieved 2 November 2026). Those are their claims, as ours are ours, and we have not reproduced them. On 2 November the issue was still open, every number in it was sincere, and none of them was a file the next reader could download and recompute.
A paper says one figure for one model; an issue thread says another for a different model and release. Neither travels. Meanwhile the EU AI Act requires high-risk AI systems to allow the automatic recording of events over their lifetime (Regulation (EU) 2024/1689, Article 12(1)) and obliges their deployers to keep those logs for at least six months (Article 26(6)), without prescribing a format for the deployment record itself.
The position this toolchain takes is narrow: a deployment record you can re-verify beats a number you have to believe, not because the number is wrong but because belief does not scale past the person who produced it. The four steps below are how such a record gets made and used.
01 · Plan · before the download
Whether it fits, where the experts live, and the ceiling on decode.
The planner takes a pinned checkpoint, a hardware record and a runtime name and does arithmetic on sourced numbers. It never predicts performance. Here is the worked example for Qwen3-30B-A3B in BF16 on an Apple M3 Ultra 512GB unified memory under mlx-lm, one of the first-party Passports on the evidence page.
npm run moemodels -- plan qwen3-30b-a3b m3-ultra-512gb --runtime mlx-lmInputs the planner reads
| Field | Value | Class | Source |
|---|---|---|---|
| Checkpoint tensor bytes | 61,064,245,248 bytes | sourced | safetensors manifest at the pinned revision, metadata.total_size |
| Total parameters | 30,500,000,000 | sourced | Qwen3-30B-A3B model card, model architecture |
| Active parameters per token | 3,300,000,000 | sourced | Qwen3-30B-A3B model card, model architecture |
| Unified memory | 512 GB | sourced | Apple newsroom, M3 Ultra announcement |
| Memory bandwidth | 819 GB/s | sourced | Apple Mac Studio (2025) technical specifications |
| Reserve held back | 13.00 % | declared | the planner's default for runtime, KV cache and operating system |
What it derives
| Field | Value | Class | Formula |
|---|---|---|---|
| Bytes per parameter | 2.0021 | calculated | tensor bytes ÷ total parameters |
| Bytes read per token | 6,606,951,125 bytes | calculated | active parameters × tensor bytes ÷ total parameters, integer division |
| Usable memory after reserve | 445,440,000,000 bytes | calculated | 512 GB × (1 − 13%) |
| Static residency | fits device | calculated | usable memory ≥ tensor bytes; a lower bound on memory, not the runtime's peak |
| Single-stream decode ceiling | about 123.9 tokens/s | calculated | memory bandwidth ÷ bytes read per token |
| Runtime compatibility | unknown | unknown | no exact evidence record says mlx-lm loads this revision; the Passport below records that it did, the plan does not |
Two numbers are doing the work here, and they are different kinds of number. The residency floor asks whether the checkpoint’s tensor bytes fit in memory after a reserve for the runtime, the cache of past tokens and the operating system. On 512 GB it does, and the static residency gate is a calculated pass: a lower bound on memory, not the runtime’s real peak. The bandwidth ceiling divides the memory bandwidth Apple publishes by the bytes one token has to read: about 6,606,951,125 bytes at BF16, so no single stream decoding one token per forward pass can run faster than about 123.9 tokens a second if the only cost of a token were moving its weights.
A ceiling is arithmetic, not a prediction. For a single stream, one token per forward pass and no speculative decoding, it is the number above which a measurement would mean something is wrong, and below which the gap is a question for the profiler. Batching and speculative decoding produce more tokens per weight read and sit outside this bound.
It is not the only cost, which is why the planner prints “measured values will be lower” and means it. The Passport for this exact configuration recorded 30.1 · 25.9 · 31.1 output tokens a second across its three trials measured, roughly a quarter of the ceiling calculated (mean 29.0 ÷ 123.9 = 0.23). A token also reads the cache of everything before it, runs the router and attention, launches many small kernels and is streamed over HTTP by an untuned server. Where the other three quarters go is a profiling job, and the plan does not guess at it.
The same arithmetic for another first-party Passport, gemma-4-26b-a4b-it in 8-bit (MLX) on the same hardware class: 4,215,197,857 bytes read per token gives a ceiling of about 194.2 tokens a second calculated, against 51.5 · 53.7 · 46.7 measured across its three trials measured. A different model, a different gap, the same two kinds of number.
The planner prints the arithmetic it did, so the reader can check it. This is what it printed for this configuration:
Residency model (calculated, mlx-lm)
Expert placement: unified; memory architecture: unified
Placement: fits device — The whole checkpoint (61,064,245,248 bytes) is resident
in unified memory after a 13.00% reserve; experts never cross a host interface.
Speed band: Decode cannot exceed about 123.9 tokens/s for a single stream on
Apple M3 Ultra 512GB unified memory: bytes read per token over vendor-published
memory bandwidth. Measured values will be lower.
bytesPerParameter = artifactTensorBytes / totalParameters
= 61064245248 / 30500000000 = 2.0021
bytesReadPerToken = activeParameters × artifactTensorBytes / totalParameters
= 3300000000 × 61064245248 / 30500000000 = 6606951125 (integer division)
deviceBound = memoryBandwidth / bytesReadPerToken
= 819 GB/s × 1e9 / 6606951125 = 123.9 tokens/sOn a discrete card with the experts in host memory the same planner refuses to borrow a bus bandwidth it does not have: static residency stays unknown, the host-interface bound is not calculated, and the reason is printed. An unknown in this output is not a failure to answer. It is the planner naming the fact that is missing and the source it would come from, and an unknown never becomes a pass downstream.
Static residency is the second of seven validation gates the plan lists. The other six are marked required, because a checkpoint that fits is not a deployment that works. The next three steps are how the fifth gate, replaying the target workload, gets answered with a record instead of a claim.
02 · Measure · after the run
Three trials against an endpoint you control.
The runner sends a bounded workload to an OpenAI-compatible streaming endpoint and retains every request measurement. This is the protocol every first-party Passport was produced under. Each endpoint was mlx-lm 0.32.2 bound to localhost; the Passport retains the endpoint origin and the runtime version, not the server launch command, so “untuned” is the operator’s declaration, not a measured fact.
| Parameter | Value | Note |
|---|---|---|
| Timed requests per trial | 12 | every request retained, successful or not |
| Concurrency | 1 | a single stream; the ceiling above is also single-stream |
| Maximum output tokens | 256 | the same limit for every request |
| Temperature | 0 | fixed by the runner |
| Warm-up requests | 2 | sent first, excluded from every summary |
| Trials | 3 | identical configuration each time; three is the minimum the Passport format accepts |
| Prompt | 1 | one prompt; its SHA-256 and UTF-8 byte count are in the file, its text is not |
| Never stored | prompt text · response text · API key | the privacy gate fails a Passport that declares otherwise |
For each request the runner records the time to first content-bearing token, the total latency, success or the failure class, and the token usage the endpoint returned. From those it summarises each trial: TTFT and latency at p50, p95 and p99 with mean, minimum and maximum, request throughput, and output-token throughput when usage was returned. A missing first token or missing usage is recorded as a gap, never filled in. Run the command three times with an identical configuration, changing only the output file name.
MOEMODELS_BENCH_API_KEY=... npm run moemodels -- run \
--endpoint http://127.0.0.1:18951/v1/chat/completions \
--model Qwen/Qwen3-30B-A3B \
--artifact-repository Qwen/Qwen3-30B-A3B \
--artifact-revision ad44e777bcd18fa416d9da3bd8f70d33ebb85d39 \
--runtime mlx-lm --runtime-version 0.32.2 \
--hardware "Apple M3 Ultra, 512 GB unified memory (Mac Studio 2025)" \
--topology "<declared topology>" \
--requests 12 --concurrency 1 --max-output-tokens 256 --warmup-requests 2 \
--output trial-01.json03 · Seal · before anyone else reads it
The anatomy of a Passport.
Packing takes compatible trials and produces one file whose name is its content address. Signing binds a key to those exact bytes. The Passports on the evidence page are this format, version 0.2.0.
npm run moemodels -- pack trial-01.json trial-02.json trial-03.json --output passport.json
npm run moemodels -- sign passport.json --private-key operator-ed25519.pem --output signed-passport.json- Configuration digest
payload.configurationSha256 - SHA-256 over the declared configuration: endpoint origin, served model name, artifact repository and revision, runtime name and version, hardware, topology and the workload shape. Two Passports with the same configuration digest measured the same thing; two with different digests are not compared.
- Payload digest
payloadSha256 - SHA-256 over the RFC 8785 canonical bytes of the whole payload: every trial, every retained request measurement, the producer and the reproducibility claims. The verifier recomputes it from the file. Change one latency value and it no longer matches.
- Passport ID
passportId - The payload digest with a typed prefix, deploybench-passport-sha256-… , so a record can be cited by name anywhere and the name is the content address.
- Signature
signatures[0] - An Ed25519 signature over the payload digest, with the public key and a key ID in the file. Its kind is operator_authorship: it proves that whoever holds the key signed these exact bytes, and nothing about what the endpoint served.
What the signature fields mean
valid_self_signed- The signature verifies against the public key carried in the file. Authorship of the bytes is established; the signer's identity is whatever the key says it is.
authorshipOnly: true- The signature makes no claim about the declared model, runtime, hardware or topology. Those fields are bound into the digest, not proven by it.
trusted: false- The verifier has no trust policy for this key. A record from our own key reports trusted: false, which is the point: nobody has to trust our number, including us.
comparisonEligible: false- Verification is not admission. Comparing records is a separate review of the methodology and evidence context, and no first-party Passport has been through it.
04 · Verify · offline, from the file
What the verifier recomputes.
moemodels verify reads the file and nothing else. It recomputes every digest and every summary from the retained measurements, re-runs the reproducibility gates and checks the signature. Change one byte and it fails, naming the field. The same verifier runs in the browser verifier today; the CLI ships with the public release.
# from a source checkout of the toolchain
npm run moemodels -- verify signed-passport.json --jsonIntegrity checks
schemaValidThe file parses as a Passport of a known schema version with no unknown fields.
payloadDigestValidThe payload digest recomputes from the canonical bytes.
passportIdValidThe Passport ID is the payload digest under its typed prefix.
configurationDigestValidThe configuration digest recomputes from the declared configuration.
summariesValidEvery trial summary recomputes from its retained request measurements: TTFT and latency quantiles, success counts, throughput.
signaturesEach embedded signature verifies against its public key and is reported as valid_self_signed, with trusted: false unless a trust policy says otherwise.
Reproducibility gates
compatible_trialsAll trials share the same endpoint, model, artifact, runtime, infrastructure, and workload configuration.
minimum_trials3 observed; 3 required for the v0.2 reproducibility gate.
immutable_artifact_revisionArtifact revision ad44e777bcd18fa416d9da3bd8f70d33ebb85d39 is declared with an immutable-length digest.
runtime_identityRuntime name and exact version are declared.
infrastructure_identityHardware and topology are declared.
request_measurementsEach requested measurement is retained; successful requests include TTFT and returned token usage; no material context gap is declared.
privacy_boundaryPrompt text, response text, and API keys are declared absent.
The gates are read above from the committed verification report of the Qwen3-30B-A3B Passport recomputed. They are also what rejected our own first attempt at that Passport. The signature was fine and the payload digest was fine, but request_measurements failed with the detail “One or more successful streams did not expose a content-bearing first token”: the runner had timed the first token against a stream whose opening chunk carried no content. We fixed the runner, re-ran all three trials, and published the rejected file beside the accepted one under Recorded rejection on the evidence page. A format that cannot say no to its author is a press release with a checksum.
05 · Gate · before the change ships
The policy vocabulary.
A deployment policy is strict JSON with its own content address. It declares what evidence is required, which thresholds hold, how much a candidate may regress against a baseline, which identity fields may change between them, and which rules are waived until when. Evaluation returns exactly one of three verdicts and a receipt.
npm run moemodels -- policy init --output policy.json
npm run moemodels -- policy check signed-passport.json --policy policy.json --baseline baseline-passport.json --json
npm run moemodels -- compare baseline-passport.json signed-passport.json --allow runtime.version| Verdict | Exit code | Meaning |
|---|---|---|
pass | 0 | Every required evidence check and every rule succeeded with complete evidence. |
fail | 1 | A required evidence check or a rule failed. |
inconclusive | 3 | A metric, a baseline or a comparable configuration was unavailable, so no honest pass or fail exists. Unknown never becomes pass. |
usage error | 2 | The policy or a file could not be read exactly. A policy that cannot be read exactly is not evaluated approximately. |
- Evidence requirement
- requireReproducibilityComplete: true refuses any Passport whose seven reproducibility gates did not all pass.
- Absolute rule
- A metric against a threshold, aggregated across trials as worst_trial, mean_of_trials or median_of_trials. The starter policy requires success_rate ≥ 0.99 and ttft_p95_ms ≤ 800 on the worst trial.
- Relative rule
- A metric against the same metric in a baseline Passport, with an explicit tolerance in a declared direction. The starter policy allows TTFT p95 to rise 10% and output-token throughput to fall 5%, each on the median trial.
- Baseline
- A verified Passport the candidate is compared with. Without one, every relative rule is unknown and the verdict is inconclusive, exit 3. That is the recorded verdict for both Qwen3 first-party Passports run alone.
- Workload identity
- Prompt digest, request count, concurrency, token limit and protocol must match exactly between baseline and candidate. Distributions measured under different workloads are never compared.
- Allowed change surface
- comparison.allowedChanges lists the identity fields that may differ between baseline and candidate. The starter policy allows artifact.revision, runtime.version and endpointOrigin. An unlisted difference makes the comparison incompatible and its rules inconclusive.
- Waiver
- Names a rule, a reason, an approver and an expiry. An expired waiver stops applying; without an evaluation instant no waiver applies at all. Waived rules keep their underlying outcome in the receipt.
- Receipt
- The verdict file names the policy by its own content address, the candidate and baseline Passport IDs, every check and rule with its observed value and outcome, and every identity change the reviewer is approving.
Two recorded verdicts show the vocabulary at work measured. Run the starter policy over either Qwen3 first-party Passport with no baseline and the verdict is inconclusive, exit 3: both absolute rules pass, both relative rules are unknown, and the receipt says a verified baseline Passport is required. Ask the gate to compare the 8-bit coder Passport with the BF16 base Passport and it refuses: the identity changed outside the allowed change surface in endpointOrigin, model, artifact.repository, artifact.revision, so the comparison is incompatible and no relative rule is evaluated. Swapping the model between a baseline and a candidate is exactly the move a thread makes without noticing; the gate names it.
What a Passport does not prove.
A valid Passport proves that the record is intact, internally consistent, and signed by the key that claims authorship.
It does not prove that the endpoint served the declared weights, or that the hardware was what the operator typed. Those fields are declared and bound into the digest, not established by it. Hardware attestation is on the road map and not in the file. A signature is authorship, not truth: anyone can sign a JSON file, and what changes is what a disagreement looks like. When the next person with the same hardware runs the same twelve requests against the same revision and gets a different number, there are two signed files with the same configuration digest and different summaries, and the argument becomes a diff instead of a thread.
A plan does not predict performance; it bounds it. No first-party Passport is comparison eligible, because admission to a comparison is a separate review from verification, and no two of them share a configuration in the first place.
The evidence page carries the same base model, Qwen3-30B-A3B, at 3 precisions on this machine. Precision changes the artifact: a different repository, a different revision, a different configuration digest. These are 3 records of 3 configurations, not one model at 3 speeds, and because a different artifact repository is outside the starter policy’s allowed change surface the gate treats them as different deployments and does not rank them. What a quantisation costs in output quality is in none of the files.
| Precision | Artifact | Output tokens / s, per trial | Decode ceiling |
|---|---|---|---|
| BF16 | Qwen/Qwen3-30B-A3B declared | 30.1 · 25.9 · 31.1 measured | about 123.9 tokens/s calculated |
| 8-bit MLX | mlx-community/Qwen3-30B-A3B-8bit declared | 55.7 · 54.7 · 49.6 measured | no plan output in the registry yet unknown |
| 4-bit MLX | mlx-community/Qwen3-30B-A3B-4bit declared | 62.5 · 72.9 · 73.4 measured | about 440.7 tokens/s calculated |
Alongside, not instead.
The things that already exist, in their own words, and the gap this toolchain claims.
- Attested inference services (Tinfoil, Phala)
bind a model fingerprint to hardware attestation for their hosted endpoints.
We cover the deployment you run yourself; attestation is on our road map and not in the file today.
- SemiAnalysis InferenceX
publishes reproducible cross-runtime measurements on datacentre hardware.
We produce the per-deployment record on any hardware, including the Mac under the desk.
- MLPerf
is peer-reviewed when submitted.
We are a record anyone produces and anyone verifies, not a submission.
- lm-eval and Inspect
record environments in unsigned logs.
We seal and sign, and we gate.
- OMS and Sigstore
sign weights at rest.
We record what the weights did when served, and we intend to consume their signatures as the artifact-integrity gate.
We searched for a runtime-neutral, offline-verifiable record of a self-hosted deployment and found none. That is a search result, not a proof of absence. The projects named on this page are the ones this toolchain stands on: FreeToken and llama.cpp for host-memory expert placement, mlx-lm for serving on Apple silicon, vLLM and SGLang for production serving. Their figures are theirs; ours are in the files.