Communitygithub.com

推理成本审计

审计代码库中被伪装成LLM调用的分类请求,并生成一个带成本评估的系统一模型替换计划。当需要降低AI推理成本或延迟、为客户进行性能评估、审查感觉缓慢的代理循环,或被问及“我们在哪里可以用Jev”时使用。输出一个包含实测延迟和成本差异的候选排名表。

推理成本审计 是什么?

此技能旨在系统性地审计生产级代码库,识别那些本质上执行分类任务(例如输出标签、分数、是/否答案、路由)但却支付了完整自回归生成成本的LLM调用。它首先通过搜索已知的LLM API调用模式并分析代码上下文来筛选候选调用,识别满足严格条件的调用:提示词要求有限且已知的答案集(≤255个选项),调用方解析响应(如JSON.parse、正则表达式、枚举查找),输出不直接展示给用户,并且调用频繁。然后,技能要求通过实际测量(而不是估算)当前调用的每日次数、分位数延迟和令牌消耗来量化当前成本。接着,它引导使用来自真实流量的标注数据集对候选调用进行基准测试,以评估替换为更便宜/更快的System One模型(如Jev或Von)的可行性,并提供参照数据(如Jev托管模型延迟399ms,成本$0.023/千次调用)。最后,通过一个考虑节省金额、延迟影响(尤其是有用户等待的路径)、错误影响范围和标注集准确度差异的加权排序系统,生成一个包含成本节省、延迟改进、准确度变化和推荐行动的候选排名表。该技能支持Claude Code、Cursor和其他基于LLM的编码工具,并与`jev-eval`和`jev-integrate`等工具集成,以提供准确度测量和更换工作流。

兼容平台✓Claude Code✓Codex CLI~Cursor
npx skills add https://github.com/OneWave-AI/claude-skills/tree/HEAD/jev-audit

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

推理成本审计 是做什么的?

大多数生产环境中的LLM调用实际上返回的是标签,而不是文本——例如一个路由、分数、是/否、或类别。这些调用为它们并未使用的自回归生成能力付费。本审计旨在找出这些调用并评估替换成本。

交付物:一个包含实测差异的候选排名表。可作为OneWave的可销售服务内容;与marketing-brain形式相同——每个客户可重复执行的审计流程。

1. 寻找候选调用

搜索LLM调用,然后筛选出那些输出为标签的调用:

grep -rnE "messages\.create|chat\.completions|generateText|\.invoke\(|anthropic\.|openai\." \
  --include=*.{ts,tsx,js,py} . | grep -v node_modules

当所有以下条件成立时,该调用即为候选:

  • 提示词要求从一个已知的、有限的答案集中选择(≤255个)
  • 调用方解析响应——JSON.parse、正则表达式、枚举查找、.trim()
  • 下游没有任何地方向人类展示模型的推理过程
  • 该调用经常执行,或者用户正在等待它

提示词文本中的强烈信号:"respond with only", "return JSON", "classify", "choose one of", "rate from 1 to", "answer yes or no", "do not explain"。

排除条件:输出向用户展示、被用作内容、需要引用或解释、或者答案集是开放式的。

2. 衡量当前成本

不要估算。进行测量:

  • 每日调用次数 —— 来自日志或计数器,而不是猜测
  • p50和p95延迟 —— p95是用户实际感受到的
  • 每次调用的输入/输出令牌数 → 按提供商标价计算的当前每千次调用成本
  • 是否有任何操作被阻塞 —— 用户、页面渲染、代理的下一个步骤

3. 评估替换成本

使用来自该调用真实流量的标注数据集进行基准测试(参见jev-eval)。切勿使用供应商基准进行预测。

参考数据(基于真实记录测量,每个记录4个问题):

延迟成本/千次准确度
Jev托管399 毫秒$0.023在15条记录集上与Claude匹配
Von本地174 毫秒$0.00仅在编写良好的标准下匹配
Claude Haiku 4.52,322 毫秒~$0.55基准线

Jev定价:$0.042/百万输入令牌,输出免费。

4. 按回报排序,而非按难度

对每个候选进行排序:

  1. 调用量 × 单位节省 —— 实际美元金额
  2. 是否有用户等待 —— 在面向用户的路径上,延迟改进比成本节省更有价值
  3. 出错的影响范围 —— 路由错误的支持工单代价小;评分错误的交易则不然
  4. 标注集上的准确度差异 —— 任何低于持平准确度的方案都需要置信度门控,而门控本身也有成本

排除调用量低的候选。每天几百次调用的节省几乎为零,而且你还增加了供应商。

5. 撰写报告

每个候选:文件和行号、决定内容、每日调用次数、当前延迟和成本、预计延迟和成本、实测准确度差异、推荐的门控机制,以及一个通过/不通过及原因。

报告开头应总结预计的月度总节省和最大的单点延迟改进。

始终包含限制:评估集大小、Jev为早期访问且无SLA、必须保留对现有调用的回退机制。

在OneWave栈中的适用场景

  • Sage小组件路由 —— 应当构建。访问者在等待;400毫秒 vs 2.3秒是天壤之别。
  • RB2B访问者数据流 —— 应当构建。唯一具有数据量的流,24倍成本节省效果显著。
  • 线索摄入分类 —— 先测量。虽然正确,但每天只有少量线索。
  • 线索看门狗 —— 保留原样。夜间定时任务,无需等待。

相关内容

jev-eval生成此审计所需的准确度数据。jev-integrate是为通过审计的替换项提供集成工作流的工具。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

OneWave-AI/claude-skills

