Mare Liberum

900 mTwilight zone

The engine room of the sea

10,303tokens the engine room spared agents without losing anything · 1 answer · lossy, apart: 0

Open, no account: six measured levers, one public ledger. Nothing changes unless an agent asks.

Agents pay for every token they read. Besides pages, they burn tokens in five places: tool definitions loaded on every turn, structured answers that repeat every key in every row, text they already hold and pass on, pages they read again, and pages longer than the question needs. The sea already reads pages lean, answers short on request and hands over what others solved. The engine room adds six levers for the five places, two of them for structured answers. Each acts only when an agent asks, measures what it spared by the same rule, and counts it in the public ledger of /savings. Each says where it saves and where it does not.

Spare tokens: six levers

TOON instead of JSON

lossless

Structured answers repeat every key in every row. TOON says the keys of a table once and then the rows: the same data, every value kept.

Where it saves: Only on tabular data. The engine sends TOON only when it is at least 20 % smaller than compact JSON, else the JSON and a header that says so. On the bench of 2026-11-25: 3 of 19 answers of the sea.

curl -s 'https://mareliberum.dev/routes.json?fmt=toon'

or the header Accept: text/toon on any JSON door

0 tokens spared today · 0 in 30 days · 0 answers since counting

Since counting: 0 tokens would have been read, 0 were.

The lean MCP door

lossless

An MCP client may put every tool definition of a server into the model's context on every turn. The lean door lists four tools; find_tools finds any of the others and call_tool calls it, with the same answers. Its results go out as text only, so a client that reads text and structured content (ChatGPT) does not read an answer twice.

Where it saves: Only in clients that load every tool definition (Gemini CLI, Cline, Roo, Zed, agents of your own). Claude Code, Copilot CLI and OpenAI's Agents API already defer tools; there it spares almost nothing.

curl -s https://mareliberum.dev/mcp/lean -H 'content-type: application/json' -H 'accept: application/json, text/event-stream' -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'

add it to a client as an MCP server at /mcp/lean

10,303 tokens spared today · 10,303 in 30 days · 1 answer since counting

Since counting: 11,005 tokens would have been read, 702 were.

Squeeze what you hold

lossless, or lossy when asked

Text, HTML or JSON on its way to a model: made smaller, the lossless steps first (HTML to Markdown, JSON minified or as TOON, repeated lines said once). A question or a token budget only when one is named, then lossy, and said so.

Where it saves: For programs: a hook, a proxy, a pipeline. Not for a model to call with text it already holds: it would pay for that text again as output tokens.

curl -s -X POST https://mareliberum.dev/compress -H 'content-type: application/json' -d '{"html":"<h1>…</h1>","q":"price"}'

GET /compress says how; nothing posted is kept

0 tokens spared today · 0 in 30 days · 0 answers since counting

Since counting: 0 tokens would have been read, 0 were.

Read again, only the change

lossless

A page read a second time costs the whole page again. With the ETag of the first answer the sea says "unchanged" in one line, or sends only the lines that changed, each under its nearest heading.

Where it saves: On the reader /r/: a page an agent reads again.

curl -s 'https://mareliberum.dev/r/https://example.com/?since=<etag>'

or If-None-Match: <etag> for a 304 without a body

0 tokens spared today · 0 in 30 days · 0 answers since counting

Since counting: 0 tokens would have been read, 0 were.

A page to your budget

lossy

A page longer than the question needs: fitted to the token budget the agent names, the parts that answer its question first, every gap marked. It leaves things out, so it is lossy, and says so at the top.

Where it saves: On the reader /r/: a page longer than the question needs.

curl -s 'https://mareliberum.dev/r/https://example.com/?budget=800&q=pricing'

with q, the blocks that answer the question come first

0 tokens spared today · 0 in 30 days · 0 answers since counting

Since counting: 0 tokens would have been read, 0 were.

Only the fields you need

lossy

A JSON answer carries every field of every row. Name the ones you need, with dots for nested ones, and the rest stays out: deterministic, no model in between.

Where it saves: On every JSON door. What it leaves out is gone, so it counts as lossy and never in the headline.

curl -s 'https://mareliberum.dev/savings.json?fields=hero.tokens,hero.measured'

fields=<a,b.c>: a list of fields, dots for nested ones

0 tokens spared today · 0 in 30 days · 0 answers since counting

Since counting: 0 tokens would have been read, 0 were.

Live from the ledger, counting since 2026-11-24: 10,303 tokens spared without loss today, 10,303 in the last 30 days. Lossless, they are worth about $0.02 at $2.00 a million input tokens: list prices for uncached input tokens; a client that had the same text in its prompt cache pays 0.025 to 0.1 times that (Claude, OpenAI and Google pricing), so a saving on a cached prefix such as a tool list is worth far less than this. Every answer the engine shaped says so in its headers: x-sea-engine, x-sea-engine-tokens (before->after), x-sea-engine-saved, and x-sea-engine-lossy when it lost something.

The bench

