{"id":51306384,"url":"https://github.com/sbnet/headroom-stats","last_synced_at":"2026-07-01T00:02:13.585Z","repository":{"id":362591326,"uuid":"1257656484","full_name":"sbnet/headroom-stats","owner":"sbnet","description":"A real-time terminal dashboard for Headroom — the token-optimization proxy. See your token savings, cache performance, and compression stats live, without leaving the terminal","archived":false,"fork":false,"pushed_at":"2026-06-05T02:04:55.000Z","size":45,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-05T03:10:49.983Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","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/sbnet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-06-02T22:16:42.000Z","updated_at":"2026-06-05T02:04:59.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/sbnet/headroom-stats","commit_stats":null,"previous_names":["sbnet/headroom-stats"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/sbnet/headroom-stats","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbnet%2Fheadroom-stats","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbnet%2Fheadroom-stats/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbnet%2Fheadroom-stats/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbnet%2Fheadroom-stats/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sbnet","download_url":"https://codeload.github.com/sbnet/headroom-stats/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbnet%2Fheadroom-stats/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34987611,"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-06-30T02:00:05.919Z","response_time":92,"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":[],"created_at":"2026-07-01T00:02:12.774Z","updated_at":"2026-07-01T00:02:13.578Z","avatar_url":"https://github.com/sbnet.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# headroom-stats\n\nA real-time terminal dashboard for [Headroom](https://github.com/chopratejas/headroom) — the token-optimization proxy for Claude. See your token savings, cache performance, and compression stats live, without leaving the terminal.\n\n![Rust](https://img.shields.io/badge/rust-1.75%2B-orange)\n![License](https://img.shields.io/badge/license-MIT-blue)\n\n## Requirements\n\n- [Headroom](https://github.com/chopratejas/headroom) proxy running locally\n\n## Installation\n\n```bash\ncurl -fsSL https://raw.githubusercontent.com/sbnet/headroom-stats/main/install.sh | bash\n```\n\nThis downloads a pre-built binary for your platform (Linux x86/arm64, macOS Intel/Apple Silicon) to `~/.local/bin`. Re-run to update.\n\n**Custom install dir:**\n```bash\nINSTALL_DIR=/usr/local/bin curl -fsSL https://raw.githubusercontent.com/sbnet/headroom-stats/main/install.sh | bash\n```\n\n**Build from source** (requires Rust 1.75+):\n```bash\ncargo install --git https://github.com/sbnet/headroom-stats\n```\n\n## Usage\n\n```bash\n# Reads ANTHROPIC_BASE_URL automatically (set by headroom)\nheadroom-stats\n\n# Explicit proxy URL\nheadroom-stats --url http://localhost:8787\n\n# Custom refresh interval (default: 5s)\nheadroom-stats --interval 10\n```\n\n| Key | Action |\n|-----|--------|\n| `q` / `Esc` | Quit |\n| `r` | Force immediate refresh |\n\n## How it works\n\n`headroom-stats` polls the `/stats` HTTP endpoint exposed by the Headroom proxy and renders the response as a live TUI dashboard using [ratatui](https://ratatui.rs). The dashboard refreshes automatically every N seconds (configurable) and also responds to force-refresh on demand.\n\nThe displayed metrics mirror what `headroom perf` reports from logs, but sourced from the live proxy instead:\n\n| Section | Source |\n|---------|--------|\n| Request summary | `requests.*` + `tokens.*` |\n| Per-model breakdown | `cost.per_model.*` |\n| Prefix cache | `prefix_cache.totals.*` |\n| Optimization overhead | `overhead.*` |\n| Content router | `router.route_counts` |\n| TOIN learning | `toin.*` |\n\n## Stack\n\n- **[ratatui](https://ratatui.rs)** — terminal UI framework\n- **[tokio](https://tokio.rs)** — async runtime\n- **[reqwest](https://docs.rs/reqwest)** — HTTP client\n- **[clap](https://docs.rs/clap)** — CLI argument parsing\n\n# Release workflow\n\n```\n# 1. Bump the version in Cargo.toml\n# 2. Commit + tag\ngit tag vX.Y.Z\ngit push origin vX.Y.Z\n```\n## Contribution Guidelines\n\n- Prefer small, focused pull requests.\n- Keep changes pragmatic: small diffs, clear manual checks, explicit commit messages.\n- Do not commit secrets or credentials in plain text.\n- If you change deployment behavior, update this README.\n\n## Security\n\nIf you identify a vulnerability or unsafe infra/deployment practice, open a private issue or contact the maintainer before public disclosure.\n\n## License\n\nThis project is licensed under MIT. See [LICENSE](LICENSE).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsbnet%2Fheadroom-stats","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsbnet%2Fheadroom-stats","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsbnet%2Fheadroom-stats/lists"}