LLM usage dashboard (standalone prototype)
Migrated from Kimi Work’s LLM usage dashboard as a standalone local prototype. Its runtime behavior has not been verified for the current desktop project; the descriptions below preserve the prototype’s documented behavior.
collect.py/store.py/collectors/: collection/statistics, SQLite cache atdata/usage.db.dashboard/: static ECharts dashboard readingdashboard/data.json.data/usage.db: historical migration snapshot, with a 366-day rolling window.
Quick start
cd /d D:/tmp/llm-usage
# 1. Collect incrementally and generate dashboard data; first runs backfill source historypython collect.py
# 2. Open the dashboardstart dashboard/index.html # Windows; alternatively double-click index.htmlIn standalone mode, Refresh today’s data reloads data.json. Run python collect.py again to update it; file-protocol pages need a refresh.
Common arguments
python collect.py --refresh # Ignore incremental state and rescan allpython collect.py --tool kimi-code # Run a specified collector; repeatable optionpython collect.py --out output.json # Custom snapshot outputSupported sources
| Tool | Source |
|---|---|
| oh-my-pi | ~/.omp/agent/sessions/*/*.jsonl, ~/.omp/logs/*.log |
| kilo code | ~/.local/share/kilo/kilo.db |
| codex | ~/.codex/sessions/**/rollout-*.jsonl |
| zcode | ~/.zcode/cli/rollout/model-io-*.jsonl |
| copilot | ~/.copilot/session-store.db, ~/.copilot/session-state/*/session.db |
| kimi work | kimi-code engine …/kimi-code/home/sessions/**/wire.jsonl (usage.record) |
| kimi code | Newer v2.x ~/.kimi-code/sessions/**/wire.jsonl (usage.record) |
Newer Kimi Code (kimi-code collector)
The newer Kimi Code desktop 2.x home is ~/.kimi-code. Events still use sessions/**/agents/<agentId>/wire.jsonl. The collector scans the whole sessions tree recursively, so directory-depth changes do not affect discovery.
Environment variables:
- KIMI_CODE_HOME overrides home (default ~/.kimi-code).
- KIMI_CODE_SESSIONS directly sets session roots, separated by semicolons; overrides KIMI_CODE_HOME.
- KIMI_WORK_SESSIONS sets kimi work session roots, separated by semicolons.
Add a tool
Create a collectors/ file and register a collect(ctx) generator with @collector(“tool-name”); the framework discovers/schedules it. See collectors/init.py’s docstring. input must be uncached input tokens; request_id must be stable/unique for idempotent rescans.
Debugging
python -c "import collect; print(collect.run({'input': {'refresh': True}})['artifact']['sources'])"