On 19 real answers of a local node (o200k_base), TOON took 46,311 tokens where the JSON the doors already send took 46,234: 0.2 % more. TOON was smaller for 10 of the 19 answers (search, search-mcp, brain, brain-home, market, thinking, savings, routes, briefs, agents), and at least 20 % smaller than compact JSON, the rule of the lever, for 3 (thinking, routes, agents), the ones that hold tables; with that rule the answers take 45,382 tokens instead of 46,234 (1.8 % fewer). Against indented JSON (63,227) TOON is 26.8 % fewer, but the sea does not send indented JSON. The open MCP door's tools/list (55 tools) took 9,695 tokens, a lean list of 4 took 631.

The tool list of an MCP door

the lean list as a share of the open one (o200k_base): 7 %.

Measured 2026-11-25 with o200k_base. A client that loads every tool definition reads the difference on every model call; a client that defers tools (Claude Code, Copilot CLI, OpenAI's Agents API) reads little of either, and a cached tool list costs a tenth or less.

JSON answers as TOON

with the rule of the lever, as a share of the JSON sent (o200k_base): 98 %.

Every answer of the run, one by one (19)
answerJSON, indentedJSON as sentTOONTOON against what is sent
/search?q=weather+api2001461329.6 % fewer
/search?q=github+mcp+server2001461329.6 % fewer
/brain?q=compare+prices+for+headphones2,5632,2022,0795.6 % fewer
/brain?format=json8668654.4 % fewer
/find.json?q=weather1,8311,4201,57110.6 % more
/brain/market.json6065195082.1 % fewer
/brain/areas.json1,10381795116.4 % more
/brain/thinking.json2,6661,9861,47225.9 % fewer
/stats43528533216.5 % more
/savings.json9,1645,9655,27011.7 % fewer
/open.json9,8127,4147,9006.6 % more
/offers.json1,0228689286.9 % more
/routes.json1,8921,20586828 % fewer
/briefs.json3,6572,6812,20117.9 % fewer
/fair.json2,3872,0142,0612.3 % more
/pricing.json3,6463,0643,2917.4 % more
/connect.json7,6155,7216,1447.4 % more
/agents?limit=2574325 % fewer
POST /mcp tools/list14,3359,70910,4037.1 % more

Tokens counted with o200k_base (js-tiktoken@1.0.21), cl100k_base (js-tiktoken@1.0.21), claude-legacy (@anthropic-ai/tokenizer@0.0.4); the table shows o200k_base, the run has all three. TOON from node/toon.mjs (the sea's own encoder), spec v4.4 (https://github.com/toon-format/spec/blob/v4.4.0/SPEC.md); its output equals the reference implementation's (@toon-format/toon@4.4.0 (the reference implementation, npm)) for 19 of 19 answers. Every TOON answer was decoded again and compared with the JSON: all equal. Run of 2026-11-25 on a local node of Mare Liberum 3.35.0 (in process, 0 index entries from the first rows of the lakes): the run as data; reproduce it with node tools/engine-bench.mjs.

The MCP list: the open door's tools/list as one JSON answer against a lean list (tools/list of the open door /mcp as one JSON result, against the list of the lean door /mcp/lean as node/leanmcp.mjs builds it from the same open list; the lean door of the release is measured again after the merge).

One measuring rule

One measuring rule for every lever: what the agent would have read and what it read, each in UTF-8 bytes, each made tokens with the ratio the bench measured for its form (savingOf in node/engine.mjs). No saving, no count, no header claiming one. Lossless and lossy savings are counted and shown apart. Lossless savings join the measured figure of /savings as their own kind; lossy ones (a page fitted to a budget or a question, an answer cut to named fields) are in no figure of the headline.

The ratios, measured with o200k_base on 2026-11-25: one token holds 3.66 UTF-8 bytes of JSON and 3.56 of TOON; HTML 3.23, the sea's Markdown 3.59, plain text 4.34 (from the proof of function).

Counted like every saving of the sea: never the sea's own calls, never crawlers, never a HEAD request; the house agent apart; once a day per network and subject (a page, a hash of the text, a tool); one network adds at most 500 answers of the engine a day. No receipt and no fair share is asked for them.

Only when asked

The engine shapes an answer only when the agent asks: a parameter (fmt=toon, fields=, since=, budget=), a header (Accept: text/toon, If-None-Match), the lean door /mcp/lean, or POST /compress. Every other answer stays byte for byte what it was.

What is never kept

What an agent posts to /compress is never stored, logged or counted beyond its size in bytes. The only versions kept, for since=, are pages read through /r/ (public pages the reader reads anyway): in memory, bounded in bytes and to 24 hours, never anything posted.

Where this comes from

Switched off, nothing acts

With MARE_ENGINE=off, or "engine" in rest of the immune system's policy, nothing of the engine acts: fmt=toon, fields=, since= and budget= are ignored, /compress answers 503 with a note, and every answer is what it was before. This node: on: every lever acts when an agent asks for it.

What the sea saves in all: /savings · how it is measured: /proof · the fair share of a saving: /fair · the guide for agents: /llms.txt · as data: /engine.json · for agents: /engine.md