Skip to content

Add Variant Usage UI: chart component + function overview integration#7233

Open
AntoineToussaint wants to merge 1 commit intomainfrom
feat/variant-usage-ui-frontend
Open

Add Variant Usage UI: chart component + function overview integration#7233
AntoineToussaint wants to merge 1 commit intomainfrom
feat/variant-usage-ui-frontend

Conversation

@AntoineToussaint
Copy link
Copy Markdown
Member

@AntoineToussaint AntoineToussaint commented Apr 8, 2026

Summary

Adds the frontend for variant-level token/cost statistics. Stacked on #7230 (backend API endpoint).

  • API client method: getVariantUsageTimeseries() in tensorzero.ts
  • VariantUsage.tsx: Stacked bar chart with metric selector (inferences/tokens/cost), time granularity, cost coverage warning
  • VariantUsageSection.tsx: Section wrapper for function overview page
  • variant-usage-data.server.ts: Server-side data loader
  • Integrated into function overview page between Throughput and Metrics sections
  • Generated TypeScript bindings for VariantUsageTimePoint, GetVariantUsageResponse
CleanShot 2026-04-08 at 14 35 00@2x

Test plan

  • pnpm -r typecheck
  • pnpm run format && pnpm run lint (UI)
  • Manual: navigate to function overview, verify Variant Usage chart renders

🤖 Generated with Claude Code

Copy link
Copy Markdown
Contributor

could you rebase onto main?

Copy link
Copy Markdown
Contributor

also could you add a playwright test?

Full UI stack for variant-level token/cost statistics:
- API client method: getVariantUsageTimeseries() in tensorzero.ts
- VariantUsage.tsx: Stacked bar chart with metric selector
  (inferences/tokens/cost), time granularity, cost coverage warning
- VariantUsageSection.tsx: Section wrapper for function overview
- variant-usage-data.server.ts: Server-side data loader
- Integrated into function overview page between Throughput and Metrics
- Generated TypeScript bindings for VariantUsageTimePoint

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

2 participants