AI Skill Hub 强烈推荐:ComputeCFO 是一款优质的AI工具。AI 综合评分 8.0 分,在同类工具中表现稳健。如果你正在寻找可靠的AI工具解决方案,这是一个值得深入了解的选择。
AI金融官员,跟踪、分析和优化LLM API
ComputeCFO 是一款基于 Python 开发的开源工具,专注于 AI、金融、LLM 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。
AI金融官员,跟踪、分析和优化LLM API
ComputeCFO 是一款基于 Python 开发的开源工具,专注于 AI、金融、LLM 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。
# 方式一:pip 安装(推荐)
pip install computecfo
# 方式二:虚拟环境安装(推荐生产环境)
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install computecfo
# 方式三:从源码安装(获取最新功能)
git clone https://github.com/SilentFleetKK/computecfo
cd computecfo
pip install -e .
# 验证安装
python -c "import computecfo; print('安装成功')"
# 命令行使用
computecfo --help
# 基本用法
computecfo input_file -o output_file
# Python 代码中调用
import computecfo
# 示例
result = computecfo.process("input")
print(result)
# computecfo 配置文件示例(config.yml) app: name: "computecfo" debug: false log_level: "INFO" # 运行时指定配置文件 computecfo --config config.yml # 或通过环境变量配置 export COMPUTECFO_API_KEY="your-key" export COMPUTECFO_OUTPUT_DIR="./output"
Stop guessing your AI costs. Start managing them like a CFO.
ComputeCFO is an AI Financial Officer Agent that tracks, analyzes, and optimizes your LLM API spending. It works both as a standalone dashboard and as a Python library you can integrate into any project. Inspired by Graham's value investing, Pacioli's double-entry bookkeeping, and Alphabet's independent accounting model.
ComputeCFO's core uses only Python standard library + SQLite. No external packages required.
Optional: Install fastapi + uvicorn for the dashboard and API server.
See examples/quickstart.py for a complete walkthrough covering all features.
```bash pip install computecfo fastapi uvicorn python -m computecfo.server # or: python server.py
pip install computecfo
```python from computecfo import CostTracker
tracker = CostTracker()
tracker.record("claude-sonnet-4-20250514", input_tokens=1500, output_tokens=500, module="chatbot", action="respond", project="my-saas")
check = budget.pre_call_check("claude-opus-4-20250514") if check["approved"]: model = check["model"] # might be downgraded to sonnet! else: print(f"Blocked: {check['reason']}") ```
Three protection levels: <div class="rdm-tbl-wrap"><table class="rdm-tbl"><thead><tr><th>Level</th><th>Trigger</th><th>Action</th></tr></thead><tbody><tr><td>Warning</td><td>80% of budget</td><td>Log warning</td></tr><tr><td>Critical</td><td>100% of budget</td><td>Auto-downgrade model</td></tr><tr><td>Circuit Break</td><td>150% of budget</td><td>Block all API calls</td></tr></tbody></table></div>
```python from fastapi import FastAPI from computecfo import CostTracker from computecfo.api import create_router
app = FastAPI() tracker = CostTracker() app.include_router(create_router(tracker), prefix="/api/cost")
```
| Provider | Models | Auto-Pricing |
|---|---|---|
| **Anthropic** | Claude Opus 4, Sonnet 4, Haiku 3.5 | ✅ |
| **OpenAI** | GPT-4o, GPT-4o-mini, GPT-4.1, o3-mini | ✅ |
| **Google** | Gemini 2.5 Pro, Gemini 2.5 Flash | ✅ |
| **DeepSeek** | DeepSeek V3, DeepSeek R1 | ✅ |
| **Custom** | Any model — add your own pricing | ✅ |
Add custom models:
from computecfo.models import MODEL_PRICING
MODEL_PRICING["my-custom-model"] = {"input": 2.0, "output": 8.0, "provider": "custom"}
ComputeCFO 是您的 AI 财务官 Agent,旨在终结对 AI 使用成本的盲目猜测。受格雷厄姆价值投资理论、帕西奥利复式记账法以及 Alphabet 独立核算模型的启发,ComputeCFO 能够实时追踪、分析并优化您的 LLM API 开销。它既可以作为独立的 Dashboard 使用,也可以作为 Python library 集成到任何现有项目中,让您像 CFO 一样专业地管理 AI 成本。
ComputeCFO 提供全方位的 AI ���本管理功能。它不仅能精确记录各类 LLM API 的调用详情,还能通过内置的预算保护机制防止成本失控。通过直观的仪表盘,开发者可以实时监控不同项目、模块的支出情况,并利用智能预警系统在预算触达阈值时及时介入,实现从被动记录到主动优化的转变。
ComputeCFO 的核心设计遵循“零依赖”原则,仅使用 Python 标准库和 SQLite,确保了极高的轻量化与稳定性。若需运行 Dashboard 仪表盘或 API server,则需要额外安装 `fastapi` 和 `uvicorn`。这种设计既适合作为轻量级工具嵌入,也适合构建复杂的监控服务。
您可以根据需求选择两种使用模式:首先是快速上手模式,通过运行 `examples/quickstart.py` 即可完整体验所有功能;其次是集成模式,通过 `pip install computecfo` 将其作为 Python library 引入项目。无论是记录 API 调用还是进行预算预检,都能通过简单的代码实现自动化管理。
ComputeCFO 支持两种运行配置:Option 1 为独立 Dashboard 模式,通过 `pip install computecfo fastapi uvicorn` 安装后,使用 `python -m computecfo.server` 即可启动可视化管理界面;Option 2 为 Python Library 模式,直接在代���中实例化 `CostTracker` 进行精细化成本追踪与预算控制。
ComputeCFO 提供了强大的 API 接口能力。开发者可以在调用 Claude、OpenAI 或 Gemini 等模型后,使用 `tracker.record` 方法记录 Token 使用量及项目元数据。此外,系统内置了三级预算保护机制(Warning/Block 等),并支持通过 `create_router` 轻松集成到 FastAPI 应用中,实现自动化的成本拦截与预警。
ComputeCFO 支持广泛的模型生态,包括 Anthropic (Claude 系列)、OpenAI (GPT 系列)、Google (Gemini 系列) 以及 DeepSeek (V3/R1) 等主流供应商。系统具备 Auto-Pricing 功能,能够自动识别并匹配各模型的计费标准,通过内置的预算检查逻辑(pre_call_check),在 API 调用前自动判断是否允许执行或需要降级模型,确保成本始终处于受控状态。
ComputeCFO是一个有用的AI工具,帮助优化LLM API使用
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ MIT 协议 — 最宽松的开源协议之一,可自由商用、修改、分发,仅需保留版权声明。
总体来看,ComputeCFO 是一款质量优秀的AI工具,在同类工具中具备一定竞争力。AI Skill Hub 将持续追踪其更新动态,建议收藏备用,结合自身场景选择合适时机引入使用。
| 原始名称 | computecfo |
| 原始描述 | 开源AI工具:🏦 ComputeCFO — Your AI Financial Officer. Track, analyze, and optimize LLM API 。⭐22 · Python |
| Topics | AI金融LLM |
| GitHub | https://github.com/SilentFleetKK/computecfo |
| License | MIT |
| 语言 | Python |
收录时间:2026-07-09 · 更新时间:2026-07-11 · License:MIT · AI Skill Hub 不对第三方内容的准确性作法律背书。