feat(embed): add /embed/scatter route for iframe embedding#311
Open
functionstackx wants to merge 1 commit intomasterfrom
Open
feat(embed): add /embed/scatter route for iframe embedding#311functionstackx wants to merge 1 commit intomasterfrom
functionstackx wants to merge 1 commit intomasterfrom
Conversation
Adds a stable, public-contract embed surface at /embed/scatter so partner sites can iframe the inference scatter chart. Closes #269. URL contract (long-term-stable, lives in lib/embed-params.ts): /embed/scatter?model=<dbKey>&isl=<n>&osl=<n>&precisions=<csv> &gpus=<csv>&y=<metric>&chart=<e2e|interactivity> Embed-only chrome: - Header / Footer hidden via ChromeGate on /embed/* - Small "SemiAnalysis InferenceX -> " attribution link at the bottom-right that deep-links to the equivalent /inference URL - robots noindex, nofollow CSP / framing (next.config.ts headers()): - /embed/*: frame-ancestors * - everything else: frame-ancestors 'self' + X-Frame-Options: SAMEORIGIN Analytics: - embed_view on mount with referrer + host - embed_attribution_clicked on the canonical-link CTA Translation seeds the internal g_*/i_* url-state cache before the providers' lazy useState initializers fire, so the chart mounts already pointed at the requested embed params. Co-authored-by: functionstackx <functionstackx@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
This project sounds pretty interesting, not going to lie. |
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.
Closes #269.
Adds a stable, public-contract embed surface at
/embed/scatterso partner sites can iframe the inference scatter chart.URL contract (long-term-stable)
model— DB model key (dsr1,llama70b,dsv4, …). Defaultdsr1.isl/osl— sequence input/output token lengths. Default8192/1024.precisions— comma-separated precision keys. Defaultfp4.gpus— comma-separated hwKeys (e.g.b300_sglang,gb300_dynamo-sglang).y— y-axis metric (tpPerGpu,costh,tpPerMw, …). DefaulttpPerGpu.chart—e2e(default) orinteractivity.Embed-only chrome
ChromeGateon/embed/*./inferenceURL with equivalent internal params.noindex, nofollowon the route.CSP / framing (
next.config.tsheaders)/embed/*:Content-Security-Policy: frame-ancestors *frame-ancestors 'self'+X-Frame-Options: SAMEORIGIN(non-framable)Verified via
curl -I.Analytics
embed_viewon mount withchart_type,model,sequence,precisions,gpus,y_metric,referrer,embed_hostembed_attribution_clickedon the canonical-link CTAVerification
pnpm typecheckpnpm lintpnpm fmtpnpm test:unitembed-scatter.cy.tsinference-chart.cy.tssanity.cy.ts/embed/scatter@1280px/embed/scatter@600px?y=costhcurl -I /embed/scatterframe-ancestors *, noX-Frame-Options✅curl -I /inferenceframe-ancestors 'self'+SAMEORIGIN✅Generated with Claude Code