llm-logs-dashboard
v0.1.0
Published
Local, read-only web dashboard for llm-logs. Point it at your DB; inspect your LLM usage.
Downloads
12
Maintainers
Readme
llm-logs-dashboard
A local, read-only web UI over your llm_logs table. Point it at your own Postgres database and get an inspectable console for LLM usage — requests, errors, latency, tokens, sessions, and agent runs — without shipping a single row to a third party.
The dashboard reads. It never writes. It has no accounts, no telemetry, and no daemon. You run it on your machine, it opens a browser tab, and it queries the same llm_logs table that the llm-logs library writes to.
Requires the
llm-logslibrary to have created the table. The dashboard is a viewer — it does not create or migrate anything. Installllm-logs, wrap your LLM clients, and runnpx llm-logs migrate(or letautoMigratecreate the table on first write) before pointing the dashboard at your database.
Run it
npx llm-logs-dashboardThat's the whole setup. With no flags it resolves your connection string from DATABASE_URL (or LLM_LOGS_DATABASE_URL), reading a .env file in the current directory if present. It binds to 127.0.0.1:4242 and opens:
http://localhost:4242On start it connects, reports how many log entries it found, and serves the UI:
Connected to PostgreSQL at db.internal:5432/app
Found 128,402 log entries
Dashboard running at http://127.0.0.1:4242
Press Ctrl+C to stopIf the table can't be read, it tells you to run npx llm-logs migrate first.
Postgres is the only supported database today. (MySQL and SQLite are planned but not yet supported.)
CLI flags
| Flag | Default | Description |
|---|---|---|
| --db <url> | DATABASE_URL / LLM_LOGS_DATABASE_URL | Postgres connection string. |
| --port <n> | 4242 | Port to listen on. |
| --host <addr> | 127.0.0.1 | Host/interface to bind. |
npx llm-logs-dashboard --db "postgres://user:pass@host:5432/db" --port 8080 --host 127.0.0.1The screens
- Overview — the pulse: headline totals, request volume over time, and the outliers worth looking at.
- Logs — a filterable, sortable table of individual calls, with a detail drawer for any row.
- Errors — failures grouped and counted, so you can see what kind of thing is breaking and when it started.
- Latency — how slow calls are, broken out so you can tell a shifting median from a fat tail.
- Usage — traffic by provider and model: who serves the requests and which models dominate.
- Sessions — multi-turn conversations rolled up by session, so you can see how deep they go.
- Agent runs — agent executions rolled up by thread, with the parent/child structure of a run.
- Prices — your own dated price sheet, used to overlay cost on top of tokens (see below).
The UI is read-only, requires no auth, and polls for fresh data rather than streaming.
Cost model
The dashboard is tokens-first. Tokens are the ground truth the provider returns and the only thing stored; the llm-logs library never computes or stores a cost figure.
Cost is a display-time overlay, derived from a price sheet that you own and edit:
- The Prices screen is a user-owned, dated price sheet — per model, a set of non-overlapping, date-bounded rate intervals (input and output per-million rates). It ships with sensible defaults for known models and is fully editable.
- Cost is derived per row at the moment you look at it: each call's timestamp selects exactly one rate, and rows with no covering rate render token-only rather than being guessed at.
- Cost is never written back to the database. Change a rate and every number re-derives instantly. The price sheet lives entirely on the dashboard side, so the underlying table stays pristine and read-only.
This means you can adjust pricing retroactively, correct a rate you got wrong, or add a model that wasn't priced — without ever touching your data.
Reports
For a point-in-time snapshot you can pipe somewhere, use the report subcommand. It runs the same aggregate queries, prints to stdout (or a file), and exits.
npx llm-logs-dashboard report --range 30d --format md -o report.md| Flag | Values | Default | Description |
|---|---|---|---|
| --range <r> | 24h 7d 30d 90d | 7d | Window to report over. |
| --format <f> | md json csv | md | Output format. |
| -o, --output <file> | path | stdout | Write to a file instead of printing. |
The report contains:
- Totals — request count, total tokens, and error count with error rate.
- Usage stats — mean and median tokens per request; mean, median, and p95 latency.
- By provider — requests, tokens, and share of traffic per provider.
- Top models — the models driving the most requests and tokens.
- By client / by user — attribution splits (when that context is present in your logs).
- Errors — failures grouped by type, with counts and first/last-seen dates.
The json format returns the full structured object; csv emits per-model rows (provider,model,requests,tokens).
The command is compute-only — it queries and exits. To deliver reports on a schedule, wire it into your own cron or CI (for example, a nightly job that runs the command and posts the Markdown to Slack). There is no built-in scheduler or delivery mechanism.
Non-goals
This is a deliberately small tool. It does not try to be an observability platform.
- No auth. It's a local single-user viewer. If you expose it beyond localhost, put it behind your own reverse proxy / auth layer.
- No writes. It only ever reads your
llm_logstable. It does not migrate, backfill, or mutate anything. - Polls, not streams. Data refreshes by polling on an interval — there are no websockets and no live tail.
- One database at a time. A single connection per process; no multi-DB fan-out or cross-database joins.
License
llm-logs-dashboard is distributed under a Fair Use License (not an OSI-approved open-source license — please read LICENSE before use). In short:
- Free if any of these apply to you: you're an individual on personal/hobby projects; your organization's annual recurring revenue is under $1M; your organization has raised under $5M in total funding; or you're a student, academic, or non-profit.
- $150/year, flat, per organization otherwise — no per-seat or per-request fees, one license covers the whole org. Enforcement is honour-based; the software has no telemetry or license-key server.
- Converts to MIT three years after each version's publication date. Older versions are free forever.
See LICENSE for the full terms.
Commercial license: purchase at <add your Gumroad/Stripe link>.
The companion llm-logs library is Apache-2.0-licensed.
