Skip to content

feat(embeddings): add quota summary and TokenUsageBar card to embeddings page - #460

Open
cagedbird043 wants to merge 1 commit into
tashfeenahmed:mainfrom
cagedbird043:feat/embeddings-token-usage-card
Open

feat(embeddings): add quota summary and TokenUsageBar card to embeddings page#460
cagedbird043 wants to merge 1 commit into
tashfeenahmed:mainfrom
cagedbird043:feat/embeddings-token-usage-card

Conversation

@cagedbird043

@cagedbird043 cagedbird043 commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a quota summary and multi-account pooled budget card (TokenUsageBar) to the Embeddings page, aligning its UI design with the main Models page.

Changes

  • In server/src/routes/embeddings.ts, parse quota labels (e.g. Cloudflare Neurons/day, HuggingFace monthly credits) and scale by active key count to calculate totalBudget, totalUsed, and per-family budgets in /api/embeddings/usage.
  • Export TokenUsageBar and TokenUsageData from FallbackPage.tsx.
  • In EmbeddingsPage.tsx, render <TokenUsageBar> at the top of the Embeddings tab when total budget is available.
image

@tashfeenahmed

Copy link
Copy Markdown
Owner

Thanks. Two things before this can go in: (1) parseEmbeddingQuotaLabel hardcodes equivalences (10K neurons/day approximated as 30M tokens/mo, $0.10 as 2M tokens) inferred from quota label strings, plus a silent cloudflare default; those numbers will drift and mislead. If we can't compute a real figure from recorded usage, it's better to show the quota label as-is. (2) TokenUsageBar is imported from FallbackPage into EmbeddingsPage; a shared component should move to components/ rather than being owned by a sibling page. Also note #459 and #457 merged, so a rebase picks up pooled scaling and key load-balancing. Happy to review a revision.

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