{"id":49850022,"url":"https://github.com/rajdeepmondaldotcom/caliper","last_synced_at":"2026-05-27T14:01:16.124Z","repository":{"id":357450315,"uuid":"1236799739","full_name":"rajdeepmondaldotcom/caliper","owner":"rajdeepmondaldotcom","description":"Local cost ledger for AI-assisted development. Private dashboard and per-PR cost reports from Codex, Claude Code, Cursor, and Aider logs.","archived":false,"fork":false,"pushed_at":"2026-05-24T11:36:22.000Z","size":8313,"stargazers_count":2,"open_issues_count":2,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-24T13:26:33.104Z","etag":null,"topics":["ai","ai-coding","ai-costs","ai-finops","aider","claude-code","cli","codex","cost-tracking","cursor","developer-tools","finops","local-first","observability","offline","openai","pr-costs","private-dashboard","pull-request","python"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/caliper-ai/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rajdeepmondaldotcom.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-12T15:28:42.000Z","updated_at":"2026-05-24T11:33:13.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/rajdeepmondaldotcom/caliper","commit_stats":null,"previous_names":["rajdeepmondaldotcom/codex-meter","rajdeepmondaldotcom/caliper"],"tags_count":49,"template":false,"template_full_name":null,"purl":"pkg:github/rajdeepmondaldotcom/caliper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rajdeepmondaldotcom%2Fcaliper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rajdeepmondaldotcom%2Fcaliper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rajdeepmondaldotcom%2Fcaliper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rajdeepmondaldotcom%2Fcaliper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rajdeepmondaldotcom","download_url":"https://codeload.github.com/rajdeepmondaldotcom/caliper/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rajdeepmondaldotcom%2Fcaliper/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33568859,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-27T02:00:06.184Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","ai-coding","ai-costs","ai-finops","aider","claude-code","cli","codex","cost-tracking","cursor","developer-tools","finops","local-first","observability","offline","openai","pr-costs","private-dashboard","pull-request","python"],"created_at":"2026-05-14T15:01:19.674Z","updated_at":"2026-05-27T14:01:16.092Z","avatar_url":"https://github.com/rajdeepmondaldotcom.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# Caliper\n\n### The local cost ledger for AI-assisted development.\n\nRun one command. Get a private HTML dashboard showing what your AI coding\nactually cost — by project, PR, model, vendor, and session.\n\n**Offline by default. No account. No upload. No telemetry.**\n\n[![CI](https://github.com/rajdeepmondaldotcom/caliper/actions/workflows/ci.yml/badge.svg)](https://github.com/rajdeepmondaldotcom/caliper/actions/workflows/ci.yml)\n[![PyPI](https://img.shields.io/pypi/v/caliper-ai.svg)](https://pypi.org/project/caliper-ai/)\n[![Python](https://img.shields.io/badge/python-3.11%2B-blue.svg)](pyproject.toml)\n[![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)\n\n```bash\nuv tool install caliper-ai\ncaliper dashboard\n```\n\n\u003c/div\u003e\n\n![Caliper dashboard — verdict, KPIs, and operator brief in Safe Share mode](docs/screenshots/hero.png)\n\n\u003cp align=\"center\"\u003e\u003csub\u003eSafe Share mode screenshot: paths, projects, and session labels are redacted while costs, evidence status, and recommendations stay visible.\u003c/sub\u003e\u003c/p\u003e\n\n---\n\n## Why it exists\n\nAI coding tools are good at spending tokens and bad at explaining the bill.\nVendor dashboards are per-tool, per-account, and behind logins. They don't\nknow your local git history, your PRs, or which project caused the spend.\n\nCaliper reads the logs **already on your disk** from Codex CLI, Claude Code,\nCursor, and Aider, prices them with sourced rate cards, and answers questions\nthose dashboards can't:\n\n- What did this PR cost?\n- Which project is driving the bill?\n- How much did cache reuse save?\n- Are these numbers exact, estimated, partial, or unsupported?\n\nThe answer never leaves your machine.\n\n## The first 30 seconds\n\n```bash\ncaliper dashboard\n```\n\nOpens a self-contained HTML file in your browser. The verdict sits above the\nfold — period, cost, trend, and the top fix Caliper found:\n\n```text\nCaliper · Last 14 days · $1,243 · trend +8.2% · top fix: Move low-output fast\n                                                tier calls to standard ($96.40)\nFixable: $184.20 across 3 recommendations. Inspect with `caliper advise --strict`.\nTheme: dark · local-only · re-render: caliper dashboard --open\n```\n\nEvery KPI on the page has a **\"show the math\"** disclosure — the formula, the\nrate card date, and the sample size. Evidence, anomalies, savings, and session\nrows show the source quality behind the number instead of forcing you to trust\nan unexplained total.\n\n## Dashboard tour\n\nThese screenshots are generated from `caliper dashboard --safe-share`, so they\nshow the real report layout without exposing local paths or session identities.\n\n| Operator brief | Spend drivers |\n|---|---|\n| \u003cimg alt=\"Dashboard operator brief with verdict, priority actions, and selected-window cost\" src=\"docs/screenshots/hero.png\"\u003e | \u003cimg alt=\"Spend drivers grouped by vendor, model and tier, service tier, and source\" src=\"docs/screenshots/usage-mix.png\"\u003e |\n\n| Anomalies | Savings opportunities |\n|---|---|\n| \u003cimg alt=\"Spend spike anomaly rows with human-readable dates and impact labels\" src=\"docs/screenshots/anomalies.png\"\u003e | \u003cimg alt=\"Recommended savings, detected waste, and cache leverage panels\" src=\"docs/screenshots/inefficiencies.png\"\u003e |\n\n| Session drilldown | Attribution and evidence |\n|---|---|\n| \u003cimg alt=\"Session drilldown table with redacted session labels, started time, project, cost, tokens, tools, models, and reason\" src=\"docs/screenshots/sessions.png\"\u003e | \u003cimg alt=\"Attribution panels for agents, skills, tier sources, long-context boundary, and cohort deltas\" src=\"docs/screenshots/attribution.png\"\u003e |\n\n## How it's different\n\n| | Caliper | Hosted proxies (Helicone, Langfuse, …) |\n|---|---|---|\n| Where data lives | Local disk | Their servers |\n| Sits on the request path | No | Yes — proxy or SDK |\n| Login required | No | Yes |\n| Reads existing AI-tool logs | Yes — Codex, Claude Code, Cursor, Aider | No — needs you to route through them |\n| Per-PR / per-project cost | Yes — local git attribution | If you instrument it |\n| Works with WiFi off | Yes | No |\n\nCaliper is the receipt from evidence already on your machine. If you need a\nrequest-path proxy, use one of those. If you want to know what last month\nactually cost — without sending prompts to a third party — use this.\n\n## What you get\n\n| Surface | Command | Purpose |\n|---|---|---|\n| Browser dashboard | `caliper dashboard` | Operator brief, spend drivers, savings, anomalies, sessions, evidence. |\n| PR receipt | `caliper pr 42` | Cost attributed to one pull request. |\n| Overview | `caliper overview` | Rolling 7 / 30 / 90 day spend. |\n| Project rollup | `caliper project` | Spend by repository or folder. |\n| Model rollup | `caliper models` | Spend by model and vendor. |\n| Evidence report | `caliper evidence` | How trustworthy each dimension is. |\n| Advisor | `caliper advise --strict` | Ranked, dollar-anchored fixes. |\n| Doctor | `caliper doctor` | Local setup + data coverage. |\n| Budgets | `caliper budgets check` | CI-friendly warning / breach exits. |\n| TUI | `caliper tui` | Interactive terminal workspace. |\n\n### PR receipt\n\n```bash\ncaliper pr 42\n```\n\n```text\nCaliper · PR #42\n128 events  432,118 tokens  $4.82   ·   7 commits\n\n  Vendor        Model                 Events   Tokens (in/out)    Cached   $\n  openai-codex  gpt-5.4 standard          74   210,000 /  31,000    61%   $2.10\n  claude-code   claude-sonnet-4.6         31    88,000 /  12,000    48%   $1.12\n  cursor        composer                  23    72,118 /  19,000    22%   $1.60\n```\n\nMissing git attribution is surfaced as **partial evidence** instead of being\nsilently treated as exact.\n\n## Trust model\n\n| Boundary | Default |\n|---|---|\n| Login | none |\n| Upload | none |\n| Telemetry | none |\n| Daemon | none |\n| Request proxy | none |\n| Network calls during usage analysis | none |\n| Pricing refresh | explicit `--allow-network` |\n| GitHub PR lookup | explicit `--allow-network` |\n| Prompt output | redacted |\n| Absolute paths | redacted in machine-readable output |\n\nThe privacy invariant is enforced in CI. The generated HTML contains zero\nexternal resources, zero `\u003cscript src\u003e`, zero `fetch`/`XMLHttpRequest`/`import()`.\nYou can verify it on your own file:\n\n```bash\ngrep -E \"://|\u003cscript src|fetch\\(|XMLHttpRequest|import\\(\" ~/caliper.html\n# no matches\n```\n\n## Accuracy\n\nCaliper does not pretend every local log is perfect. It reports what the\nevidence supports.\n\n- Costs use `Decimal`.\n- Cached input, cache creation, output, and reasoning tokens are tracked\n  separately when vendors expose them.\n- Long-context multipliers are applied per model.\n- Codex Fast mode is priced with sourced model-family multipliers and kept\n  separate from standard-tier usage in dashboard spend drivers.\n- Unknown pricing is surfaced as a warning, not silently guessed.\n- Anomaly detection uses robust σ (MAD × 1.4826, IQR / 1.349) with a $1\n  absolute floor — no more \"354,210σ\" on a sparse Tuesday.\n- Evidence is graded `exact`, `estimated`, `partial`, or `unsupported`. Each\n  KPI exposes its formula inline.\n\n```bash\ncaliper evidence\ncaliper doctor\ncaliper rates show\n```\n\n## Budgets in CI\n\n```toml\n# .caliper.toml\n[budgets]\ndaily_cost_usd = 25\nweekly_cost_usd = 100\nmonthly_cost_usd = 500\n```\n\n```bash\ncaliper budgets check\n```\n\n| Exit | Meaning |\n|---:|---|\n| `0` | ok |\n| `1` | warning threshold crossed |\n| `2` | breach threshold crossed |\n\n## Supported sources\n\n| Source | What Caliper reads |\n|---|---|\n| OpenAI Codex CLI | Local session logs, state DB, model + token fields. |\n| Claude Code | Project JSONL logs, tool-use, cache token fields. |\n| Cursor | Local token-bearing records where available. |\n| Aider | Local chat history + usage records. |\n\nFiles that are transcript-only or missing token counts are surfaced by\n`caliper doctor` so coverage stays explicit.\n\n## Install\n\nRequires Python 3.11+.\n\n```bash\n# Recommended.\nuv tool install caliper-ai\nuv tool upgrade caliper-ai\n```\n\nThe PyPI package is `caliper-ai`; the command is `caliper`.\n\n\u003cdetails\u003e\n\u003csummary\u003eOther install paths (pipx, venv + pip, uvx)\u003c/summary\u003e\n\n```bash\n# pipx\npipx install caliper-ai\npipx upgrade caliper-ai\n\n# venv + pip\npython -m venv .venv \u0026\u0026 source .venv/bin/activate\npython -m pip install caliper-ai\n\n# uvx one-off (use --from to avoid name-collision resolution)\nuvx --isolated --from caliper-ai caliper dashboard\n```\n\nIf `uv` can't see a just-published version (stale PyPI index or resolver\ncache):\n\n```bash\nUV_NO_CACHE=1 uv tool install --force caliper-ai\n```\n\n\u003c/details\u003e\n\n## FAQ\n\n**Does it work with Cursor today?** Yes, when Cursor's local data includes\ntoken-bearing records. Some Cursor files are transcript-only. `caliper doctor`\nreports which.\n\n**How accurate are the costs?** As accurate as your local logs and rate card\nallow. Run `caliper evidence` to see which dimensions are exact, estimated,\npartial, or unsupported.\n\n**Does Caliper upload prompts?** No. Default usage analysis is local-only and\nredacts prompt-like fields from normal output. CI tests the privacy\ninvariant on every commit.\n\n**Is there a hosted version?** No. There is no hosted version on the roadmap.\nCaliper is intentionally a tool you run, not a service you log into.\n\n## Development\n\n```bash\nuv sync --all-extras --dev\nuv run ruff check . \u0026\u0026 uv run ruff format --check .\nuv run pytest\n```\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for rate-card updates, new vendor\nparsers, schema changes, and release hygiene.\n\n## Who built this\n\n[Rajdeep Mondal](https://github.com/rajdeepmondaldotcom). I had a four-figure\nAI coding bill, a strong hunch about which work caused it, and no offline way\nto prove it. The first version paid for itself in one PR review.\n\n## License\n\nMIT. See [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frajdeepmondaldotcom%2Fcaliper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frajdeepmondaldotcom%2Fcaliper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frajdeepmondaldotcom%2Fcaliper/lists"}