Repository navigation
Releases
Releases · ai-process/light-tokenmeter
light-tokenmeter 1.2.0
Added
tool_callon usage events (server,tool,response_bytes), sent by an MCP gateway such as
Keystone's for each tool call it forwards, stored in Postgres and ClickHouse astool_server,
tool_nameandresponse_bytes. Atool_callmust name both a server (up to 64 characters)
and a tool (up to 128).
Image: coyl/light-tokenmeter:1.2.0 (linux/amd64, linux/arm64), signed with cosign; see Verifying a release.
light-tokenmeter 1.1.0
Tools for people and AI assistants; the service and its APIs are unchanged apart from the
version in /healthz.
Added
- The
tokenmeterCLI:usage summary|top|by-meta|exportwith totals in USD and windows that
the server caps fetched in parts,token new|hashforTOKENMETER_TOKENS,event send,
health, contexts with the token from an environment variable, a 0600 file or the system
keychain,-o json|csv, exit codes by error class and completion for bash, zsh and fish.
Released as archives with a signedchecksums.txt, thecoyl/tokenmeter-cliimage and a
Homebrew formula (published once the tap token is set). tokenmeter mcp: a read-only MCP server for AI assistants over stdio or streamable HTTP
(--listen, bearer token) withusage_summary,top_spenders,cost_per_action,
usage_by_meta,healthand ausage_reportprompt. It refuses a token that can write.pkg/client, a Go client for the gRPC API./healthzreports the service'sversion.
Image: coyl/light-tokenmeter:1.1.0 (linux/amd64, linux/arm64), signed with cosign; see Verifying a release.
light-tokenmeter 1.0.0
The first stable release, together with Keystone. The Model Switchboard. (KTMS) 1.0 and
ktms-admin 1.0. From here on, what API stability lists changes
incompatibly only in a new major version. Upgrade from 0.1.x in one step.
Added
cache_read_tokensandcache_write_tokenson usage events (usage.v1fields 17 and 18) and
summed in summary and by-meta rows: the input tokens read from and written to the vendor's
prompt cache, which vendors bill apart from plain input. They are part oftokens_input.
Stored in Postgres and ClickHouse; events from older callers carry 0.- Authentication: bearer tokens with
writeandreadscopes, configured as SHA-256 hashes in
TOKENMETER_TOKENSorTOKENMETER_TOKENS_FILE, several at once for rotation. Refusals are
401/403over HTTP andUNAUTHENTICATED/PERMISSION_DENIEDover gRPC. Without tokens the
service runs open and warns at startup. gRPC health is registered; reflection needs a token. - Prometheus metrics on
METRICS_ADDR(:9091): events, requests and their duration, storage
errors, ClickHouse copying, outbox size and age, andtokenmeter_build_info. The README lists
them with suggested alerts. - README "API stability" and "Versions and upgrades": what 1.x keeps compatible, one-step and
rolling upgrades, no downgrades. - An upgrade test (
scripts/upgrade-test.sh) from the previous release and the oldest of the
same major, with Postgres and ClickHouse, on every pull request and before each release. buf lint,buf breakingand a generated-code check on every pull request;govulncheckon
every pull request and release.- Releases:
vX.Y.Ztags, a GitHub Release with this changelog's section, and multi-arch images
signed with cosign, with SBOM and provenance (see SECURITY.md).
Changed
- ClickHouse no longer loses events. Events reach it through a Postgres outbox written in the same
statement as the event, copied in leased batches under a deduplication token, so a full buffer,
a ClickHouse outage or a crash neither drops nor double-counts them. The service starts and
stays ready without ClickHouse, and reads fall back to Postgres when it fails. - The first start with an empty ClickHouse copies the last 90 days of Postgres history to it;
reports stay on Postgres until that is done. - Validation before the freeze:
error_classup to 256 characters (longer used to fail with a
500),metaup to 16 KiB of keys and values with no empty keys, requests up to 16 MiB (413 request_too_largeover HTTP), andoccurred_atbetween 1900 and 2262-04-10; the zero time means
unset. - HTTP batch errors name the bad event as
invalid event at index N, like gRPC. - Summary rows leave out
statusunless grouped by it, like the other grouping fields. - Relicensed under Apache 2.0.
Security
- The startup log no longer contains the Postgres password: it named the whole
DATABASE_URL. - clickhouse-go v2.49.0 with ch-go v0.74.0, fixing GO-2025-3603 in the ClickHouse protocol reader.
Image: coyl/light-tokenmeter:1.0.0 (linux/amd64, linux/arm64), signed with cosign; see Verifying a release.