Local OTLP accounting

Count every token. Keep every prompt private.

Turn traces from coding agents and LLM apps into a local ledger of tokens, cost, cache, latency, and errors—without another SDK, proxy, or hosted dashboard.

Aggregate-only storage. Loopback by default. Zero telemetry.

A halftone field meter turns dotted telemetry streams into four aggregate ledger bands while message fragments dissolve before entering.
Input + outputCache read + writeLatency + errorsObserved or priced cost
Recorded demo

The ledger, before the dashboard tax.

Switch dimensions and export a real CSV. This sample mirrors the local dashboard served by the binary.

Sample collector live
No trace bodies retained
729requests
1.61Mtokens
1,083 msaverage latency
8errors
Known conventions, honest gaps

One trace in. Three useful dimensions out.

Standard GenAI attributes are preferred; common legacy names are mapped. Anything missing remains visible as unknown.

Trace content is not accounting data.

Prompt text, completion text, trace IDs, events, and individual spans are never written to disk. Only the counters needed for attribution cross into the ledger.

Stored: grouped counters, duration totals, error counts, observed cost, last-updated time.

OTLP/HTTPprotobuf or JSON · /v1/traces
Semantic mappingGenAI + common legacy attributes
Aggregate ledgerproject × model × tool
MeasurePreferred attributeFallback
Input tokensgen_ai.usage.input_tokensllm.usage.prompt_tokens
Output tokensgen_ai.usage.output_tokensllm.usage.completion_tokens
Modelgen_ai.response.modelgen_ai.request.model
Projectservice.namespaceproject.id
One binary

Open the local meter.

Start collecting in under a minute. The same address receives OTLP traces and serves the dashboard.

01

Vendor-neutral

Any OTLP/HTTP exporter can send traces.

02

Scriptable

Table, JSON, and CSV outputs with useful exit codes.

03

Free + MIT

No account, license key, or hosted dependency.

shell · localhost
$ cargo install --git https://github.com/B-Divyesh/sf-otel-token-meter

$ otel-token-meter serve \
    --listen 127.0.0.1:4318 \
    --data ./token-meter.json

collecting → http://127.0.0.1:4318/v1/traces
dashboard  → http://127.0.0.1:4318/