Deploy a 2-layer parallel agent hierarchy for large, parallelizable work — big refactors, multi-file migrations, codebase-wide audits, bulk generation. A top-tier commander (Fable or Opus) orchestrates the swarms; the user picks a power level (Max Power / Heavy / Balanced / Economy) that sets the Opus/Sonnet/Haiku model mix per layer. Layer 1 is 3-50+ specialist agents, each with its own full context window; Layer 2 is 2+ sub-agents per member. Includes git safety, tiered sizing, a pre-deploy gate, phantom-completion checks, and multi-wave follow-up.

OneWave-AI/claude-skills

Generate animated videos and motion graphics from natural language descriptions. Creates a standalone Vite + React project with Framer Motion scenes that auto-play in the browser. Use when the user wants to create animations, motion graphics, video intros, animated presentations, or product demos.

OneWave-AI/claude-skills

Use before starting a product, feature, MVP, agent, automation, or integration build to identify the main pre-build risk and choose the smallest validation step. Trigger when the user asks whether to build, scope, validate, prioritize, or sanity-check an idea before implementation.

OneWave-AI/claude-skills

Post-mortem analysis when a client churns. Takes client history, engagement data, support tickets, usage logs, and exit feedback to produce a comprehensive churn autopsy with root cause classification, timeline of decline, and preventive measures.

OneWave-AI/claude-skills

Compose a premium, animated landing page section by section in Next.js + Tailwind + Motion (Framer Motion) — built on a real design system, with editorial copy and motion that feels human-crafted, not template-generated. Use when building or rebuilding a landing page, marketing site, or hero/feature/pricing/CTA sections that need to look production-ready and bespoke from day one.

OneWave-AI/claude-skills

Assemble 2-3 complementary experts to collaboratively analyze anything. Experts work together to explore topics from multiple expert angles.

OneWave-AI/claude-skills

Convert any topic into playable browser games. Types: trivia, matching, word puzzles, adventure games. Uses Phaser.js or Kaboom.js.

OneWave-AI/claude-skills

Turn a marketing brief or product offer into a finished short-form video ad built in HyperFrames — hook, script, shot-by-shot storyboard, scene-by-scene HTML composition, captions, and voiceover. Outputs platform cuts (vertical 9:16, square, 16:9). Use when you need a launch ad, product promo, social video, or paid-creative concept ready to render.

OneWave-AI/claude-skills

Turn a website URL, product docs, or a founder's rambling description into a tight 60-90 second explainer video built in HyperFrames -- problem/solution narrative, animated product walkthrough scenes, captions, and voiceover, ready for the homepage hero, sales emails, and onboarding.

OneWave-AI/claude-skills

Build promo videos for local businesses in HyperFrames -- the new-menu drop, the seasonal offer, the event announcement, the "we're hiring" post, the Google Business Profile clip. Restaurant, salon, gym, trades: 15-30 seconds, brand-clean, captioned, sized for Instagram, Facebook, and the profile.

OneWave-AI/claude-skills

Build a personalized product-demo or sales-walkthrough video in HyperFrames for a specific prospect or account — narrated screen-by-screen, branded to them, ending in a clear next step. Turns a generic demo into a "this was made for me" asset for outbound, follow-up, or deal acceleration. Use when you want to send a tailored video instead of booking another live call.

OneWave-AI/claude-skills

Turn real customer reviews, quotes, and case-study results into polished social-proof videos built in HyperFrames -- single-testimonial spotlights, review-wall montages, and stat-driven proof reels with captions and voiceover, cut for vertical, square, and wide. The highest-converting content most businesses never make.

OneWave-AI/claude-skills

Build and run a labelled eval set for a System One model (Jev, Von, or any typed-decision config), then sweep criteria wordings and thresholds against it. Use when a Jev/Von classification is wrong or unreliable, when choosing between the hosted API and a local open model, when tuning noul thresholds, or before shipping any typed-decision feature. Produces an accuracy-by-wording matrix and a calibrated threshold.

OneWave-AI/claude-skills

Wire a System One model (Jev, or an open reproduction like Von) into a product feature — routing, guardrails, scoring, classification. Use when replacing an LLM call that returns a label rather than prose, when adding a typed decision to an agent loop, or when deciding between the hosted Jev API and a local open model. Covers question design, the eval-set-first workflow, threshold calibration, confidence gates, and the traps measured on real data.

OneWave-AI/claude-skills

Optimize landing pages for conversions, performance, and SEO. Use when improving landing pages, increasing conversions, or optimizing page performance.

OneWave-AI/claude-skills

TAM/SAM/SOM calculator with deep market research. Produces comprehensive market-sizing.md with top-down and bottom-up estimates, methodology, data sources, assumptions, sensitivity ranges, growth projections, competitive landscape, and Mermaid visualizations. Use when user needs market size estimates, addressable market analysis, go-to-market sizing, investor-ready market analysis, or business plan market validation.

OneWave-AI/claude-skills

Generate unique personalized first lines for hundreds of prospects using company news, LinkedIn activity, and mutual connections. Saves 10+ hours of manual research per campaign. Use when you need personalized outreach at volume.

OneWave-AI/claude-skills

Review investment portfolios for risk, diversification, fees. Asset allocation recommendations, tax-loss harvesting, rebalancing.

OneWave-AI/claude-skills

Create multiple choice, true/false, fill-in-blank, matching quizzes. Auto-generate plausible distractors. Instant grading with explanations.

OneWave-AI/claude-skills

Enhanced skill navigator that maps conversation history, recommends multi-skill chains, identifies patterns from past usage, and learns from session outcomes. Goes beyond basic scout with deep context analysis and workflow orchestration.

相关技能