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-lm

Inputs the planner reads

FieldValueClassSource
Checkpoint tensor bytes61,064,245,248 bytessourcedsafetensors manifest at the pinned revision, metadata.total_size
Total parameters30,500,000,000sourcedQwen3-30B-A3B model card, model architecture
Active parameters per token3,300,000,000sourcedQwen3-30B-A3B model card, model architecture
Unified memory512 GBsourcedApple newsroom, M3 Ultra announcement
Memory bandwidth819 GB/ssourcedApple Mac Studio (2025) technical specifications
Reserve held back13.00 %declaredthe planner's default for runtime, KV cache and operating system

What it derives

FieldValueClassFormula
Bytes per parameter2.0021calculatedtensor bytes ÷ total parameters
Bytes read per token6,606,951,125 bytescalculatedactive parameters × tensor bytes ÷ total parameters, integer division
Usable memory after reserve445,440,000,000 bytescalculated512 GB × (1 − 13%)
Static residencyfits devicecalculatedusable memory ≥ tensor bytes; a lower bound on memory, not the runtime's peak
Single-stream decode ceilingabout 123.9 tokens/scalculatedmemory bandwidth ÷ bytes read per token
Runtime compatibilityunknownunknownno 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/s

On 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.

ParameterValueNote
Timed requests per trial12every request retained, successful or not
Concurrency1a single stream; the ceiling above is also single-stream
Maximum output tokens256the same limit for every request
Temperature0fixed by the runner
Warm-up requests2sent first, excluded from every summary
Trials3identical configuration each time; three is the minimum the Passport format accepts
Prompt1one prompt; its SHA-256 and UTF-8 byte count are in the file, its text is not
Never storedprompt text · response text · API keythe 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.json

03 · 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 digestpayload.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 digestpayloadSha256
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 IDpassportId
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.
Signaturesignatures[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 --json

Integrity checks

  1. schemaValid

    The file parses as a Passport of a known schema version with no unknown fields.

  2. payloadDigestValid

    The payload digest recomputes from the canonical bytes.

  3. passportIdValid

    The Passport ID is the payload digest under its typed prefix.

  4. configurationDigestValid

    The configuration digest recomputes from the declared configuration.

  5. summariesValid

    Every trial summary recomputes from its retained request measurements: TTFT and latency quantiles, success counts, throughput.

  6. signatures

    Each 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

  1. compatible_trials

    All trials share the same endpoint, model, artifact, runtime, infrastructure, and workload configuration.

  2. minimum_trials

    3 observed; 3 required for the v0.2 reproducibility gate.

  3. immutable_artifact_revision

    Artifact revision ad44e777bcd18fa416d9da3bd8f70d33ebb85d39 is declared with an immutable-length digest.

  4. runtime_identity

    Runtime name and exact version are declared.

  5. infrastructure_identity

    Hardware and topology are declared.

  6. request_measurements

    Each requested measurement is retained; successful requests include TTFT and returned token usage; no material context gap is declared.

  7. privacy_boundary

    Prompt 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
VerdictExit codeMeaning
pass0Every required evidence check and every rule succeeded with complete evidence.
fail1A required evidence check or a rule failed.
inconclusive3A metric, a baseline or a comparable configuration was unavailable, so no honest pass or fail exists. Unknown never becomes pass.
usage error2The 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.

PrecisionArtifactOutput tokens / s, per trialDecode ceiling
BF16Qwen/Qwen3-30B-A3B declared30.1 · 25.9 · 31.1 measuredabout 123.9 tokens/s calculated
8-bit MLXmlx-community/Qwen3-30B-A3B-8bit declared55.7 · 54.7 · 49.6 measuredno plan output in the registry yet unknown
4-bit MLXmlx-community/Qwen3-30B-A3B-4bit declared62.5 · 72.9 · 73.4 measuredabout 440.7 tokens/s calculated

Alongside, not instead.

The things that already exist, in their own words, and the gap this toolchain claims.

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.