
Llmkit
io.github.smigolsmigol由 GitHub 账号 smigolsmigol 发布v0.4.10更新于 Oct 25, 2026
AI cost tracking: 11 tools for spend, budgets, and Claude Code + Cursor + Cline costs
概览
本地 MCP 服务器,让助手查看 AI 编程会话成本,并在配置 LLMKit 密钥后查询花费、预算、密钥与服务健康状态。
- 可以做什么
- 检查本地编程会话:读取受支持的 Claude Code 会话与 Cline 任务数据,了解代理成本,无需 LLMKit 密钥。查询网关花费与预算:配置密钥后通过 LLMKit 网关查看花费、预算状态和会话。检查密钥与服务健康:查询 API 密钥和网关服务状态。依据内置定价目录快照估算成本,而非提供商实时报价。
- 适用场景
- 适合让助手报告 Claude Code、Cursor 或 Cline 会话的成本,或针对已有 LLMKit 网关账户查看花费与预算状态。本地检查无需账户;网关查询需要已有密钥。
- 运行要求
- 通过 stdio 在本地运行,通常用 npx 从 npm 包启动,因此需要 Node.js。LLMKIT_API_KEY 环境变量可选,仅用于启用网关工具;本地工具无需它。LLMKIT_PROXY_URL 可覆盖默认托管代理地址。账户创建与密钥管理目前不可用,网关功能需已有密钥。
安装
在 SourceWeft 中
- 打开 控制台中的 Llmkit,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
Measure what your AI agents cost. Stop requests before they exceed a budget.
[CI] [PyPI] [npm] [OpenSSF Scorecard] [OpenSSF Best Practices] [MIT license]
Website | Docs | Pricing API | Architecture | Security | Assurance case
LLMKit is an open-source AI gateway and SDK suite for cost attribution, budget admission, and request evidence. The gateway reserves estimated spend before provider dispatch. It rejects requests that cannot fit the active budget, then settles admitted reservations to actual usage when the response completes.
The repository also ships local tracking surfaces that do not require an LLMKit account or proxy.
Choose a surface
Quick start
Local Python tracking
The transport reads provider usage metadata and estimates cost from the bundled pricing catalog. It does not send tracking data to LLMKit.
Zero-code CLI tracking
Use -v for per-request output or --json for machine-readable results.
Gateway mode (existing key)
Gateway examples require an existing LLMKit API key. Account creation and key management are temporarily unavailable while the authenticated service is restored. If you do not already have a key, use one of the local tracking paths above.
The budget path
The control path is built around three boundaries:
- Atomic admission: a Durable Object owns reservation state for each budget scope. Concurrent requests cannot spend the same remaining balance.
- Dispatch-aware idempotency: deterministic failures before dispatch release the key. After provider dispatch may have occurred, failures remain terminal to avoid duplicate spend.
- Bounded responses: non-streaming bodies and individual SSE frames have explicit byte limits. LLMKit cancels upstream reads when a limit is exceeded.
Request receipts bind the admission decision, provider attempt, settlement, and analytics handoff with stable identifiers. Database writes use an outbox, so an analytics outage does not silently erase budget evidence.
MCP server
Five local tools inspect supported Claude Code sessions and Cline task data without an LLMKit key.
Six gateway tools query spend, budgets, keys, sessions, and service health when LLMKIT_API_KEY
contains an existing key. Together they expose 11 tools.
Pricing data
The pinned catalog is a bundled reference snapshot, not a live quote. One source file,
packages/shared/pricing.json, records the snapshot date and
generates the TypeScript, Python, and MCP tables. CI rejects drift between the source and generated
files. The public site renders only populated provider tables and displays the source date.
The public comparison endpoint requires no account:
The endpoint prices only the exact model keys supplied by the caller. It does not search for or recommend the cheapest model. Pricing is an estimate, not a provider invoice. Provider billing rules, model modality, and catalog freshness remain part of the error boundary.
Evidence and current boundary
See STAGING_PROOF.md for the isolated hosted proof contract. It deliberately refuses production targets and dirty worktrees.
Project policy and design
Development
Run the Worker locally with development-only bindings:
Generic deploy commands are intentionally omitted. Staging and production use separate guarded scripts with explicit target confirmation.
Security
Provider credentials are encrypted with AES-256-GCM using a random IV and owner/provider-bound additional authenticated data. LLMKit API keys are hashed before storage. CI includes secret scanning, static analysis, dependency review, CodeQL, and package provenance checks.
Read the security policy and architecture and the machine-readable
Security Insights snapshot. Please report vulnerabilities through
GitHub private vulnerability reporting
or email [email protected].
License
来源:README.md,提交 fc92e59
工具
0版本历史
1- v0.4.10最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分