feat(app): profit estimator per chip-hour and per gigawatt, TCO Calculator and Fleet Lifecycle to footer / 每芯片小时与每吉瓦利润估算器,TCO 计算器与集群生命周期移至页脚 - #993
Merged
Conversation
Adds a dashboard page that turns each SKU's throughput at a chosen interactivity into US$ per all-in GW per year and splits it into compute expense (TCO), the model lab's cut of gross margin, and what is left for the operator. Inputs: target interactivity (default 45 tok/s/user), utilization (default 60%, scales revenue only), lab cut (default 30% of positive gross margin), cost provider, and token price (OpenRouter or a custom $/M pair). The SKU legend filters which bars are drawn; a loss is drawn below zero as a hatched segment in the SKU's colour. Ships the /zh mirror, route/meta/nav wiring, docs, unit tests, and a Cypress spec. Also makes band x-axes in d3-chart honour `tickFormat`, which no existing chart relied on; it is needed here to map result keys to SKU labels. 中文:新增 /profit-estimator 页面,将各芯片在所选交互性下的吞吐换算为每全电源配置吉瓦每年的美元收入,并拆分为算力支出(TCO)、模型实验室从毛利中抽取的分成以及运营方所剩利润。输入项:目标交互性(默认 45 tok/s/user)、利用率(默认 60%,仅缩放收入)、实验室分成(默认为正毛利的 30%)、成本供应商与 Token 售价(OpenRouter 或自定义)。芯片图例用于筛选柱形;亏损以斜纹段绘制在零线以下。同时提供 /zh 镜像、路由与导航接线、文档、单元测试和 Cypress 用例,并让 d3-chart 的 band 型 x 轴支持 tickFormat。
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…e wording, vendor marks - /profit-estimator/<slug> and /zh mirror, Kimi K3 as the tab default and the only model in the route allow-list for now; other slugs 404, aliases 308 - Custom $/GPU/hr cost provider with one seeded input per base chip - Scenario and precision selectors removed (agentic only, precision auto) - "Model lab cut" renamed "Model License Fee (%)" in EN/ZH copy; code ids kept - Utilization shown in the ResultContext subtitle - Vendor logos beside each rotated x-axis label, upright, inverted in dark mode - Cypress spec now intercepts synthetic Kimi K3 agentic rows (cypress/support/profit-fixtures.ts); fixtures carry no agentic_traces 中文:利润估算器新增 /profit-estimator/<模型 slug> 路由(含 /zh 镜像),默认 Kimi K3 且目前仅开放该模型;新增自定义 $/GPU/hr 成本供应商;移除场景与精度 选择器;“实验室分成”改为“模型许可费(%)”;副标题显示利用率;x 轴标签旁 加入厂商标识;Cypress 改用合成的 Kimi K3 智能体数据。
…out an OpenRouter id TanStack Query v5 leaves a disabled query `isPending`, so a model with no OpenRouter listing sat on the loading copy forever. Check the id first and use `isLoading` for the in-flight state. 中文:修复无 OpenRouter 条目的模型一直显示“加载中”提示的问题;先判断模型 id,再用 isLoading 表示请求进行中。
…stack A loss bar draws TCO and the license fee above the axis; that sum can exceed both revenue and TCO, so the old max(revenue, tco) top clipped the fee segment. 中文:亏损柱在零线以上堆叠 TCO 与许可费,其和可能超过收入与 TCO, y 轴上限改为按该堆叠高度计算,避免裁切许可费段。
Lead each x label with the vendor's full-color mark and repeat it above the revenue figure; NVIDIA stays brand green, AMD's arrow inverts in dark mode. Drop the segment key row, the "Not priced" line, and the high-contrast toggle; hide the TCO source line for custom $/GPU/hr; shorten labels to "Compute expense", "Profit", and "OpenRouter"; move the export button into the card corner so the title starts at the top; blur number inputs on wheel so scrolling no longer changes a percentage. 中文:每个 x 轴标签以厂商全彩标志开头,并在收入数字上方重复显示;NVIDIA 保持品牌绿色,AMD 箭头在深色模式下反色。移除分段图例行、"未定价"提示和高对比度开关;自定义 $/GPU/hr 时不再显示 TCO 来源;标签简化为"算力支出"、"利润"和"OpenRouter";导出按钮移至卡片右上角,标题从顶部开始;数字输入框在滚轮事件时失焦,滚动不再改变百分比。
Pad the caption on the right by the button's width so a long title or price line wraps before it instead of running under the absolutely placed toolbar. 中文:说明区右侧留出导出按钮宽度的内边距,使过长的标题或价格行在按钮前换行,而不会被绝对定位的工具栏遮挡。
…fold on /profit-estimator - x labels stand upright on two lines (SKU name / framework) when each tick has room, with the vendor mark leading the first line; otherwise they slant as before, mark included. Bottom margin follows the layout. - Below 640px the chart uses compact margins and height, drops segment names then amounts that would not fit, keeps only the margin percentage, and uses a short y-axis title. - Custom $/M token inputs take their own row instead of squeezing the main controls into seven columns. - Chart title now reads "... Estimates per GigaWatt Per Year at ..."; section title "Revenue & Profit Estimator" with the intro paragraph removed; y axis "Revenue per all-in provisioned utility GW per year ($ USD)". - Formula fold titled "Revenue per GigaWatt Formula", collapsed by default; hover/zoom hint under the chart removed (wrapper skips an empty hint). - Unit tests for splitAxisLabel, xLabelLayout, estimateTextWidth and the width-aware label fallbacks; Cypress updated for the fold and layout. 中文:/profit-estimator 的 x 轴标签在空间足够时改为两行竖排(SKU 名称 / 框架),厂商标志位于第一行开头,否则仍为斜排;手机宽度下使用紧凑边距与高度并按宽度省略柱内标签;自定义 $/M token 输入独占一行;图表标题改为"每吉瓦每年收入与利润估算",模块标题改为"收入与利润估算器"并删除说明段;公式折叠默认收起并更名为"每吉瓦收入公式";移除图表下方的悬停提示;补充单元测试与 Cypress 用例。
…els, add license fee to subtitle - Vendor marks appear only above each bar; the x labels carry text alone. - profitYDomain takes the plot height and leaves exactly STACK_HEADROOM_PX above the tallest stack instead of 30%; top margin drops to 12px so the grid starts right under the selling-price line. - slantedMargins grows the left and bottom margins from the widest label so slanted labels never clip on phones (Bugbot). - Subtitle gains "Model License Fee: N%" (ResultContext licenseFee prop). 中文:厂商标志仅保留在柱顶,x 轴标签不再带标志;y 轴顶部留白按标签像素高度精确计算(不再固定 30%),顶部边距缩至 12px;斜排标签的左、下边距按最长标签自动扩展,手机端不再裁切;副标题新增"模型许可费:N%"。
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 4cdabfd. Configure here.
… tabs, move TCO Calculator and Fleet Lifecycle to footer /profit-estimator now prices one chip-hour: revenue is the $/GPU/hr at the target interactivity times utilization, compute expense is the TCO tier's $/chip/hr, and the license fee is 30% of revenue by default. The GW-year view moved to /profit-estimator-per-gigawatt (with /zh mirrors and Kimi K3 slug routes). Both tabs follow Accuracy Evals in the nav; TCO Calculator and Fleet Lifecycle are footer-only links. Segment labels are title case, the vendor mark scales with the bar width (14-40px) and the y headroom follows it, and the per-GW tooltip drops the GPU-hours line. 中文:/profit-estimator 现按每芯片每小时计价:收入为目标交互性下的 $/GPU/hr 乘以利用率,算力支出为所选 TCO 层级的 $/chip/hr,模型许可费默认为收入的 30%。每吉瓦年视图迁移至 /profit-estimator-per-gigawatt(含 /zh 镜像与 Kimi K3 slug 路由)。两个页签在导航中紧随准确率评估;TCO 计算器与集群生命周期改为仅在页脚显示。分段标签改为首字母大写,厂商标志随柱宽缩放(14–40px)并相应调整顶部留白,每吉瓦视图的悬浮框去掉了 GPU 小时数一行。
This comment has been minimized.
This comment has been minimized.
…nce and Accuracy Evals 中文:将两个利润估算页签放在推理性能与准确率评估之间。
…d x labels fit one screen The chart is 720px only when the window has room; otherwise it is the viewport height minus 260px for the sticky nav and card header, never below 440px. On an 872px MacBook viewport that is 612px. 中文:利润估算图表高度随视口调整:窗口有余量时为 720px,否则为视口高度减去 260px(顶部导航与卡片头部),最低 440px;在 872px 高的 MacBook 视口下为 612px,标题与 x 轴标签可同屏显示。
…s as on /inference The TCO $/chip/hr line under the title follows the legend filter, and the cost provider selector reads Owning - Hyperscaler, Owning - Neocloud Giant, 3 Year Rental and Custom $/GPU/hr. 中文:标题下的 TCO $/chip/hr 徽标只列出图例当前显示的芯片;成本供应商选择器改为「自有 - 超大规模」「自有 - Neocloud Giant」「3 年租赁」与「自定义 $/GPU/hr」,与 /inference 一致。
…nav component spec 中文:tab-nav 组件测试改为断言 TCO 计算器与集群生命周期不再出现在页签栏,并检查利润估算页签链接。
…sktop The mark is now 30% of the band width clamped to 14-48px (was 22%, 14-40px), so a six-bar desktop chart shows a 36px logo instead of 26px. Headroom above the tallest stack follows the mark height, so nothing overlaps. 中文:柱顶厂商标志改为柱宽的 30%,范围 14–48px(原 22%,14–40px),桌面端六柱图的标志由 26px 增至 36px;顶部留白随标志高度调整。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Adds two tabs, both hosted by the same component with a
basisprop:/profit-estimator(per chip-hour): one vertical stacked bar per SKU showing the US$ one chip earns in one hour of Kimi K3 agentic inference at a chosen interactivity, split into compute expense (the TCO tier's $/chip/hr), the model license fee (30% of revenue by default), and profit. Figures are dollars and cents./profit-estimator-per-gigawatt(per GW-year): the same per-chip figures scaled by the GPU-hours one all-in utility gigawatt-year buys for that SKU, so chips with different power draw compare on one denominator. Figures are compact ($135.2B).Both have
/zhmirrors and/<tab>/<model slug>routes. In the nav they sit between Inference Performance and Accuracy Evals; TCO Calculator and Fleet Lifecycle move out of the tab bar into the footer's "More" column (pages,/zhmirrors and sitemap entries unchanged). Revenue and margin (profit ÷ revenue) sit above each bar, with the vendor's full-color mark above those; each segment carries its name and dollar amount when it fits. A loss is drawn below the zero line as a hatched segment in the SKU's colour.Inputs and defaults:
revenue × 0.6); TCO is unchanged. No separate haircut segment; the subtitle states the rate.labCutname./inferencey-axis selector), or Custom $/GPU/hr with one input per base chip, seeded from the hyperscaler tier. TheTCO $/chip/hrbadges under the title list only the SKUs the legend currently shows.MODEL_ROUTE_TAB_MODELS['profit-estimator']. No scenario selector (agentic traces are pinned) and no precision selector (auto).Header matches$/chip/hr badges (the TCO source line is omitted for custom $ /GPU/hr), and selling prices. The section above the controls is titled "Revenue & Profit Estimator" / "Revenue & Profit Estimator per GigaWatt" with no intro paragraph. The y axis reads "Revenue per chip per hour ($ USD)" or "Revenue per all-in provisioned utility GW per year ($ USD)". Segments are labelled in place in title case (Compute Expense, Model License Fee, Profit), so there is no separate key and no hover hint under the chart. Formula notes live in a fold titled "Revenue per Chip-Hour Formula" / "Revenue per GigaWatt Formula", collapsed by default; the export button sits in the card's top-right corner and writes PNG and CSV.
/inference: title "Kimi K3 2.8T Agentic Revenue & Profit Estimates per GigaWatt Per Year at P90 45 tok/s/user Interactivity" (per chip-hour: "... per Chip per Hour at ..."), then cost tier, utilization, model license fee, updated date and source, TCOX-axis labels stand upright on two lines (SKU name, then framework and precision) when every tick has room for them, and fall back to the -50° slant otherwise, with margins sized from the labels so nothing clips. The vendor's full-color mark sits only above each bar (NVIDIA green never inverted; AMD's black arrow inverts in dark mode since AMD publishes no color mark) and scales with the bar width, 30% of the band clamped to 14–48px, so desktop bars get a large logo and phones the small one. The y domain leaves exactly the pixel headroom those labels and that mark need above the tallest bar, and the top margin is 12px, so the grid starts right under the selling-price line. The chart height follows the viewport: 720px when the window has room, otherwise the viewport minus 260px for the sticky nav and card header (never below 440px), so on a MacBook the card title and the x labels fit on one screen. Below 640px the chart switches to compact margins and height, drops segment names then amounts that would not fit, keeps only the margin percentage above each bar, and uses a short y-axis title. Custom $/M token inputs take their own row under the main controls. Number inputs blur on mouse wheel so page scrolling never changes a percentage.
Arithmetic per SKU, written out in
docs/tco-calculator.md:The GW-year conversion is the same formula PR #973 uses for its y-metrics; the helpers here live in
profit-estimator.tsand can be collapsed onto whichever lands second.Routing
/profit-estimatorand/profit-estimator-per-gigawatteach open on Kimi K3 (defaultRouteModel)./<tab>/kimi-k3is the same page;Kimi-K3308s to the canonical slug; a model outside the allow-list (e.g.deepseek-v4) 404s. Same on/zh.calculatorandfleetarenavGroup: 'footer-only'; the footer links arefooter-link-calculatorandfooter-link-fleetand calltrack().Library change
chart-update.tsappliesxTickFormatto band x-axes. No existing chart combined a band x-axis withtickFormat, so nothing else changes.d3-chart-wrapper.tsxskips the instructions paragraph wheninstructionsis an empty string; charts that pass nothing still get the default hint.Files
packages/app/src/components/calculator/profit-estimator.ts— pure math and typespackages/app/src/components/calculator/ProfitEstimatorChart.tsx— D3Chart stacked bars, in-bar labels, hatch patterns, vendor marks, tooltippackages/app/src/components/calculator/ProfitEstimatorDisplay.tsx— controls, pricing, legend, header, export, formula fold (EN/ZH strings)packages/app/src/components/ui/result-context.tsx— optionalutilizationandlicenseFeelinespackages/app/src/app/(dashboard)/{profit-estimator,profit-estimator-per-gigawatt}/{page,[model]/page}.tsxand the.../zh/(dashboard)/...mirrorspackages/app/src/components/footer/footer.tsx— TCO Calculator and Fleet Lifecycle linksmodel-routes.ts,sitemap.ts,dashboard-routes.ts,tab-meta.ts,tab-meta-zh.ts,tab-nav.tsxcypress/support/profit-fixtures.ts— synthetic Kimi K3 agentic rows (the captured fixtures have noagentic_traces)docs/tco-calculator.md— new sectionTests
profit-estimator.test.ts: GPU-hours, utilization scaling, revenue-based license fee, skip reasons, chip-hour basis (GPU-hours = 1, power ignored), USD formatting per basis.ProfitEstimatorChart.test.ts: segment stacking order, negative-profit segments, y-domain including losses, tooltip HTML, label resolution, vendor mark lookup,splitAxisLabel/xLabelLayout(two-line vs slanted),slantedMargins, pixel-based y headroom that follows the vendor-mark size,barMarkHeightbounds, width-aware segment and margin labels, chip-hour tooltip (cents, no GPU-hours footer),chartHeightForViewportbounds.model-routes.test.ts,sitemap.test.ts,tab-meta.test.ts,dashboard-routes.test.ts: allow-list, default model, slug rewrite, sitemap entries, nav order (both profit tabs betweeninferenceandevaluation), calculator and fleet footer-only.cypress/e2e/profit-estimator.cy.ts(15): per-GW defaults and title, revenue scales with utilization while TCO does not, license fee = revenue × pct, out-of-range H200 skipped, legend filter, custom cost provider, custom price triple, model route rewrite, 404 for non-allow-listed slug,/zhmirror, collapsed formula fold, two-line labels at desktop width, nav order and footer links, chart height at 720/1200/600px viewports; per chip-hour defaults, title, cent-formatted revenue labels, slug 308/404 and/zhmirror. 15/15 passing locally;navigation,throughput-calculatorandcsv-exportspecs updated for the footer links (13 + 74 + 7 passing).bun run typecheck,lint,fmt,check:typographyclean; full unit suite passing under Node 24.Screenshots
Light (EN) and dark (
/zh) renders are in the Slack thread where this was requested; the repo does not keep doc screenshots.中文说明
新增两个页签,共用同一组件并以$/GPU/hr 乘以利用率,算力支出为所选 TCO 层级的 $ /chip/hr,模型许可费默认为收入的 30%,金额显示到美分;
basis属性区分:/profit-estimator按每芯片每小时计价,收入为目标交互性下的/profit-estimator-per-gigawatt将同一组每芯片数据乘以一个全电源配置吉瓦年可购得的 GPU 小时数,使功耗不同的芯片在同一分母下比较。两者均含/zh镜像与/<页签>/<模型 slug>路由。导航中两个页签位于推理性能与准确率评估之间;TCO 计算器与集群生命周期从页签栏移至页脚「更多」栏(页面、/zh镜像与 sitemap 不变)。每款芯片一根垂直堆叠柱,拆分为算力支出(TCO)、模型许可费与利润;柱顶标注收入、利润率与厂商全彩标志,各段内标注名称与金额;亏损以该芯片颜色的斜纹段绘制在零线以下。输入与默认值:目标交互性 45 tok/s/user(数字输入,实测曲线未覆盖目标的芯片不绘制且不出现在图例中);利用率 60%(仅缩放收入,TCO 不变);模型许可费为收入的 30%;成本供应商选项与$/GPU/hr;标题下的 TCO $ /chip/hr 徽标仅列出图例当前显示的芯片;Token 售价取自 OpenRouter 或自定义输入/缓存输入/输出价。模型选择器目前仅开放 Kimi K3,切换模型会改写路由;不在白名单内的 slug 返回 404。移除场景与精度选择器。标题与副标题格式对齐 $/GPU/hr 时不显示 TCO 来源;x 轴标签在空间足够时两行竖排(SKU 名称 / 框架),否则斜排并按标签长度扩展边距;厂商全彩标志仅显示在柱顶并随柱宽缩放(14–48px),顶部留白随之调整;各段标签首字母大写;每吉瓦视图的悬浮框不再显示 GPU 小时数;副标题含利用率与模型许可费;各段就地标注,无单独图例,图表下方无悬停提示;公式折叠默认收起并命名为「每芯片小时收入公式」/「每吉瓦收入公式」;图表高度随视口调整(有余量时 720px,否则为视口高度减 260px,最低 440px),使标题与 x 轴标签在笔记本屏幕上同屏可见;手机宽度下使用紧凑边距并按宽度省略柱内标签;自定义 $ /M token 输入独占一行;导出按钮位于卡片右上角,支持 PNG 与 CSV;数字输入框在滚轮时失焦。
/inference纵轴选择器同名(自有 - 超大规模、自有 - Neocloud Giant、3 年租赁)或按芯片自定义/inference(每吉瓦每年收入与利润估算),模块标题为「收入与利润估算器」且无说明段,自定义计算公式见$/GPU/hr × GPU 小时数 × 利用率;TCO = 成本 $ /GPU/hr × GPU 小时数;许可费 = 收入 × 比例;利润 = 收入 − TCO − 许可费。Cypress 使用
docs/tco-calculator.md:GPU 小时数 = 1(每芯片小时)或 (1,000,000 kW ÷ 每 GPU 全电源配置 kW) × 8,760(每吉瓦年);收入 = 售价折算的cypress/support/profit-fixtures.ts中合成的 Kimi K3 智能体数据(现有 fixture 无 agentic_traces)。Note
Medium Risk
New revenue/profit calculations and a major nav reshuffle change how users reach key tools; risk is mitigated by unit tests, Cypress specs, and reuse of existing TCO/token-revenue logic rather than new auth or data stores.
Overview
Adds two primary nav tabs—
/profit-estimator(per chip-hour) and/profit-estimator-per-gigawatt(per GW-year)—that shareProfitEstimatorDisplayand plot stacked revenue, TCO, model license fee, and profit per SKU at a fixed agentic-traces workload (Kimi K3 only for now), with OpenRouter or custom token pricing, TCO tiers or custom $/GPU/hr, utilization, and typed interactivity.TCO Calculator and Fleet Lifecycle leave the tab bar for footer links; pages and sitemap entries stay the same. Routing adds EN/
/zhpages plus per-model slugs (308 aliases, 404 outside allow-list); sitemap uses per-tabmodelRoutesForTabanddefaultRouteModel(Kimi K3 on profit tabs).Supporting changes:
profit-estimator.tseconomics, D3 stacked chart with responsive height and in-bar labels,ResultContextutilization/license fee lines, band-axisxTickFormatin chart updates, optional empty chart instructions, docs intco-calculator.md, Cypress profit fixtures, and broad unit/e2e coverage.Reviewed by Cursor Bugbot for commit 879bb96. Bugbot is set up for automated code reviews on this repo. Configure here.