Skip to main content

👁️ llmstat

PyPI CI License: MIT

See what your LLM calls actually cost — in real time.

A modern, playful terminal dashboard that sits in front of any OpenAI-compatible API (OpenAI, DeepSeek, OpenRouter, LiteLLM, vLLM, Ollama, your own gateway…) and shows you live token usage, cost, and latency. No SDK changes. No cloud. No account.

pip install llmstat → point your base URL at it → watch the numbers move.

Light
llmstat light theme
Dark
llmstat dark theme

Two pastel themes — toggle with d. Today / all-time with t.


Why

You're an indie dev shipping with LLMs — self-hosted models, a personal gateway, a couple of pay-as-you-go API keys — and you have no idea what you're spending until the invoice lands. The big observability platforms (Helicone, Langfuse…) are built for enterprise: hosted, signup-walled, dashboard-heavy, and hungry for your data. llmstat is the opposite — for the dev who just wants the number: one tiny local proxy, one SQLite file, one good-looking TUI.

  • 🪶 Zero code changes — it's a drop-in proxy. Change one base URL.
  • 🔌 Provider-agnostic — anything that speaks the OpenAI API works.
  • 🌊 Streaming-aware — reads usage from SSE chunks, not just plain responses.
  • 💸 Cost, not just tokens — built-in pricing table, override your own rates.
  • 🔒 Local-first — your prompts never touch our anything. There is no "our anything".

Install

pip install llmstat

60-second tour (no API key needed)

llmstat demo      # seed some realistic sample traffic
llmstat dash      # open the dashboard
llmstat top       # or just a one-line status bar

Press t to flip between today and all-time, r to refresh, q to quit.

Real usage

1. Start the proxy in front of your provider:

llmstat serve --upstream https://api.openai.com
# llmstat proxy -> https://api.openai.com
# point your client base_url at: http://127.0.0.1:8787/v1

2. Point your client at it — only the base URL changes:

from openai import OpenAI

client = OpenAI(base_url="http://127.0.0.1:8787/v1")  # was: the real URL
client.chat.completions.create(
    model="gpt-5-mini",
    messages=[{"role": "user", "content": "hi"}],
)

3. Watch it live in another terminal:

llmstat dash

That's it. Every call your app makes now shows up with tokens, cost, and latency.

Tag your traffic (optional)

Send an X-Llmstat-Project header and llmstat will group spend by project — handy when one machine drives several apps.

Fix or add pricing

Models change prices constantly. Drop a ~/.llmstat/pricing.json to override:

{ "my-self-hosted-llama": [0.0, 0.0], "gpt-5.5-pro": [2.50, 15.00] }

Values are USD per 1M tokens: [input, output].

How it works

your app ──▶ llmstat proxy ──▶ real LLM API
                  │
                  └─▶ SQLite (~/.llmstat/usage.db) ──▶ TUI dashboard

The proxy forwards requests untouched and reads the standard usage block out of the response (for streams, it tees the SSE and grabs the final usage chunk). Nothing is buffered to disk except the counts you see.

Roadmap

  • llmstat top — a one-line live status bar (--watch to refresh)
  • Budgets & alerts (warn at $X/day)
  • Export to CSV / Prometheus
  • Per-project & per-key breakdown views

Ideas and PRs welcome — see an issue you'd like? Open one.

License

MIT © llmstat contributors

Metadata

Release files for llmstat 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for llmstat 0.1.1
File Size Uploaded
llmstat-0.1.1.tar.gz 29.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for llmstat 0.1.1
File Interpreter ABI Platform
llmstat-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 43.4 kB

Release files / llmstat-0.1.1.tar.gz

Download URL llmstat-0.1.1.tar.gz
Size 29.3 kB
Tags Source
SHA-256 checksum
How to use checksums
afcbef832a905c4ab3a72413993ff72de537d2cf7382b3556e01f438fb0d46fc
BLAKE2b-256 checksum
How to use checksums
c0f2201c15d27421cc8785885299a2b1c74c4dfcd9c00aef66c897eff17080cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release files / llmstat-0.1.1-py3-none-any.whl

Download URL llmstat-0.1.1-py3-none-any.whl
Size 14.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1f81126c5e384b9aecf55965a30af740ffd8e8a3aa0c233a62bc79e89be81bb3
BLAKE2b-256 checksum
How to use checksums
88f7de9e5c655aa41351c8f9ade23814e7b0db67b09c54e6e5eb9411d7a3ba8f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page