设计与多媒体

Llm Usage Aggregator

试用

LLM使用流水数据汇总工具。将LLM调用日志CSV文件按Provider、Model、用户维度进行汇总统计,输出多Sheet Excel报表,并基于pricing_config.json计算成本。适用场景:(1) 用户提供LLM流水CSV文件需要汇总分析;(2) 需要区分内部/外部用户使用情况;(3) 需要统计p...

它能做什么

LLM使用流水数据汇总工具。将LLM调用日志CSV文件按Provider、Model、用户维度进行汇总统计,输出多Sheet Excel报表,并基于pricing_config.json计算成本。适用场景:(1) 用户提供LLM流水CSV文件需要汇总分析;(2) 需要区分内部/外部用户使用情况;(3) 需要统计prompt_tokens、completion_tokens、generated_image_count、duration_seconds等指标;(4) 需要计算各维度成本费用。

技能文档

LLM Usage Aggregator

快速使用

运行脚本处理CSV文件:

python scripts/aggregate_llm_usage.py  [output_path] [pricing_config_path]

处理逻辑

用户标识合并

  • 优先使用 email 字段作为用户标识
  • email 为空,则使用 phone 字段

内部/外部用户判定

  • 内部用户:email包含 footprintmaybefastest(不区分大小写)
  • 外部用户:其他所有用户

成本计算逻辑

基于 references/pricing_config.json 中的模型定价配置,优先按 model_type 计算:

model_type计价方式公式
图片按张计价price_per_request × generated_image_count(若generated_image_count为空或为0则默认1)
视频按秒计价根据generate_audio判断有声/无声选择单价,再 × duration_seconds(若duration_seconds为空或为0则默认5)
文本按token计价prompt_tokens / 1,000,000 × prompt_price + completion_tokens / 1,000,000 × completion_price

补充说明:

  • model_typepricing_config.json 中每个模型的配置决定,值为 图片视频文本
  • generation_type 仍保留在原始流水中,用于辅助识别图片/视频调用场景,但文本模型是否按 token 计价以 model_type=文本 为准
  • model_aliases 用于将原始 llm_model 归一化到统一简称后再计价和汇总

校验机制

运行时自动执行以下校验,异常信息输出到终端:

校验项说明
模型未配置llm_model 不在 pricing_config.json 中,列出模型名及影响行数
llm_model为空原始数据中模型名为空,无法计价
pricing_type不匹配图片/视频 需要 per_request文本 需要 per_million_tokens
配置字段缺失视频缺audio_price对应key、文本计价缺prompt_price/completion_price等
未识别的model_type配置中的 model_type 不属于 图片/视频/文本
token计价行成本为0model_type=文本 的行应逐行有token计价,成本为0属异常,按模型汇总输出

视频类型有声/无声判断

  • generate_audioTrue → 有声,使用 audio_price.with_audio
  • generate_audioFalse 或空值 → 无声,使用 audio_price.without_audio
  • 若模型配置无 audio_price 字段,则使用 price_per_request

汇总维度

输出Excel为单Sheet(汇总报表),4个区块由上至下排列,每个区块末尾有合计行

顺序区块标题汇总维度
1按内外部用户内部用户/外部用户
2按模型平台llm_provider
3按模型llm_model
4按用户email/phone合并后的用户标识

汇总字段

  • prompt_tokens - 输入token数
  • completion_tokens - 输出token数
  • generated_image_count - 生成图片数
  • duration_seconds - 耗时秒数
  • 成本(USD) - 基于定价配置计算的成本
  • 记录数 - 调用次数

CSV文件要求

必需字段:

  • emailphone - 用户标识
  • llm_provider - LLM提供商
  • llm_model - 模型名称

可选字段:

  • prompt_tokenscompletion_tokensgenerated_image_countduration_seconds
  • generation_type - 生成类型(image/video/空)
  • generate_audio - 是否生成音频(布尔值,视频类型使用)

参考文件

  • references/pricing_config.json — 定价配置(与llm-cost-aggregator共用)

新增模型(本次更新)

模型类型定价说明
kling-video/v3/standard/image-to-video视频720p无声$0.08/秒,720p有声$0.13/秒可灵v3标准版
z-ai/glm-5v-turbo文本$1.13/M token in, $4.00/M token outOpenRouter
doubao-seedance-2.0-fast视频$6.968/M tokentokenhot
doubao-seedance-2.0视频$8.658/M tokentokenhot
fal-ai/kling-video/o1/reference-to-video视频$0.11/秒可灵o1
fal-ai/kling-video/o3/pro/reference-to-video视频无声$0.11/秒,有声$0.14/秒可灵o3 pro
fal-ai/kling-video/o3/standard/reference-to-video视频无声$0.08/秒,有声$0.11/秒可灵o3标准

相关技能

面向团队与企业用户的 llm-provider API 全功能管理工具。核心能力: - 涵盖免费版全部能力(对话补全、图像生成、助手管理) - 批量任务(Batch API)大规模异步处理 - 模型微调(Fine-tuning)定制化训练 - 评估(Evaluations)质量度量与回归测试 - 向量存储(Vector Stores)高级检索与 RAG - 视频生成与异步任务管理 - 容器(Containers)隔离执行环境 - 审计日志与团队权限管理 适用场景: - 企业级内容生产与自动化流水线 - ...

Use this skill whenever a user wants to evaluate whether an existing offline / reusable workflow is worth converting into an LLM-driven workflow. Triggers on...

大模型 Token 成本节约工具。在请求到达大模型之前自动压缩 prompt 和上下文,减少 60-95% 的 token 消耗,直接降低 API 成本。支持 Claude/OpenAI/Gemini 等主流模型,提供代理模式、CLI 包装、Python SDK 和 MCP Server 四种接入方式。内置一键安...

AI 应用可观测性与生产监控实操手册——AI 进生产后的"仪表盘与探照灯":可观测性全景(三大支柱:日志/指标/追踪 + AI 特有观测对象)、调用追踪与日志规范(LLM 调用追踪、Span 设计、会话级追踪、敏感信息过滤)、质量监控指标(幻觉率/拒答率/满意度/转人工率实时看板)、性能与成本监控(延迟/吞吐/Token 成本实时追踪)、护栏与安全监控(护栏命中率/注入检测/敏感数据泄漏监控)、告警体系(分级告警/阈值设计/通知路由/告警疲劳治理)、监控平台与落地(埋点规范/工具选型/灰度期监控)。附零依赖本地工具一键出三大支柱清单、监控指标表、告警设计、追踪规范与落地路线。面向 AI 平台、SRE、运维与质量负责人——与 LLM 评测(离线质量)互补,本技能管线上运行质量。

Verify an LLM API endpoint — model authenticity, billing inflation, relay provenance, performance and silent downgrades. Use when the user asks whether the model they are paying for is genuine, whether a relay or proxy is trustworthy, whether they are being overcharged, or whether a model has been quietly downgraded. 检测 LLM API 端点的真伪、计费掺水、中转来源、性能与降智;当用户问"我用的模型是不是真的"、"这个中转站靠谱吗"、"是不是被降智了"、"计费对不对"时使用。

1 次安装

离线可视化 WorkBuddy 本机使用数据,以 token 消耗为主指标、credit 为本地估算,涵盖思考效率、模型分布与性价比、日期区间筛选、错误监控、用量高峰探查,生成本地使用信息看板。仅当用户**明确**想查看、生成或导出**自己 WorkBuddy 本机/本账号**的使用状态 / 使用统计 / 工作信息看板时调用;不用于其他产品或系统的用量统计,也不为任意数据生成通用看板。纯本地、默认零外网依赖、可搬运;可选 --credit-xlsx 用用量导出精确覆盖 credit,或可选 --billing-token-file(用户手动导出 token,opt-in)调用官方用量 API 拉取精确 credit。 EN: Offline dashboard for WorkBuddy local usage analytics, with token as primary metric and credit as local estimate, covering thinking efficiency, model distribution & cost-performance, date-range filtering, error monitoring, usage-spike inspection. Triggers only when the user explicitly wants to view, generate, or export their own WorkBuddy local/account usage status / stats / activity dashboard; not for other products' usage analytics, nor for building generic dashboards from arbitrary data. Fully local, default zero-network; optionally --billing-token-file (user-supplied token, opt-in) calls the official usage API for precise credit, or --credit-xlsx overrides credit with pr

3 次安装