Skip to content
mar0derPublic

About

Local-first desktop app for tracking LLM token usage and subscription value

Resources

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

MEtR

Local-first LLM usage tracker. MEtR indexes your local conversation logs from Claude, Kimi, OpenAI Codex, Cursor, Cline, Continue, Ollama, and LM Studio — then calculates what that usage would have cost you at API pricing. Compare subscription spend against real usage, track projects over time, and optionally sync across devices.

Download GitHub Release


Download

The app includes an auto-updater. New versions are published to the update server automatically — no manual reinstall needed.


Versioning

MEtR versions use the format YY.WW.PATCH:

  • YY is the two-digit ISO calendar year.
  • WW is the ISO week number for the release date (01-53).
  • PATCH increments for additional releases in the same week.

For example, 26.38.1 means the first release in ISO week 38 of 2026. Release tags use the same value with a v prefix, such as v26.38.1. To check the current ISO year and week on macOS or Linux, run date +%G-W%V.


What MEtR Does

Track Real Usage from Local Logs

MEtR reads your existing LLM conversation files — no copy-paste, no API keys, no telemetry. It parses token usage metadata from logs created by:

  • Claude Code (~/.claude)
  • OpenAI / Codex CLI (~/.codex)
  • Cursor (~/Library/Application Support/Cursor)
  • Kimi / Moonshot (~/.kimi)
  • Cline / Roo Code (~/Library/Application Support/Code/User/globalStorage)
  • Continue (~/.continue)
  • Ollama (~/.ollama)
  • LM Studio (~/.lmstudio)

Calculate API-Equivalent Cost

For every model call, MEtR looks up live pricing (input, cached input, output tokens) and calculates what you would have paid if you had used the API directly. See at a glance whether your subscription is saving you money or costing you more.

Project-Level Breakdown

MEtR detects project roots from your conversation paths and aggregates usage per project. See which repositories or workspaces are driving the most token spend.

Optional Cloud Sync

MEtR is local-first — all data lives in a local SQLite database. Raw log files never leave your device.

If you want to sync anonymized usage events across multiple machines (e.g., work Mac + personal Mac), you can connect to a self-hosted sync server. Only parsed, anonymized model call events are uploaded — never raw conversation content.

The sync server is included in this repo under sync-server/ (Laravel + Docker).


Features

  • 📁 Multi-provider indexing — Claude, Codex, Cursor, Kimi, Cline, Continue, Ollama, LM Studio
  • 💰 API cost calculation with per-model pricing catalog
  • 📊 Dashboard with daily/weekly/monthly breakdowns
  • 🏷️ Project detection and per-project spend tracking
  • 🔄 Incremental scanning — only re-parses changed files
  • ☁️ Optional sync across devices (self-hosted)
  • 🍎 Native desktop app — macOS, Windows, Linux
  • 🔒 Private by default — no cloud required, no telemetry

Tech Stack

Layer Technology
Desktop framework Tauri 2
Frontend React 19 + TypeScript
Build tool Vite 8
Backend Rust (edition 2021)
Local database SQLite via rusqlite (bundled)
HTTP client reqwest (blocking)
Sync server Laravel (PHP) + Docker + nginx

Development

# Install dependencies
npm install

# Run the desktop app in dev mode
npm run tauri:dev

# Build frontend only
npm run build

# Build release installers (macOS locally)
npm run tauri:build

Windows Build Prerequisites

Tauri on Windows requires Microsoft Visual Studio C++ Build Tools:

  • Visual Studio Build Tools 2022
  • Workload: Desktop development with C++
  • MSVC toolchain + Windows SDK

If Cargo fails on certificate revocation checks:

$env:CARGO_HTTP_CHECK_REVOKE='false'
cargo check

Testing Parsers

Synthetic parser fixtures live in fixtures/:

fixtures/
  claude/
  codex/
  generic-jsonl/
  malformed/

Add one of those folders as a manual source in Settings, then run Rescan to test indexing without reading real LLM history.


Sync Server

The optional sync server lives in sync-server/ and is deployed via Docker Compose. It handles:

  • Anonymous device registration
  • Anonymized usage event sync
  • Multi-device dashboard aggregation
  • Update artifact hosting (macOS .tar.gz, Windows .msi, Linux .AppImage)
  • Release publishing via php artisan metr:release:publish

See sync-server/README.md for backend setup instructions.


Contributing

Contributions are welcome. The codebase is intentionally concentrated in two files:

  • src/main.tsx — all React components, hooks, types, and UI logic
  • src-tauri/src/lib.rs — all Tauri commands, DB schema/migrations, parsing, pricing, sync, and queries

For developer setup, see the README files in sync-server/ and src-tauri/.


License

MIT

About

Local-first desktop app for tracking LLM token usage and subscription value

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages