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 live at 0.1.0, rendering in raw ANSI 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.1.tar.gz (6.6 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.1-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ctxmaster-0.1.1.tar.gz
  • Upload date:
  • Size: 6.6 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.1.tar.gz
Algorithm Hash digest
SHA256 ff586aa54b81828f34710795b37f792d3c3d494802a943278b7a0e8c77125ad7
MD5 3c72c113b6b40360dcd6919c1f7b7cea
BLAKE2b-256 0f6584680198e40f25f3f86cf4d0795fb46d89fe8a494782383d53d8b954f011

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ctxmaster-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a4486c2290bd361081b9327a1267fb1d4dc195338d473b0e70d2ad1880e38f64
MD5 eee6c7fe2eaef3ea9d8b808aa26776a2
BLAKE2b-256 083ffe372a6d467b6032070e14b5b9c17cd032b48ae963ac192b1359717b7693

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