Skip to main content

Mesh · a Transaction Science open standard

Inference as a metered transaction.

The serving + routing fabric. A request declares a joule ceiling and a fidelity floor; Mesh routes it to the cheapest-sufficient model on the cheapest-sufficient backend, serves it under an energy meter, and seals a receipt whose headline figure is microjoules per accepted token — measured at the meter, not estimated from a price list.

µJ / tok
Measured at the meter
F0–F4
Fidelity floor per request
JCR-1
Every serve sealed
joule ceiling × fidelity floor · routed cheapest-sufficient · sealed in a receipt

The thesis

Every inference is a metered transaction.

The serving shelf reports two numbers: dollars per token and tokens per second. Neither tells an operator, an auditor, or a regulator what an inference actually cost — in the one unit that is physical, comparable across hardware, and impossible to inflate: the joule.

Mesh makes that number first-class. A request carries a joule ceiling and a fidelity floor; the cheapest backend that clears both serves it, under a meter; and the result is a signed receipt that records the route that was taken and why, the recipe that served it, the honest provenance of the energy figure, and the joules per accepted token. Mesh does not replace the runtime that executes one inference, nor the substrate that supplies the compute — it is the front door in front of many models and many backends, and it proves what each one spent.

The request

A ceiling, a floor, and a number nobody else reports.

A serve request is content-addressed and carries its own contract: give me an answer at least this good, for at most this much energy. The prompt payload travels with the call — it is never part of the sealed receipt.

ServeRequest {
  prompt_hash:      content-id     ; the prompt, addressed — never the text
  prompt_tokens:    uint
  max_tokens:       uint
  fidelity_floor:   F0 … F4        ; the least answer that will do
  joule_ceiling_uj: uint           ; the hard energy budget
}

uj_per_accepted_token = energy.uj() / tokens_accepted   ; the wedge

The prompt_hash is content, not text — so a receipt is safe to publish without disclosing what was asked. The headline metric is measured around the decode: the energy figure if a hardware meter produced one, otherwise an honest estimate that says so.

How it routes

Cheapest-sufficient, and accountable for it.

Not a black box that picks a model — a deterministic decision you can read back from the receipt.

Dollars and tokens-per-second hide the cost
Mesh reports microjoules per accepted token, read at the meter — the one unit that is physical, comparable across hardware, and impossible to inflate.
Cheapest-sufficient routing
A request declares a fidelity floor and a joule ceiling. The lowest-energy backend that clears both wins, so a deterministic or cached tier is preferred and a frontier model is the expensive last resort — priced in joules.
The route is auditable from the receipt
Every backend the router weighed is recorded — its estimate, whether it was admissible, and the reason it was kept or rejected. The decision reads back from the receipt alone.
Authorisation outside the model
A serve request rides on a JCP Grant — a capability and a joule budget in one object. An underfunded or out-of-scope grant is refused before any decode runs. The gate is never the model.
Honesty enforced at seal time
Energy carries a provenance tag — measured on hardware, modeled, or estimated. A receipt can never claim a measurement it does not have; a deployment without a meter says 'estimated', and says so.
The prompt is never sealed
The receipt records only the content-addressed prompt hash, never the text. A receipt is safe to publish without disclosing what was asked.
A model is a recipe
The served model is a base plus merges and adapters, recorded by name — so the receipt says which composed model answered, not merely that something did.
Cache and speculation are savings, recorded
Prefix-cache hits and accepted speculative tokens are counted, so the energy a route saved is part of the evidence, not a footnote.
A session is a tamper-evident ledger
Each receipt seals as JCR-1 and links to the prior one by content hash. Reorder or excise one and the chain breaks.

The receipt

One serve, sealed and priced.

The mesh/1 receipt is canonical det-CBOR in a COSE_Sign1 envelope — the family's shared signed-receipt format, so it verifies with the same tooling as the rest of the substrate. This one is real: Falcon-H1 served through the mesh.

