Skip to main content

Visualization layer for tokenmaster: terminal context gauge and renderers for LLM context-budget metering.

Project description

ctxmaster

Visualization layer for tokenmaster, the core context-budget metering and decision engine for LLM applications.

The hero surface is the context gauge: a zone-colored fill bar against the model's effective window with threshold ticks, and ancillary rows for context accounting, capacity provenance, token velocity, projected turns to exhaustion with a conservative bound, zone, reserved output, hidden overhead, and cache prefix. The gauge computes nothing itself; every number comes off tokenmaster's MeterState, and anyone can build an alternative visualizer against the same event stream.

Install

pip install ctxmaster

Quickstart

from tokenmaster import Meter
from ctxmaster import ContextGauge

meter = Meter.for_model("anthropic:claude-haiku-4-5")
gauge = ContextGauge()

gauge.attach(meter)   # prints a fresh gauge on every recorded turn

meter.record({"input_tokens": 48_000, "output_tokens": 1_200})

For an in-place updating display in interactive sessions:

with gauge.live(meter):
    ...  # record turns; the panel updates in place

A runnable demonstration lives at examples/demo_gauge.py in the repository: a simulated agent accelerating from green into critical.

What is in 0.1.0

The terminal gauge with per-turn and live rendering. Planned next: the advice panel rendering tokenmaster recommendations with their rationale, a CLI, and dashboard surfaces. The npm and crates.io packages of the same name are reserved placeholders until the ports land.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ctxmaster-0.1.0.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ctxmaster-0.1.0-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file ctxmaster-0.1.0.tar.gz.

File metadata

  • Download URL: ctxmaster-0.1.0.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.2

File hashes

Hashes for ctxmaster-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0fe7d2b01c66ef17efe2f34b5b34f2522af059327cf6d4c184c6b585aa7fd018
MD5 d43eaa2e907e15c664a40bac07c30bb0
BLAKE2b-256 69c4ace533b9ebbb2b5e31d75e7bc50e22377cb682f41a86ab936b2540934668

See more details on using hashes here.

File details

Details for the file ctxmaster-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: ctxmaster-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.2

File hashes

Hashes for ctxmaster-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5ab9b42dcf0fff2d71d5b0030be8715fae78b2280eff746252cc33e8a3d19696
MD5 03dc6a6f7557cdb320eedcb4c4730112
BLAKE2b-256 aaa698ab0741d61bacd44843f18d6afacfca1aa238a19f4abe247ca2885fd870

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page