Skip to content

Add Fireworks balance usage panel - #6488

Open
dhh wants to merge 1 commit into
quattrofrom
fireworks-balance-panel
Open

Add Fireworks balance usage panel#6488
dhh wants to merge 1 commit into
quattrofrom
fireworks-balance-panel

Conversation

@dhh

@dhh dhh commented Aug 1, 2026

Copy link
Copy Markdown
Member

Summary

  • add Fireworks as a third model-usage provider with firectl and environment credential discovery
  • show estimated prepaid balance in the existing subscription-panel layout while retaining token-by-day and token-by-model sections
  • fetch 30 days of Fireworks serverless token usage and keep cached prompt tokens from being double-counted
  • document funding configuration and cover parsing, credential, money, and partial-failure behavior

Testing

  • ./test/shell
  • focused Fireworks scanner test
  • qmllint for the model-usage QML files
  • live QML panel verification for layout, clipping, spacing, and three-provider navigation

Notes

Fireworks does not expose its live prepaid ledger through the documented API. The displayed balance is explicitly labeled estimated and is calculated from configured funded credit minus rated account costs.

Copilot AI review requested due to automatic review settings August 1, 2026 16:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds Fireworks prepaid usage and estimated-balance support to the model-usage panel.

Changes:

  • Adds Fireworks billing scanning, credentials, and tests.
  • Adds balance UI and three-provider navigation.
  • Documents Fireworks funding configuration.

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
test/shell.d/model-usage-fireworks-scanner-test.sh Tests Fireworks parsing and failures.
shell/plugins/model-usage/scripts/fireworks_usage_scanner.py Fetches usage and estimates balance.
shell/plugins/model-usage/README.md Documents Fireworks configuration.
shell/plugins/model-usage/providers/Fireworks.qml Adds the Fireworks provider adapter.
shell/plugins/model-usage/providers/Codex.qml Adds shared provider properties.
shell/plugins/model-usage/providers/Claude.qml Adds shared provider properties.
shell/plugins/model-usage/Panel.qml Renders prepaid balance information.
shell/plugins/model-usage/manifest.json Registers Fireworks defaults.
shell/plugins/model-usage/Main.qml Integrates Fireworks and synchronization.
shell/plugins/model-usage/assets/fireworks.svg Adds the provider icon.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +240 to +249
def usage(self, account_id: str, start_day: date, end_day: date) -> dict[str, Any]:
quoted = urllib.parse.quote(normalize_account_id(account_id), safe="")
query = {
"startTime": start_day.isoformat() + "T00:00:00Z",
"endTime": end_day.isoformat() + "T00:00:00Z",
"usageType": "SERVERLESS",
"timezone": timezone_name(),
"groupBy": ["model_name"],
}
return self.request(f"/v1/accounts/{quoted}/billingUsage", query=query)
Comment on lines +243 to +246
"startTime": start_day.isoformat() + "T00:00:00Z",
"endTime": end_day.isoformat() + "T00:00:00Z",
"usageType": "SERVERLESS",
"timezone": timezone_name(),
onReadyChanged: root.scheduleSync()
}

property var providers: [claudeProvider, codexProvider, fireworksProvider]
Comment on lines +239 to +247
if (root.hasBalance) {
var parts = []
if (provider.balanceEstimated === true) parts.push("Estimated balance")
var refreshedAt = Number(provider.lastRefreshedAtMs || 0)
if (refreshedAt > 0) {
var ageMs = Math.max(0, root.nowMs - refreshedAt)
parts.push(ageMs < 60000 ? "Updated now" : "Updated " + formatDuration(ageMs) + " ago")
}
return parts.join(" · ")
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