mesh_receipt           "mesh/1"
backend  falcon-h1-0.5b        recipe  falcon-h1-0.5b-instruct
route    cheapest-sufficient: falcon-h1 · fidelity F3 ≥ floor F3 (weighed 2)
prompt   "The capital of France is"   →   " Paris. It is known for its …"
tokens   in 6 · out 10 · accepted 10        fidelity_met  1
energy   11 213 608 µJ        provenance  Estimator (HwShunt on RAPL)
uj_per_accepted_token  1 121 360
grant    91d9544b…   sequence 0   ✓ sealed · verifies · chain intact

An underfunded grant is refused before any decode runs; the prompt is recorded only by its hash; and each receipt links to the prior one by content hash, so a session is a tamper-evident ledger of what was served and what it cost.

The compatible surface

The wire you already speak.

Mesh meets the inference ecosystem on the wire it already speaks. Point a client at the mesh and a /v1/chat/completions call routes cheapest-sufficient, serves under a meter, and seals a receipt — no SDK change, no new transport. A client on the newer /v1/responses path drives the same energy-metered serving unchanged: the request shape is what differs; the joule ceiling, the route, and the meter are identical.

The energy rides home in the one place the usage block leaves open. The token counts come back where they always do; the sealed mesh/1 receipt comes back under usage.energy — microjoules, microjoules per accepted token, the honest provenance of the figure, and the COSE envelope a third party verifies without trusting the server.

Ingest, not replace: the compatible shape is the surface; Mesh contributes the metered, sealed receipt underneath it.

Reference

The router, the meter, the receipt — real and tested.

An Apache-2.0 pure-Rust reference workspace with published conformance vectors. The reference engine is deterministic and weights-free; a real backend wraps a pure-Rust inference substrate, so the mesh routes and meters an actual model decode end to end — authorise, route, meter, seal, chain, verify — over Falcon-H1 answering "Paris."

It is expressed in primitives the family already publishes, not reinvented: a serve request is authorised by a JCP Grant and the receipt seals in JCR-1; it dispatches to runtimes such as JouleClaw; and it routes across compute described by EOC and isolated by Sandbox. No new cryptography.

mesh-schema
The wire objects: the content-addressed ServeRequest carrying a joule ceiling and a fidelity floor, the ordered F0–F4 fidelity scale, the two-part Energy record with its honest provenance, the model-as-recipe, and the route-decision audit.
mesh-router
Energy-weighted, cheapest-sufficient routing: admit a backend only when its fidelity meets the floor and its estimate fits the ceiling, choose the lowest-energy admissible one, and record every candidate with the reason it was kept or rejected.
mesh-engine
The serving-engine interface plus a deterministic, weights-free reference engine that does real metered work — modelling a prefix cache and a speculative-decode accept ratio — so conformance runs without model weights.
mesh-engine-gguf
A real backend over a pure-Rust GGUF / safetensors inference substrate. Wrap a checkpoint, register it, and the mesh routes and meters actual model tokens — Falcon-H1 decoding "The capital of France is" → " Paris." through the full path.
mesh-meter
The energy window around a serve. An always-available estimator, plus an optional bridge to the family hardware meter — RAPL, NVML, Apple Silicon — so a span on real silicon yields a measured figure, honestly tagged.
mesh-receipt
The mesh/1 receipt: canonical det-CBOR in a COSE_Sign1 envelope, byte-compatible with the family verifiers, with microjoules-per-accepted-token sealed in. It refuses to seal a measurement it does not have, and chains tamper-evidently.
mesh-core
The orchestration: authorise the grant, route, meter around the engine, seal — the four phases of one metered inference, the authorisation decided outside the model.
mesh-openai
The OpenAI-compatible surface — the wire every serving stack and client SDK already speaks. A /v1/chat/completions request, or a /v1/responses request from a client on the newer Responses API, drives energy-metered serving unchanged: messages become a content-addressed prompt hash, the route runs cheapest-sufficient, and the sealed mesh/1 receipt comes back in usage.energy — microjoules, microjoules-per-accepted-token, and honest provenance, the dimension a usage block has no field for. A std-only reference server speaks both paths.
mesh-conformance
The deterministic reference serve, its field-by-field checks, and the vector generator — published vectors a third-party verifier reproduces byte for byte.
Read the Mesh standard