Skip to content

Add read-only views API (/api/v1/views/*) and inferencex-skills package / 新增只读视图 API 与 inferencex-skills 技能包 - #901

Open
functionstackx wants to merge 5 commits into
masterfrom
feat/views-api
Open

Add read-only views API (/api/v1/views/*) and inferencex-skills package / 新增只读视图 API 与 inferencex-skills 技能包#901
functionstackx wants to merge 5 commits into
masterfrom
feat/views-api

Conversation

@functionstackx

@functionstackx functionstackx commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

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)

Endpoint Mirrors
/options every selector: models, hardware, frameworks, precisions, metrics, x-axis modes, percentiles (p75/p90), scenarios
/inference main dashboard scatter/lines (all 48 metrics, GPU/framework/precision/kv-offload filters, frontier flags)
/historical historical trends lines (incl. synthetic:true extensions)
/calculator throughput calculator (full per-hardware result incl. fleet block)
/fleet fleet lifecycle margins
/reliability reliability dashboard aggregates
/evaluation eval scores per config (per-date rows)
/gpu-specs GPU spec sheet
/overview landing overview
/rankings fastest-gpu / cheapest-gpu rankings
/compare 2-GPU head-to-head
  • Envelope: {view, apiVersion, params(resolved), ...payload}; structured 400s {error, param, allowed}; CSV via format=csv.
  • Dashboard parity: series labels match dashboard legends exactly (e.g. GB300 NVL72 (Dynamo SGLang, MTP)); GPU filters accept base keys (b200) and full hwKeys (b200_trt).
  • Pure chart logic extracted from client hooks (useChartDatachart-data-core, etc.) so API and dashboard share identical math; hooks re-export unchanged.
  • Docs integrated into /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

  • 58-case live test matrix against a dev server hitting the production DB: 58/58 pass, spot-checked against dashboard numbers.
  • Full suite: 264 files / 4,559 tests (app) + skills/root suites — all green; typecheck, lint, fmt clean.
  • All 5 matplotlib examples executed and charts visually inspected.

中文说明

新增只读视图 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 that mirrors production benchmark/eval data and must stay numerically aligned with dashboards; mistakes in shared extraction or param canonicalization could mislead API consumers, though auth paths are unchanged.

Overview
Adds a read-only views API under GET /api/v1/views/* (11 endpoints: options, inference, historical, calculator, fleet, reliability, evaluation, gpu-specs, overview, rankings, compare) with a shared envelope (view, apiVersion, resolved params), structured 400 responses (param + allowed), optional CSV via format=csv, and caching aligned with existing benchmark/eval routes.

Each handler runs the same pipelines as the dashboards (not reimplemented math): e.g. buildInferenceSeries, interpolated historical trends, calculator interpolation/fleet sizing, overview/rankings/compare projections, and eval chart aggregation. Pure logic is extracted from client hooks into importable modules—throughput-data.ts (from useThroughputData), resolveEvaluationDate in date-resolution—so server routes and the UI stay in parity; route tests assert that parity explicitly.

Also ships @semianalysisai/inferencex-skills (packages/skills) with an inferencex-skills install CLI and bundled agent skills (API reference, matplotlib examples, React/HTML charting). Cypress landing-performance test excludes /logos/models/ from the mobile logo carousel count to fix Firefox/CI flakiness.

Reviewed by Cursor Bugbot for commit 7fd8281. Bugbot is set up for automated code reviews on this repo. Configure here.

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 可视化),示例脚本均经实测验证。
@vercel

vercel Bot commented Aug 27, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
inferencemax-app Ready Ready Preview Aug 27, 2026 10:03am

Request Review

Comment thread packages/app/src/app/api/v1/views/inference/route.ts
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 一致在解析时
转为小写,并补充回归测试。

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit aef7710. Configure here.

Comment thread packages/app/src/app/api/v1/views/inference/route.ts Outdated
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 工作区包。
@blacksmith-sh

blacksmith-sh Bot commented Aug 27, 2026

Copy link
Copy Markdown

Found 1 test failure on Blacksmith runners:

Failure

Test View Logs
Landing page performance/does not load the decorative circuit mask on mobile View Logs

Fix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

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。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant