omp packages

pi-metrics-footer0.1.4

Live model speed (tokens/s), token/cost/context stats, and configurable model labels in the pi TUI footer

GitHub Actions Published 7 days ago MIT ~264 downloads/mo

Untested on omp

This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.

Did it work for you?

Result

One report per person. A new report replaces your old one.

Reports 0

No reports yet.

Readme

pi-metrics-footer

Live model speed and usage metrics in the pi TUI footer: tokens/sec while streaming, per-turn average speed, token/cost/context stats, and model name — with configurable model labels.

Features

  • Live tokens/sec while the model streams (⚡ 45t/s), computed from a 2s rolling window of text_delta / thinking_delta events.
  • Per-turn average once a reply finishes: the last turn's average speed stays visible until the next turn replaces it — so a speed reading is always on screen, and it also works when the provider doesn't stream deltas.
  • Token / cost / context line: input, output, cache read/write, cost, and live context usage during streaming, plus the current model (emoji label + thinking level).
  • Configurable model labels: map provider/model IDs to your own display names.

Install

pi install npm:pi-metrics-footer

Then restart pi. The footer is replaced on session start.

Update

pi update npm:pi-metrics-footer

Updates are manual; the package does not auto-update.

Uninstall

Remove pi-metrics-footer from the packages list in ~/.pi/agent/settings.json, then restart pi.

Configuration

Create <pi-agent-dir>/pi-metrics-footer.json (default: ~/.pi/agent/pi-metrics-footer.json):

{
  "modelLabels": {
    "anthropic/claude-sonnet-5": "🎭 Sonnet 5",
    "openai/gpt-5.5": "🧠 GPT-5.5"
  }
}

Keys are provider/model exactly as shown by pi (e.g. from /model). User labels override the built-in defaults for the same key and add new ones. Restart pi (or /reload) after editing.

How It Works

  • Live TPS uses a 2s rolling window of streaming token events; it needs at least 2 samples within the window, so very short replies may not show it.
  • Average TPS = output tokens ÷ wall time of the last finished assistant message. It persists while idle and is replaced when the next turn produces a new reading.
  • Live context usage adds a streamed-output estimate to the completed-message baseline, then returns to pi's reported context usage when the message finishes.
  • Before the first reply of a session there is no speed reading yet, so the speed indicator is hidden.

License

MIT