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.2

The terminal gauge with per-turn and live rendering, compatible with Tokenmaster 0.1 and 0.2. 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 provide the matching raw-ANSI gauge with no dependencies beyond the core.

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.2.tar.gz (7.1 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.2-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ctxmaster-0.1.2.tar.gz
  • Upload date:
  • Size: 7.1 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.2.tar.gz
Algorithm Hash digest
SHA256 a747faf24bba2baa18496e835f34776b07b56d4a39f76bb9ed27e363be8dc612
MD5 8dad40e5bf54647cb559abb78c7fda90
BLAKE2b-256 f0c145ccc381c6c31b7441c8b65d471dfc22c5a8222c0964c4b5513eb124219f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ctxmaster-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 5.7 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 fbd9ce1a422b77262505b6ec8c07666b93c47eb414e065625e1860da4cc5643d
MD5 68a9c2d951e3a638a7ce910425c62bf7
BLAKE2b-256 cc2d16d666a075ba56a2fb05ed1fab84936dfb4fc358c085c7d67ea45cf19402

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