[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-92769":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":15,"stars7d":15,"stars30d":16,"stars90d":15,"forks30d":15,"starsTrendScore":15,"compositeScore":17,"rankGlobal":10,"rankLanguage":10,"license":18,"archived":19,"fork":19,"defaultBranch":20,"hasWiki":21,"hasPages":19,"topics":22,"createdAt":10,"pushedAt":10,"updatedAt":32,"readmeContent":33,"aiSummary":34,"trendingCount":15,"starSnapshotCount":15,"syncStatus":35,"lastSyncTime":36,"discoverSource":37},92769,"frugon","Rodiun\u002Ffrugon","Rodiun","Free, local, open-source LLM cost analyzer - see where your LLM bill leaks, on your machine.","https:\u002F\u002Ffrugon.rodiun.io",null,"Python",122,7,64,0,58,48.51,"MIT License",false,"main",true,[23,24,25,26,27,28,29,30,31],"anthropic","cli","cost-optimization","finops","llm","llmops","local-first","openai","python","2026-07-22 04:02:07","# Frugon\n\n**Your LLM bill is leaking — see exactly where, on your machine.**\n\nFree, local, open-source LLM cost analyzer. Point Frugon at your LLM call logs\nand see — on your machine — how much you'd save by switching or routing models.\n\n[![PyPI](https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fv\u002Ffrugon.svg?cacheSeconds=3600)](https:\u002F\u002Fpypi.org\u002Fproject\u002Ffrugon\u002F)\n[![License: MIT](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-MIT-green.svg)](LICENSE)\n[![CI](https:\u002F\u002Fgithub.com\u002FRodiun\u002Ffrugon\u002Factions\u002Fworkflows\u002Fci.yml\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002FRodiun\u002Ffrugon\u002Factions\u002Fworkflows\u002Fci.yml)\n[![Python](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fpython-3.10%20%E2%80%93%203.13-blue.svg)](https:\u002F\u002Fgithub.com\u002FRodiun\u002Ffrugon)\n[![Platforms](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fplatforms-macOS%20%C2%B7%20Linux%20%C2%B7%20Windows-blue.svg)](https:\u002F\u002Fgithub.com\u002FRodiun\u002Ffrugon)\n\n> **Your data never leaves your machine. Your keys go straight to your own providers. Nothing reaches us.**\n\n![Frugon analyzing a log file and recommending a routing split](https:\u002F\u002Fraw.githubusercontent.com\u002FRodiun\u002Ffrugon\u002Fmain\u002Fassets\u002Fdemo.gif)\n\n## Install & run\n\n```bash\n# one-shot (no install)\nuvx frugon analyze .\u002Flogs.jsonl\n\n# permanent install\npipx install frugon\nfrugon analyze .\u002Flogs.jsonl\n\n# for --measure (optional): samples real prompts through your own provider keys\npip install 'frugon[measure]'\nfrugon analyze .\u002Flogs.jsonl --measure\n```\n\nNo logs yet? See [Getting your logs](#getting-your-logs) below, or run `frugon analyze --demo` to see it work on a bundled sample.\n\n## Getting your logs\n\nfrugon reads **JSONL files** in the OpenAI request\u002Fresponse format. There are two ways to produce them.\n\n### Option A — frugon capture (proxy shim)\n\n`frugon capture` is a local HTTP proxy that sits between your app and your provider.\nEvery call is forwarded unchanged to your real provider and saved as one JSONL line.\n\n```bash\n# Start the shim (default port 8787, output file capture.jsonl)\nfrugon capture --out .\u002Flogs.jsonl\n\n# Then point your app's base URL at the shim instead of api.openai.com:\nOPENAI_BASE_URL=http:\u002F\u002F127.0.0.1:8787 your-app           # bash \u002F zsh\n$env:OPENAI_BASE_URL=\"http:\u002F\u002F127.0.0.1:8787\"; your-app   # PowerShell (Windows)\n# or in code: client = OpenAI(base_url=\"http:\u002F\u002F127.0.0.1:8787\u002Fv1\")\n```\n\nOptions: `--port`, `--out`, `--upstream` (override the forwarding target), `--verbose`\n(print one line per captured call to verify it's recording), `--proxy` (opt in to route\nupstream calls through a proxy — by default frugon ignores any ambient `HTTP_PROXY` \u002F\n`HTTPS_PROXY`, so your API key never passes through a third-party proxy). The shim adds no\nlatency overhead on localhost and makes no calls to any frugon endpoint.\n\n### Option B — write JSONL directly\n\nIf you already capture logs (e.g. via middleware or a provider SDK callback), write one\nJSON object per line with this shape:\n\n```json\n{\n  \"model\": \"gpt-4-turbo\",\n  \"request\": {\n    \"messages\": [\n      {\"role\": \"system\", \"content\": \"You are a helpful assistant.\"},\n      {\"role\": \"user\",   \"content\": \"Summarise this document: ...\"}\n    ]\n  },\n  \"response\": {\n    \"choices\": [{\"message\": {\"content\": \"Here is the summary: ...\"}}]\n  },\n  \"usage\": {\n    \"prompt_tokens\": 312,\n    \"completion_tokens\": 84\n  },\n  \"timestamp\": \"2024-11-01T14:22:01Z\"\n}\n```\n\n`usage.prompt_tokens` \u002F `usage.completion_tokens` — preferred when present; frugon falls\nback to its own tokenizer when absent. `timestamp` is optional but enables frugon to\nproject costs over a real observed span. `model` is required; everything else degrades\ngracefully.\n\n### 5-minute path from install to first analysis\n\n```bash\nuv tool install frugon          # or: pipx install frugon \u002F pip install frugon\nfrugon capture --out .\u002Flogs.jsonl &   # start the proxy in the background\n# ... run your app, make some LLM calls ...\nfrugon analyze .\u002Flogs.jsonl     # see the cost breakdown and routing recommendation\n```\n\n## What it does\n\n- **Cost analysis** — fully local, no LLM calls, no network. Tokenizers + pricing + arithmetic on your machine.\n- **Quality visibility** (`--measure`, optional) — samples your traffic through candidate models using *your own* API keys, sent directly to your own providers. Never to us. `--measure` needs `pip install 'frugon[measure]'` and a provider API key (`OPENAI_API_KEY`, etc.); calls go to your own provider, never to us. On `--demo`, sampling is pinned to a single OpenAI model so the try-out needs only `OPENAI_API_KEY`; on your own logs, `--measure` samples the actual recommendation.\n- **Routing recommendation** — \"move these X% of calls to a cheaper model and save ~$Y\u002Fmo; keep the hard Z% where they are.\" Comes with an explicit quality caveat so you know what you're trading.\n  Run `frugon models` to see the model names available for `--candidates` (optionally `frugon models gpt-4o` to filter by substring).\n- **Share the result** — add `--report savings.html` (or `.md`) to write a clean, shareable report you can drop into a PR, a Slack thread, or a budget review.\n- **Fast on real logs** — everything runs locally and is comfortable well past 100k records. The bundled ~56,100-call demo (`frugon analyze --demo`) prices in a few seconds. Very large logs (>200k records) may take a little longer; Frugon shows a live progress bar and a one-line heads-up so you can see it working. There's no hard limit.\n\n## Example output\n\n```\n$ frugon analyze --demo --candidates claude-sonnet-4-5,gpt-4.1,claude-haiku-4-5,gemini-2.5-flash,deepseek-v4-flash\n\n┌─ frugon · cost analysis ────────────────────────────────────────────────────┐\n│                                                                             │\n│   Analyzed      56,100 calls  ·  baseline gpt-5.5 (your current model)      │\n│   Current spend $549.46 \u002F mo                                                │\n│                                                                             │\n│     Route  36,100 easy calls (64.4%)  →  deepseek-v4-flash   within         │\n│   tolerance                                                                 │\n│     Keep   10,000 hard calls (17.8%)  →  gpt-5.5                            │\n│     Keep   10,000 already on deepseek-v4-flash (17.8%)   already optimal    │\n│   — no action                                                               │\n│                                                                             │\n│   New spend     $343.91 \u002F mo                                                │\n│                                                                             │\n│   SAVING        $205.55 \u002F mo    ·    37.4% lower                            │\n│                                                                             │\n└─────────────────────────────────────────────────────────────────────────────┘\n                                                                               \n  Candidates considered                                                        \n  claude-sonnet-4-5  $452.23 \u002F mo  17.7% lower  Strong   considered            \n  gpt-4.1            $405.89 \u002F mo  26.1% lower  Capable  considered            \n  claude-haiku-4-5   $377.82 \u002F mo  31.2% lower  Capable  considered            \n  gemini-2.5-flash   $356.35 \u002F mo  35.1% lower  Strong   considered            \n  deepseek-v4-flash  $343.91 \u002F mo  37.4% lower  Strong   recommended           \n  Each candidate is shown under the same quality-preserving split (easy calls  \n  to the candidate, hard calls kept on baseline); the biggest saving is the    \n  headline recommendation, and when savings tie at the precision shown the    \n  higher quality tier wins. Run --measure --judge to score each candidate's    \n  quality.                                                                     \n\n  Accounting   36,100 routed + 10,000 kept (gpt-5.5) + 10,000 already on \n               cheaper deepseek-v4-flash  =  56,100 analyzed\n  Upper bound  a full swap to deepseek-v4-flash saves ~98.1% — run with \n               --verbose for detail\n  Quality tier gpt-5.5: Elite  →  deepseek-v4-flash: Strong   (LMArena)\n  Prices       synced 2026-07-02\n  Quality      synced 2026-07-02\n\n⚠ Quality is not verified — 'within tolerance' is an offline estimate;\n  run --measure to confirm it on your real outputs before you switch.\n\n  Your data never leaves your machine. Your keys go to your own providers.\n→ Route every call automatically and hold the savings:  https:\u002F\u002Ffrugon.rodiun.io\n\nRecommendations use a curated set of current top models across providers, drawn\nfrom OpenRouter usage rankings. Prices synced 2026-07-02 from the LiteLLM \nregistry. Run `frugon update` for the full live roster.\nThis is bundled sample data — run `frugon analyze \u003Cyour-logs>` for a \nrecommendation on your own logs.\n```\n\nYour numbers depend on your logs and your locally synced pricing\u002Fquality data.\nRun `frugon analyze --demo --candidates claude-sonnet-4-5,gpt-4.1,claude-haiku-4-5,gemini-2.5-flash,deepseek-v4-flash`\nto see the same output on your machine.\n\nQuality tiers for reasoning models reflect the model at its default\u002Ftypical\nreasoning effort — effort changes how many tokens a call spends thinking, not\nits per-token rate, so it never affects the price shown above.\n\n## How it's different\n\nA provider's billing dashboard tells you what you *already* spent, and a raw\ntoken counter prices a single call — Frugon prices *your real logs* against\nevery model, locally, and tells you which calls to move and which to keep.\n\n## Realistic savings\n\nBased on [RouteLLM](https:\u002F\u002Fgithub.com\u002Flm-sys\u002FRouteLLM)'s published research (LMSYS):\n\n| Traffic mix | Typical saving |\n|---|---|\n| General mixed workload | 30 – 50% |\n| Easy \u002F repetitive (high MT-Bench similarity) | up to ~85% |\n| Hard reasoning \u002F MMLU-heavy | ~30% |\n\n**Your actual number comes from your logs.** Frugon never inflates — it shows what the math says for your data.\n\n## Is this you?\n\n- **Agent builders** — your GPT-4o agents are expensive; most easy hops don't need them.\n- **AI dev teams** — monthly LLM bill is real; routing pays for itself in days.\n- **RAG & support** — retrieval + rerank is cheap; the final answer call doesn't have to be Opus.\n- **Data-ETL pipelines** — batch extraction is 100% repeatable; mini models handle it fine.\n- **Indie hackers** — every dollar saved is a dollar of runway.\n\n## Keep the savings\n\nThis is a one-time snapshot. Want it to keep routing automatically and hold the savings? → [frugon.rodiun.io](https:\u002F\u002Ffrugon.rodiun.io)\n\nStar the repo if this saved you money.\n\n## Contributing\n\nBug reports and pull requests are welcome — see [CONTRIBUTING.md](CONTRIBUTING.md).\nFrugon is deliberately small: six commands (`analyze`, `capture`, `models`,\n`update`, `pricing`, `quality`), three capabilities (cost analysis, quality visibility,\nrouting recommendation). Gateways, live routing proxies, web UIs, and\nmulti-tenant accounts are out of scope by design.\n\n---\n\nBuilt by [Rodiun](https:\u002F\u002Frodiun.io). MIT licensed.\n","Frugon 是一款免费、本地化、开源的大语言模型（LLM）成本分析工具，用于在用户本地机器上精确识别和量化 LLM 调用中的费用浪费点。它支持解析 OpenAI\u002FAnthropic 格式的 JSONL 日志文件，提供模型替换建议、路由优化方案及真实调用采样（需用户自有 API 密钥），全程离线运行，不上传数据或密钥。核心特点包括轻量 CLI 工具链、HTTP 代理捕获 shim、多平台兼容性（macOS\u002FLinux\u002FWindows）及 FinOps 风格的成本归因分析。适用于关注 LLM 运维成本的开发者、AI 工程师及技术团队，在模型选型评估、SaaS 应用成本审计、LLMops 成本治理等场景中提供可落地的优化依据。",2,"2026-07-10 02:30:25","CREATED_QUERY"]