Add read-only views API (/api/v1/views/*) and inferencex-skills package / 新增只读视图 API 与 inferencex-skills 技能包 - #901
Add read-only views API (/api/v1/views/*) and inferencex-skills package / 新增只读视图 API 与 inferencex-skills 技能包#901functionstackx wants to merge 6 commits into
Conversation
Expose every dashboard view as GET /api/v1/views/* — options, inference, historical, calculator, fleet, reliability, evaluation, gpu-specs, overview, rankings, compare — with CSV support, dashboard-parity legend labels, base-GPU-key expansion, and full docs/catalog integration. Pure chart logic is extracted from client hooks into shared core modules so routes and dashboard consume identical math. Adds the @semianalysisai/inferencex-skills package (api / matplotlib / react / html skills) with validated example scripts. 中文:新增只读视图 API(/api/v1/views/*),以数据形式开放仪表盘全部视图与 选项,支持 CSV、与仪表盘一致的图例标签、GPU 基础键展开,并同步 API 文档与 路由目录。图表纯逻辑从客户端 Hook 抽取为共享核心模块,确保 API 与仪表盘 使用同一套计算。同时新增 @semianalysisai/inferencex-skills 技能包 (API 使用、matplotlib、React、HTML 可视化),示例脚本均经实测验证。
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Bugbot: inference left gpus in caller case and exact-matched lowercase hwKeys, so gpus=B200 silently returned empty series; historical echoed raw case in params while filtering lowercase. Both now lower-case at parse like calculator and fleet, with a regression test. 中文:修复 inference 与 historical 视图 gpus 参数未做大小写归一的问题 (如 gpus=B200 会静默返回空序列),现与 calculator、fleet 一致在解析时 转为小写,并补充回归测试。
Bugbot follow-up: lowering after the parser's dedup/sort left mixed-case lists unsorted or duplicated and produced non-canonical cache keys. parseFreeListParam now lower-cases before dedup/sort; the four view routes drop their per-call maps. 中文:跟进 Bugbot 意见,将小写归一移入 parseFreeListParam(在去重排序之前 执行),避免混合大小写列表产生重复项、乱序及非规范缓存键;四个视图路由删除 各自的重复转换。
CI runs bun install --frozen-lockfile, which rejects the new packages/skills workspace package until the lockfile records it. 中文:CI 使用 --frozen-lockfile 安装依赖,需在 bun.lock 中登记新增的 packages/skills 工作区包。
|
Found 2 test failures on Blacksmith runners: Failures
|
The AgentX ledger's lazy /logos/models/*.svg marks sit near Firefox's lazy-load distance on the 823px mobile viewport, so the ledger nondeterministically prefetches them and the carousel-logo count assertion flaked (reproduced 2/3 locally on master-equivalent code; Chrome unaffected). Exclude the ledger's sub-KB model marks — visible mobile content, not decorative weight — and surface offending URLs in the failure message. 中文:AgentX 结果列表的懒加载模型标志在 Firefox 移动视口下处于懒加载 预取距离边缘,导致该断言在 CI 中不稳定(在与 master 等价的代码上本地 复现 2/3 失败;Chrome 不受影响)。现将列表中不足 1KB 的模型标志排除 在轮播标志计数之外,并在断言失败信息中列出具体 URL。
Resolve conflicts from the hook -> pure-module extraction against master's token-revenue, cache-pricing, powerValid, and refetch/retry changes: - interpolated-trend-core.ts: port tokenRevenuePerGpuHour pricing (applyTokenRevenuePricing, tokenRevenueFromRatesPerGpuHour, pricingCacheHitRate), drop removed tokensPerRmb* proportional keys; hook wrapper gains tokenRevenuePricing/error/refetch. - throughput-data.ts: replace local cacheHitRateOf with pricingCacheHitRate (GB300 theoretical-hit-rate fallback, #980). - reliability/aggregate.ts, EvaluationContext.tsx: keep extraction, port master's lint-style tweak and retryFailedEvaluationQueries. - api-documentation.ts: merge imports (POWER_METRIC_KEYS, POWER_VALIDITY_FILTERS) with api-documentation-base re-exports. - views/inference: pass power: [] for the new measured-power quick filter. - Default metric is now y_tokensPerDollarH (master); update docs, skills reference, and tests; refresh inference route SHA-256 digest. - landing-performance.cy.ts: take master's text-only supporter strip assertion, which supersedes the earlier deflake.
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 00550b6. Configure here.
| key: groupKey, | ||
| hwKey, | ||
| precision, | ||
| label: hardwareLegendLabel(hwKey), |
There was a problem hiding this comment.
Historical labels omit model overrides
Medium Severity
hardwareLegendLabel is called without the resolved model, so per-model suffix overrides never apply. The inference view passes the model through, and getHardwareConfig uses that argument to rewrite tokens such as M3 mtp to EAGLE. Historical series labels therefore diverge from the dashboard legends this API is meant to match.
Reviewed by Cursor Bugbot for commit 00550b6. Configure here.


Summary
Read-only views API exposing every dashboard view as data, plus a downloadable skills package for API consumers.
API —
GET /api/v1/views/*(11 endpoints)/options/inference/historicalsynthetic:trueextensions)/calculator/fleet/reliability/evaluation/gpu-specs/overview/rankings/compare{view, apiVersion, params(resolved), ...payload}; structured 400s{error, param, allowed}; CSV viaformat=csv.GB300 NVL72 (Dynamo SGLang, MTP)); GPU filters accept base keys (b200) and full hwKeys (b200_trt).useChartData→chart-data-core, etc.) so API and dashboard share identical math; hooks re-export unchanged./api-documentation+ route catalog with sha256 guard; bilingual (EN/中文) doc strings.Skills package —
packages/skills(@semianalysisai/inferencex-skills)4 skills with SKILL.md guides + validated examples:
inferencex-api(endpoint reference),inferencex-matplotlib(5 runnable scripts — pareto frontier, calculator bars, historical trends, fleet margins, eval scores),inferencex-react,inferencex-html(Chart.js). Installer CLI (bin/install.mjs) copies skills into agent skill dirs.Testing
中文说明
新增只读视图 API(
GET /api/v1/views/*,共 11 个端点),以数据形式开放仪表盘全部视图与选项:选项枚举、主图表、历史趋势、吞吐计算器、集群利润周期、可靠性、评测分数、GPU 规格、总览、排名与双卡对比。统一响应信封与结构化 400 错误,支持 CSV 输出;序列图例标签与仪表盘完全一致,GPU 筛选同时接受基础键(b200)与完整硬件键(b200_trt)。图表纯逻辑从客户端 Hook 抽取为共享核心模块,确保 API 与仪表盘使用同一套计算;文档已并入/api-documentation与路由目录(含 sha256 守护测试),中英双语。同时新增
@semianalysisai/inferencex-skills技能包:API 使用、matplotlib(5 个已实测脚本)、React、HTML/Chart.js 四个技能,附安装 CLI。实测矩阵 58/58 通过,全部单元测试、类型检查、lint、格式检查均通过。Note
Medium Risk
Large new public API surface tied to core benchmark interpolation and fleet economics; mistakes would misreport data, though routes are read-only and reuse established dashboard logic.
Overview
Introduces a read-only views API at
GET /api/v1/views/*with eleven endpoints that mirror major dashboards (inference charts, historical trends, calculator, fleet lifecycle, evaluation, reliability, overview, rankings, compare, gpu-specs, plus a static/optionsdiscovery feed). Handlers sharerunViewsRoute, query parsers, and CSV helpers; responses use a common{ view, apiVersion, params, … }envelope with structured400errors and optionalformat=csv.Dashboard parity is enforced by wiring routes to the same pure pipelines the UI already uses (e.g.
buildInferenceSeries,interpolated-trend-core, calculatorbuildGpuGroups/interpolateForGPU, compare/overview/rankings server libs), with caching aligned to existing benchmark/eval/reliability queries where noted.Refactors move server-safe logic out of client modules:
throughput-data.tsfromuseThroughputData,date-resolution.tsfromEvaluationContext, and updateshistorical-bestimports accordingly. Each new route ships with Vitest coverage asserting validation, CSV output, and numeric parity with the page math.Also adds workspace package
@semianalysisai/inferencex-skills(packages/skills) withinferencex-skillsCLI to install agent skills for API/charting consumers;bun.lockregisters the workspace.Reviewed by Cursor Bugbot for commit 00550b6. Bugbot is set up for automated code reviews on this repo. Configure here.