You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/embed.md
+26-69Lines changed: 26 additions & 69 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,16 +1,10 @@
1
1
# Embed Routes
2
2
3
-
Public-contract, stable iframe-embedding surface for InferenceX charts. Partner sites can embed any supported chart by iframing an `/embed/*` URL and rely on it continuing to work long-term.
3
+
Publiciframe-embedding surface for InferenceX charts. Partner sites can embed any supported chart by iframing an `/embed/*` URL.
4
4
5
-
## Stability guarantee
5
+
## URL parameter contract
6
6
7
-
The embed URL shape is a **public API**. The following rules apply permanently:
8
-
9
-
- Existing parameter keys **cannot be removed or renamed**. New keys may be added with sensible defaults.
10
-
- Existing `y` short-form aliases **cannot be removed or renamed**. New aliases may be added.
11
-
- Existing `gpus` hwKey tokens **cannot be removed or renamed**. New tokens may be added when new hardware is added to the benchmark.
12
-
- Unknown values always fall back to the documented default — a stale embed URL must never render an error page.
13
-
- If a rename becomes unavoidable, the old key/alias must be kept as a permanently-handled alias alongside the new one, and a note added to this file.
7
+
Embed URLs use **the same `g_*` / `i_*` parameter keys as the main `/inference` site** — there is no separate embed-specific key contract to maintain. If a site key is renamed or a new key is added, the embed URL automatically benefits from the change. The only embed-specific key is `i_chart` (which chart variant to display — the main site renders both E2E and interactivity together, embeds show only one).
14
8
15
9
## Supported routes
16
10
@@ -23,74 +17,37 @@ The embed URL shape is a **public API**. The following rules apply permanently:
These are the short DB keys accepted as `model=`. They map to the display model names shown in the chart. Unknown keys fall back to the default (`dsr1`).
44
-
45
-
The authoritative list lives in `DB_MODEL_TO_DISPLAY` in `packages/constants/src/`. Representative examples:
46
-
47
-
|`model=` value | Display name |
48
-
| -------------- | -------------------------- |
49
-
|`dsr1`| DeepSeek-R1-0528 |
50
-
|`dsv4`| DeepSeek-V4-Pro |
51
-
|`llama70b`| Llama-3.3-70B-Instruct-FP8 |
52
-
|`llama405b`| Llama-3.1-405B-Instruct |
53
-
|`qwen72b`| Qwen2.5-72B-Instruct |
54
-
55
-
### `y` — accepted short-form aliases
56
-
57
-
Both the short form (`tpPerGpu`) and the full internal form (`y_tpPerGpu`) are accepted. **Short-form aliases listed here cannot be removed.**
|`tpPerGpu`| Total throughput per GPU (tokens/s/GPU) — **default**|
62
-
|`inputTputPerGpu`| Input throughput per GPU |
63
-
|`outputTputPerGpu`| Output throughput per GPU |
64
-
|`tpPerMw`| Total throughput per MW |
65
-
|`inputTputPerMw`| Input throughput per MW |
66
-
|`outputTputPerMw`| Output throughput per MW |
67
-
|`costh`| Cost per hour |
68
-
|`costn`| Cost per 1 M input tokens |
69
-
|`costr`| Cost per 1 M output tokens |
70
-
|`costhOutput`| Cost per hour (output) |
71
-
|`costnOutput`| Cost per 1 M input tokens (output) |
72
-
|`costrOutput`| Cost per 1 M output tokens (output) |
73
-
|`costhi`| Cost per hour (interactivity) |
74
-
|`costni`| Cost per 1 M input tokens (interactivity) |
75
-
|`costri`| Cost per 1 M output tokens (interactivity) |
76
-
|`jTotal`| Joules per total token |
77
-
|`jOutput`| Joules per output token |
78
-
|`jInput`| Joules per input token |
79
-
80
-
### `gpus` — hwKey format
81
-
82
-
The `gpus` parameter is a comma-separated list of hwKey tokens. Each token encodes the hardware and the inference framework together, separated by an underscore (e.g. `b200_sglang`, `gb300_dynamo-sglang`).
83
-
84
-
**These tokens are stable.** Any hwKey token that has ever been publicly supported in an embed URL must continue to be accepted. New tokens are added when new hardware or framework combinations are added to the benchmark. Existing tokens cannot be removed; retired hardware tokens simply filter to no visible points (which is the same as the user having toggled that GPU off).
85
-
86
-
To discover the current set of valid hwKeys, visit `/inference` on the live site, open the legend, and note the identifiers shown — or use **Export → Copy embed** on the chart to copy an iframe snippet that already encodes your current filters.
|`g_model`| string |`DeepSeek-R1-0528`| Display model name — same as `g_model` on the main site. |
29
+
|`i_seq`| string |`8k/1k`| Sequence string (e.g. `8k/1k`, `1k/1k`, `1k/8k`) — same as `i_seq` on the main site. |
30
+
|`i_prec`| string |`fp4`| Comma-separated precision keys (e.g. `fp4`, `fp8`, `bf16`) — same as `i_prec` on the main site. |
31
+
|`i_metric`| string |`y_tpPerGpu`| Y-axis metric key (e.g. `y_tpPerGpu`, `y_costh`) — same as `i_metric` on the main site. |
32
+
|`i_active`| string | `` (all visible) | Comma-separated hwKey allow-list (e.g. `b200_sglang,gb300_dynamo-sglang`). When set, the embed legend and chart universe are restricted to exactly these GPUs. Viewers can toggle them on/off but cannot add GPUs outside this set. When absent, all GPUs for the selected model/sequence/precision are shown. |
33
+
|`i_chart`| string |`e2e`| Chart variant to render: `e2e` or `interactivity`. Embed-only key — the main site renders both charts together. |
34
+
35
+
All other `g_*` / `i_*` keys recognized by the main site (e.g. `i_scale`, `i_hc`, `i_nolabel`) are passed through as-is and respected by the embed — the provider stack is identical. Unknown keys are silently ignored.
36
+
37
+
### `i_active` — hwKey format
38
+
39
+
Each hwKey token encodes hardware and inference framework together, separated by an underscore (e.g. `b200_sglang`, `gb300_dynamo-sglang`). To find valid hwKey values, visit `/inference` on the live site, open the legend, and note the identifiers shown — or use **Export → Copy embed** to get a ready-made URL with your current filters already encoded.
40
+
41
+
### `i_metric` — accepted values
42
+
43
+
Full `y_*` internal keys (e.g. `y_tpPerGpu`, `y_costh`). The authoritative list is in `packages/app/src/lib/chart-utils.ts` (`Y_AXIS_METRICS`).
87
44
88
45
## Embed mode behavior
89
46
90
47
- Site header, footer, background decorations, and navigation are hidden on all `/embed/*` routes.
91
-
- A "SemiAnalysis InferenceX →" link appears in the chart caption (`Source: …`), deep-linking to the equivalent canonical dashboard URL.
48
+
- A "SemiAnalysis InferenceX →" link appears in the chart caption (`Source: …`), deep-linking to the equivalent canonical dashboard URL. The canonical URL is built from the same embed params (minus `i_chart`), so opening it reproduces the same chart state on the main site.
92
49
-`robots: noindex, nofollow` is set on all embed routes — they won't appear in search results.
93
-
- An `embed_view` PostHog event is fired once on mount, capturing `referrer`, `embed_host`, `embed_chart`, `model`, `sequence`, `gpus`, `y_metric`, and `precisions`. This makes external embed traffic attributable in analytics.
50
+
- An `embed_view` PostHog event is fired once on mount, capturing `referrer`, `embed_host`, `embed_chart`, `model` (`g_model`), `sequence` (`i_seq`), `precisions` (`i_prec`), `gpus` (from `i_active`), and `y_metric` (`i_metric`). This makes external embed traffic attributable in analytics.
94
51
95
52
## CSP / framing
96
53
@@ -102,7 +59,7 @@ All other routes set `frame-ancestors 'self'` and `X-Frame-Options: SAMEORIGIN`,
0 commit comments