跳到正文
DEV Community· woodori1234-max·· 39 分鐘前AI 評分59

TokenLedger 推出 MIT 開源 LLM FinOps 工作室,提供 14 個計算器並涵蓋 24 個模型

I built TokenLedger: a 100% browser-private LLM FinOps studio (14 tools, 24 models, MIT)

AI 導讀

作者推出開源工具 TokenLedger,這款完全在瀏覽器端運行的 LLM FinOps 工作室提供 14 個互動計算器,涵蓋 24 個模型。它可估算多輪 Agent 成本、MCP 與 Function Calling schema 開銷、GPU VRAM 與 KV-cache 用量、自託管 GPU 與雲端 API 的損益平衡,並比較微調、RAG 和快取成本。

正文

woodori1234-max

Every time I tried to estimate production LLM costs, existing calculators had two problems:

  1. They only multiplied single-prompt token rates—ignoring the real architectural traps that blow up AI bills (multi-turn agent O(N²) context snowballing, MCP tool-schema tax, prompt caching hit rates, KV-cache VRAM overhead).
  2. They asked me to paste prompts or tool schemas into a web app backed by a server.

So I built TokenLedger — a 100% browser-private, zero-upload, MIT open-source AI & LLM FinOps Studio covering 24 flagship models across 14 interactive calculators.


What's Inside (14 Browser-Local Workspaces)

  1. 24-Model Live API Cost Estimator — OpenAI (GPT-5, GPT-4.1, o3, o4-mini), Anthropic (Claude Opus 4, Sonnet 4, Haiku 3.5), Google (Gemini 2.5 Pro/Flash/Flash-Lite), DeepSeek (V3, R1), xAI (Grok 3), Meta (Llama 4), Mistral, Qwen, and Perplexity with prompt caching (0–95%), 50% async batch discounts, 70/30 model cascade routing, 5-currency live switcher (USD/EUR/GBP/JPY/KRW), Ctrl+K palette, and Markdown/CSV/PNG exports.
  2. Multi-Turn Agent Burn Simulator — Models quadratic O(N²) context accumulation in ReAct/tool-calling loops vs. prefix prompt caching and sliding-window summarization turn by turn.
  3. MCP & Function-Calling Schema Tax Auditor — Paste your JSON tool definitions locally to rank the heaviest schemas and quantify Prompt Caching vs. Lazy Tool Deferral savings.
  4. GPU VRAM & KV-Cache Quantization Calculator — Models Q4/FP8/FP16 weights + FP8 KV-cache halving across Llama 3.3 70B, DeepSeek-R1, Qwen 32B, and Mistral on 4090 / L40S / A100 / H100.
  5. Self-Hosted GPU vs. Cloud API Break-Even — Finds the exact daily request volume where renting vLLM GPUs + DevOps overhead beats cloud APIs.
  6. Fine-Tuning vs. RAG vs. Caching 12-Month TCO — Compares LoRA training refreshes, vector DB RAG synthesis, and long-context prompt caching with ADR export.
  7. CFO Hybrid Waterfall — Stacks caching + frontier-to-mini cascade + 50% batch tiers into an executive annual savings breakdown.
  8. LLM Rate-Limit (RPM/TPM) Capacity Planner — Calculates burst peak TPM, Little's Law concurrency, required vendor tier, and exports token-bucket rate-limiter JSON.
  9. AI SaaS Gross Margin Simulator & AI Startup Runway Calculator — Models per-seat COGS, Stripe fees, power-user break-even caps, and 24-month cash runway.
  10. RAG & Vector DB TCO Planner & Voice/Vision Multimodal Studio — Sizes embeddings, HNSW RAM, OpenAI Realtime vs. Gemini Live audio, and image generation.
  11. Prompt A/B Cost Diff + GitHub Action CI Budget Guard — Compares prompt rewrites and exports a drop-in GitHub Action YAML to block token regressions in PRs.
  12. Context Window & JSON Schema Minifier Inspector — Estimates OpenAI/Claude/Gemini tokens locally and minifies bloated JSON schemas.

Zero-Dependency CLI & Open JSON API

Run estimates directly inside CI or Notion/GitHub RFC workflows:

node bin/tokenledger.js --in 2500 --out 600 --req 1000 --cache 50 --top 10 --format md

Or fetch the CORS-enabled pricing snapshot directly:

curl https://tokenledger-8x7.pages.dev/api/pricing.json

Everything is open-source (MIT) and runs entirely client-side with zero login walls. If there are specific pricing edge cases you hit in production (AWS Bedrock PTU, extended thinking tokens, multi-GPU tensor parallelism, etc.), drop a comment or open an issue on GitHub!

來源:DEV Community · dev.to